REST Service for POPCORN - ILIAS
alex
2025-06-18 2d56dc168ebe5cadbbef53b3b8853d87bc2cfbba
GS-2166
1 files added
2 files modified
35 ■■■■■ changed files
README.md 10 ●●●●● patch | view | raw | blame | history
php/globus-ilias-rest/README.md 13 ●●●●● patch | view | raw | blame | history
php/globus-ilias-rest/api.php 12 ●●●●● patch | view | raw | blame | history
README.md
@@ -30,6 +30,16 @@
    pm2 save
### PHP Komponente
globus-ilias-rest benötigt eine PHP Komponente um die ILIAS internen Funktionen nutzen zu können.
Dazu den Ordner "php/globus-ilias-rest" im Projektverzeichnis symlinken in den ILIAS Basisordner (wo sich auch ilias.php befindet).
    cd $ILIASBASEDIR
    ln -s $RESTPROJ/php/globus-ilias-rest globus-ilias-rest
### Apache Config
Apache muss als Proxy für globus-ilias-rest fungieren und Verbindungen an diesen weiterreichen.
php/globus-ilias-rest/README.md
New file
@@ -0,0 +1,13 @@
# Warning
This file should not be called directly. This is for internal use of globus-ilias-rest API.
It is used by the node component (main component) of globus-ilias-rest.
# Install
Copy or symlink this folder into the ILIAS-Base-Folder (where ilias.php is located).
## Auth
All Requests to api.php require a valid token (as defined in the file "token").
php/globus-ilias-rest/api.php
@@ -6,6 +6,7 @@
try {
    # Init ILIAS
    chdir("..");
    require_once("Services/Init/classes/class.ilInitialisation.php");
    ilInitialisation::initILIAS();
@@ -39,8 +40,16 @@
        die(); // this ends here
    }
    try {
        switch ($command) {
            case "ping":
                if($method == "GET") {
                    $res["msg"] = "pong";
                    $res["status"] = "ok";
                    break;
                }
            case "deleteUser":
                if ($method == "DELETE") {
                    $res["msg"] = deleteUser($obj_id, $dry);
@@ -57,7 +66,8 @@
                }
            default:
                http_response_code(500);
                $res = array("status" => "error", "msg" => "unknown command or method");
                $res["status"] = "error";
                $res["msg"] = "unknown command or method";
        }
    } catch (Exception $err) {
        http_response_code(500);