2 files added
5 files modified
| | |
| | | const fs = require("node:fs") |
| | | |
| | | const db = require("./lib/db") |
| | | const libIlias = require("lib/libIlias") |
| | | const settings = require("./settings") |
| | | const search = require("./lib/search.js") |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | .delete("/api/user/:usr_id", function (req, res) { |
| | | const {usr_id} = req.params |
| | | if (!usr_id || isNaN(Number(usr_id))) { |
| | | return res.code(500).send({status: "error", msg: "userId error"}) |
| | | } |
| | | else { |
| | | const res2 = libIlias.deleteUser(usr_id) |
| | | console.log(res2) |
| | | return res.send(res2) |
| | | } |
| | | |
| | | }) |
| | | |
| | | /////// ref_id / obj_id //////////////////////////////////////////////////////////////// |
| | | |
| | | .get("/api/ref_id/:ref_id", async function (req, res) { |
| New file |
| | |
| | | /* Lib for interacting with customized ILIAS php */ |
| | | |
| | | module.exports = { |
| | | deleteUser, |
| | | } |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | const settings = require("../settings") |
| | | const {url} = settings.ilias |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | async function deleteUser (obj_id, dry = false) { |
| | | const sp = new URLSearchParams({ |
| | | command: "deleteUser", |
| | | obj_id, |
| | | dry : dry ? 1 : 0, |
| | | }) |
| | | let url2 = `${url}?${sp.toString()}` |
| | | console.log("libIlias.deleteUser >>>", url2) |
| | | const res = await fetch(url2, {method: "DELETE"}) |
| | | // console.log(res) |
| | | const data = await res.json() |
| | | return data |
| | | } |
| | |
| | | "@fastify/static": "^8.2.0", |
| | | "@vueuse/core": "^13.3.0", |
| | | "@vueuse/router": "^13.3.0", |
| | | "chai": "^5.2.0", |
| | | "dayjs": "^1.11.13", |
| | | "dotenv": "^16.5.0", |
| | | "fastify": "^5.3.3", |
| | | "flexsearch": "^0.8.205", |
| | | "lodash": "^4.17.21", |
| | | "mocha": "^11.6.0", |
| | | "mysql2": "^3.14.1", |
| | | "nconf": "^0.13.0", |
| | | "nodemon": "^3.1.10", |
| | |
| | | "node": ">= 8" |
| | | } |
| | | }, |
| | | "node_modules/argparse": { |
| | | "version": "2.0.1", |
| | | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", |
| | | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", |
| | | "license": "Python-2.0" |
| | | }, |
| | | "node_modules/assertion-error": { |
| | | "version": "2.0.1", |
| | | "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", |
| | | "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=12" |
| | | } |
| | | }, |
| | | "node_modules/async": { |
| | | "version": "3.2.6", |
| | | "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", |
| | |
| | | "engines": { |
| | | "node": ">=8" |
| | | } |
| | | }, |
| | | "node_modules/browser-stdout": { |
| | | "version": "1.3.1", |
| | | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", |
| | | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", |
| | | "license": "ISC" |
| | | }, |
| | | "node_modules/browserslist": { |
| | | "version": "4.25.0", |
| | |
| | | } |
| | | ], |
| | | "license": "CC-BY-4.0" |
| | | }, |
| | | "node_modules/chai": { |
| | | "version": "5.2.0", |
| | | "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", |
| | | "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "assertion-error": "^2.0.1", |
| | | "check-error": "^2.1.1", |
| | | "deep-eql": "^5.0.1", |
| | | "loupe": "^3.1.0", |
| | | "pathval": "^2.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=12" |
| | | } |
| | | }, |
| | | "node_modules/chalk": { |
| | | "version": "4.1.2", |
| | | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", |
| | | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "ansi-styles": "^4.1.0", |
| | | "supports-color": "^7.1.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/chalk/chalk?sponsor=1" |
| | | } |
| | | }, |
| | | "node_modules/chalk/node_modules/has-flag": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", |
| | | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=8" |
| | | } |
| | | }, |
| | | "node_modules/chalk/node_modules/supports-color": { |
| | | "version": "7.2.0", |
| | | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", |
| | | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "has-flag": "^4.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=8" |
| | | } |
| | | }, |
| | | "node_modules/check-error": { |
| | | "version": "2.1.1", |
| | | "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", |
| | | "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">= 16" |
| | | } |
| | | }, |
| | | "node_modules/chokidar": { |
| | | "version": "3.6.0", |
| | |
| | | "node": ">=0.10.0" |
| | | } |
| | | }, |
| | | "node_modules/deep-eql": { |
| | | "version": "5.0.2", |
| | | "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", |
| | | "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=6" |
| | | } |
| | | }, |
| | | "node_modules/default-browser": { |
| | | "version": "5.2.1", |
| | | "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", |
| | |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=6" |
| | | } |
| | | }, |
| | | "node_modules/diff": { |
| | | "version": "7.0.0", |
| | | "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", |
| | | "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", |
| | | "license": "BSD-3-Clause", |
| | | "engines": { |
| | | "node": ">=0.3.1" |
| | | } |
| | | }, |
| | | "node_modules/dotenv": { |
| | |
| | | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", |
| | | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/escape-string-regexp": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", |
| | | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/estree-walker": { |
| | | "version": "2.0.2", |
| | |
| | | "node": ">=8" |
| | | } |
| | | }, |
| | | "node_modules/flat": { |
| | | "version": "5.0.2", |
| | | "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", |
| | | "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", |
| | | "license": "BSD-3-Clause", |
| | | "bin": { |
| | | "flat": "cli.js" |
| | | } |
| | | }, |
| | | "node_modules/flexsearch": { |
| | | "version": "0.8.205", |
| | | "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.8.205.tgz", |
| | |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=4" |
| | | } |
| | | }, |
| | | "node_modules/he": { |
| | | "version": "1.2.0", |
| | | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", |
| | | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", |
| | | "license": "MIT", |
| | | "bin": { |
| | | "he": "bin/he" |
| | | } |
| | | }, |
| | | "node_modules/hookable": { |
| | |
| | | "dev": true, |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/js-yaml": { |
| | | "version": "4.1.0", |
| | | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", |
| | | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "argparse": "^2.0.1" |
| | | }, |
| | | "bin": { |
| | | "js-yaml": "bin/js-yaml.js" |
| | | } |
| | | }, |
| | | "node_modules/jsesc": { |
| | | "version": "3.1.0", |
| | | "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", |
| | |
| | | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/log-symbols": { |
| | | "version": "4.1.0", |
| | | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", |
| | | "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "chalk": "^4.1.0", |
| | | "is-unicode-supported": "^0.1.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/log-symbols/node_modules/is-unicode-supported": { |
| | | "version": "0.1.0", |
| | | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", |
| | | "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/long": { |
| | | "version": "5.3.2", |
| | | "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", |
| | | "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", |
| | | "license": "Apache-2.0" |
| | | }, |
| | | "node_modules/loupe": { |
| | | "version": "3.1.3", |
| | | "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", |
| | | "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/lru-cache": { |
| | | "version": "7.18.3", |
| | |
| | | "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", |
| | | "dev": true, |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/mocha": { |
| | | "version": "11.6.0", |
| | | "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.6.0.tgz", |
| | | "integrity": "sha512-i0JVb+OUBqw63X/1pC3jCyJsqYisgxySBbsQa8TKvefpA1oEnw7JXxXnftfMHRsw7bEEVGRtVlHcDYXBa7FzVw==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "browser-stdout": "^1.3.1", |
| | | "chokidar": "^4.0.1", |
| | | "debug": "^4.3.5", |
| | | "diff": "^7.0.0", |
| | | "escape-string-regexp": "^4.0.0", |
| | | "find-up": "^5.0.0", |
| | | "glob": "^10.4.5", |
| | | "he": "^1.2.0", |
| | | "js-yaml": "^4.1.0", |
| | | "log-symbols": "^4.1.0", |
| | | "minimatch": "^9.0.5", |
| | | "ms": "^2.1.3", |
| | | "picocolors": "^1.1.1", |
| | | "serialize-javascript": "^6.0.2", |
| | | "strip-json-comments": "^3.1.1", |
| | | "supports-color": "^8.1.1", |
| | | "workerpool": "^9.2.0", |
| | | "yargs": "^17.7.2", |
| | | "yargs-parser": "^21.1.1", |
| | | "yargs-unparser": "^2.0.0" |
| | | }, |
| | | "bin": { |
| | | "_mocha": "bin/_mocha", |
| | | "mocha": "bin/mocha.js" |
| | | }, |
| | | "engines": { |
| | | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/brace-expansion": { |
| | | "version": "2.0.2", |
| | | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", |
| | | "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "balanced-match": "^1.0.0" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/chokidar": { |
| | | "version": "4.0.3", |
| | | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", |
| | | "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "readdirp": "^4.0.1" |
| | | }, |
| | | "engines": { |
| | | "node": ">= 14.16.0" |
| | | }, |
| | | "funding": { |
| | | "url": "https://paulmillr.com/funding/" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/cliui": { |
| | | "version": "8.0.1", |
| | | "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", |
| | | "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", |
| | | "license": "ISC", |
| | | "dependencies": { |
| | | "string-width": "^4.2.0", |
| | | "strip-ansi": "^6.0.1", |
| | | "wrap-ansi": "^7.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=12" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/find-up": { |
| | | "version": "5.0.0", |
| | | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", |
| | | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "locate-path": "^6.0.0", |
| | | "path-exists": "^4.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/glob": { |
| | | "version": "10.4.5", |
| | | "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", |
| | | "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", |
| | | "license": "ISC", |
| | | "dependencies": { |
| | | "foreground-child": "^3.1.0", |
| | | "jackspeak": "^3.1.2", |
| | | "minimatch": "^9.0.4", |
| | | "minipass": "^7.1.2", |
| | | "package-json-from-dist": "^1.0.0", |
| | | "path-scurry": "^1.11.1" |
| | | }, |
| | | "bin": { |
| | | "glob": "dist/esm/bin.mjs" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/isaacs" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/has-flag": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", |
| | | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=8" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/jackspeak": { |
| | | "version": "3.4.3", |
| | | "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", |
| | | "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", |
| | | "license": "BlueOak-1.0.0", |
| | | "dependencies": { |
| | | "@isaacs/cliui": "^8.0.2" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/isaacs" |
| | | }, |
| | | "optionalDependencies": { |
| | | "@pkgjs/parseargs": "^0.11.0" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/locate-path": { |
| | | "version": "6.0.0", |
| | | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", |
| | | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "p-locate": "^5.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/lru-cache": { |
| | | "version": "10.4.3", |
| | | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", |
| | | "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", |
| | | "license": "ISC" |
| | | }, |
| | | "node_modules/mocha/node_modules/minimatch": { |
| | | "version": "9.0.5", |
| | | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", |
| | | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", |
| | | "license": "ISC", |
| | | "dependencies": { |
| | | "brace-expansion": "^2.0.1" |
| | | }, |
| | | "engines": { |
| | | "node": ">=16 || 14 >=14.17" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/isaacs" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/p-limit": { |
| | | "version": "3.1.0", |
| | | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", |
| | | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "yocto-queue": "^0.1.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/p-locate": { |
| | | "version": "5.0.0", |
| | | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", |
| | | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "p-limit": "^3.0.2" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/path-scurry": { |
| | | "version": "1.11.1", |
| | | "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", |
| | | "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", |
| | | "license": "BlueOak-1.0.0", |
| | | "dependencies": { |
| | | "lru-cache": "^10.2.0", |
| | | "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=16 || 14 >=14.18" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/isaacs" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/readdirp": { |
| | | "version": "4.1.2", |
| | | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", |
| | | "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">= 14.18.0" |
| | | }, |
| | | "funding": { |
| | | "type": "individual", |
| | | "url": "https://paulmillr.com/funding/" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/supports-color": { |
| | | "version": "8.1.1", |
| | | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", |
| | | "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "has-flag": "^4.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/chalk/supports-color?sponsor=1" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/wrap-ansi": { |
| | | "version": "7.0.0", |
| | | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", |
| | | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "ansi-styles": "^4.0.0", |
| | | "string-width": "^4.1.0", |
| | | "strip-ansi": "^6.0.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/yargs": { |
| | | "version": "17.7.2", |
| | | "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", |
| | | "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "cliui": "^8.0.1", |
| | | "escalade": "^3.1.1", |
| | | "get-caller-file": "^2.0.5", |
| | | "require-directory": "^2.1.1", |
| | | "string-width": "^4.2.3", |
| | | "y18n": "^5.0.5", |
| | | "yargs-parser": "^21.1.1" |
| | | }, |
| | | "engines": { |
| | | "node": ">=12" |
| | | } |
| | | }, |
| | | "node_modules/mocha/node_modules/yargs-parser": { |
| | | "version": "21.1.1", |
| | | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", |
| | | "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", |
| | | "license": "ISC", |
| | | "engines": { |
| | | "node": ">=12" |
| | | } |
| | | }, |
| | | "node_modules/mrmime": { |
| | | "version": "2.0.1", |
| | |
| | | "dev": true, |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/pathval": { |
| | | "version": "2.0.0", |
| | | "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", |
| | | "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">= 14.16" |
| | | } |
| | | }, |
| | | "node_modules/peek-stream": { |
| | | "version": "1.1.3", |
| | | "resolved": "https://registry.npmjs.org/peek-stream/-/peek-stream-1.1.3.tgz", |
| | |
| | | "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", |
| | | "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/randombytes": { |
| | | "version": "2.1.0", |
| | | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", |
| | | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "safe-buffer": "^5.1.0" |
| | | } |
| | | }, |
| | | "node_modules/readable-stream": { |
| | | "version": "4.7.0", |
| | |
| | | "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", |
| | | "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" |
| | | }, |
| | | "node_modules/serialize-javascript": { |
| | | "version": "6.0.2", |
| | | "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", |
| | | "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", |
| | | "license": "BSD-3-Clause", |
| | | "dependencies": { |
| | | "randombytes": "^2.1.0" |
| | | } |
| | | }, |
| | | "node_modules/set-blocking": { |
| | | "version": "2.0.0", |
| | | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", |
| | |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=18" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/strip-json-comments": { |
| | | "version": "3.1.1", |
| | | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", |
| | | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=8" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | |
| | | "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", |
| | | "license": "ISC" |
| | | }, |
| | | "node_modules/workerpool": { |
| | | "version": "9.3.2", |
| | | "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.2.tgz", |
| | | "integrity": "sha512-Xz4Nm9c+LiBHhDR5bDLnNzmj6+5F+cyEAWPMkbs2awq/dYazR/efelZzUAjB/y3kNHL+uzkHvxVVpaOfGCPV7A==", |
| | | "license": "Apache-2.0" |
| | | }, |
| | | "node_modules/wrap-ansi": { |
| | | "version": "6.2.0", |
| | | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", |
| | |
| | | "node": ">=6" |
| | | } |
| | | }, |
| | | "node_modules/yargs-unparser": { |
| | | "version": "2.0.0", |
| | | "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", |
| | | "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", |
| | | "license": "MIT", |
| | | "dependencies": { |
| | | "camelcase": "^6.0.0", |
| | | "decamelize": "^4.0.0", |
| | | "flat": "^5.0.2", |
| | | "is-plain-obj": "^2.1.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=10" |
| | | } |
| | | }, |
| | | "node_modules/yargs-unparser/node_modules/camelcase": { |
| | | "version": "6.3.0", |
| | | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", |
| | | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/yargs-unparser/node_modules/decamelize": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", |
| | | "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/yargs-unparser/node_modules/is-plain-obj": { |
| | | "version": "2.1.0", |
| | | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", |
| | | "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=8" |
| | | } |
| | | }, |
| | | "node_modules/yargs/node_modules/y18n": { |
| | | "version": "4.0.3", |
| | | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", |
| | | "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", |
| | | "license": "ISC" |
| | | }, |
| | | "node_modules/yocto-queue": { |
| | | "version": "0.1.0", |
| | | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", |
| | | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", |
| | | "license": "MIT", |
| | | "engines": { |
| | | "node": ">=10" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/yoctocolors": { |
| | | "version": "2.1.1", |
| | | "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", |
| | |
| | | "@fastify/static": "^8.2.0", |
| | | "@vueuse/core": "^13.3.0", |
| | | "@vueuse/router": "^13.3.0", |
| | | "chai": "^5.2.0", |
| | | "dayjs": "^1.11.13", |
| | | "dotenv": "^16.5.0", |
| | | "fastify": "^5.3.3", |
| | | "flexsearch": "^0.8.205", |
| | | "lodash": "^4.17.21", |
| | | "mocha": "^11.6.0", |
| | | "mysql2": "^3.14.1", |
| | | "nconf": "^0.13.0", |
| | | "nodemon": "^3.1.10", |
| | |
| | | <?php |
| | | declare(strict_types=1); |
| | | |
| | | # Testdatei für globus-ilias-rest |
| | | |
| | | try { |
| | | |
| | | # Init ILIAS |
| | | require_once("Services/Init/classes/class.ilInitialisation.php"); |
| | | ilInitialisation::initILIAS(); |
| | | |
| | | $usr = ilObjectFactory::getInstanceByObjId(316); |
| | | //echo $usr; aa |
| | | echo json_encode($usr); |
| | | include_once 'Services/Context/classes/class.ilContext.php'; |
| | | ilContext::init(ilContext::CONTEXT_REST); |
| | | |
| | | echo "jojojo"; |
| | | header("Content-Type: application/json; charset=UTF-8"); |
| | | |
| | | $method = $_SERVER['REQUEST_METHOD']; |
| | | $command = $_GET["command"]; |
| | | $obj_id = (int) $_GET["obj_id"]; |
| | | $dry = $_GET["dry"]; |
| | | |
| | | $res = array( |
| | | "method" => $method, |
| | | "command" => $command, |
| | | "obj_id" => $obj_id, |
| | | "status" => null, |
| | | "msg" => null |
| | | ); |
| | | |
| | | try { |
| | | switch ($command) { |
| | | case "deleteUser": |
| | | if ($method == "DELETE") { |
| | | $res["msg"] = deleteUser($obj_id, $dry); |
| | | $res["status"] = "ok"; |
| | | break; |
| | | } |
| | | catch(Exception $ex) { |
| | | default: |
| | | http_response_code(500); |
| | | $res = array("status" => "error", "msg" => "unknown command or method"); |
| | | } |
| | | } catch (Exception $err) { |
| | | http_response_code(500); |
| | | $res["status"] = "error"; |
| | | $res["msg"] = $err->__tostring(); |
| | | } |
| | | |
| | | $json = json_encode($res, JSON_PRETTY_PRINT); |
| | | echo $json; |
| | | } catch (Exception $ex) { |
| | | echo $ex; |
| | | } |
| | | |
| | | |
| | | ############################### |
| | | |
| | | function deleteUser($obj_id, $dry = 0) |
| | | { |
| | | $usr = ilObjectFactory::getInstanceByObjId($obj_id); |
| | | $msg = "deleted user {$usr->firstname} {$usr->lastname} ({$obj_id}) '{$dry}'"; |
| | | if ($dry == "1") { |
| | | $usr->delete(); |
| | | return $msg; |
| | | } else { |
| | | $msg = $msg . " DRY"; |
| | | return $msg; |
| | | } |
| | | } |
| | | |
| | | ?> |
| | |
| | | "search": { |
| | | "readFromFile": false, |
| | | "file": "users-local.json" |
| | | }, |
| | | "ilias": { |
| | | "urlDoc": "Url of custom ILIAS PHP file", |
| | | "url": "http://192.168.178.84:8060/alex.php" |
| | | } |
| | | } |
| New file |
| | |
| | | const settings = require("../settings") |
| | | const libIlias = require("../lib/libIlias") |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | describe("the function deleteUser", function () { |
| | | |
| | | it("should delete a user", async function () { |
| | | const obj_id = 317 |
| | | const res = await libIlias.deleteUser(obj_id, false) |
| | | console.log(res) |
| | | }) |
| | | |
| | | }) |