From 909606e162f54d2c995f10e5af5220a0e574ec1c Mon Sep 17 00:00:00 2001 From: Thomas Hufschmidt Date: Thu, 10 Nov 2016 10:46:50 +0100 Subject: [PATCH] fixed bugs introducted by refactoring in 1.6.0 --- RESTController/RESTController.php | 5 +++-- RESTController/libs/RESTilias.php | 2 +- sql/dbupdate.php | 18 ++++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/RESTController/RESTController.php b/RESTController/RESTController.php index 23c6d019..2235e286 100644 --- a/RESTController/RESTController.php +++ b/RESTController/RESTController.php @@ -96,7 +96,7 @@ public function __construct($iliasRoot, array $userSettings = array()) { // Fetch environment and remeber base-directory (just in case) $env = $this->environment(); - $env['ilias_root'] = $root; + $env['ilias_root'] = $iliasRoot; $env['ctl_root'] = __DIR__; // Alternatively set as hard-coded path: "$root/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/REST/RESTController" @@ -392,10 +392,11 @@ protected function initResponseFormat() { * by the restplugin.php */ protected function initILIAS() { - // Initialize ILIAS (if not created via restplugin.php) + // Initialize ILIAS (if not created via api.php) if (!defined('CLIENT_ID')) { // Fetch request object $request = $this->request(); + $client = null; // Try to fetch ilias-client from access-token try { diff --git a/RESTController/libs/RESTilias.php b/RESTController/libs/RESTilias.php index 1cc3ae56..05167be1 100644 --- a/RESTController/libs/RESTilias.php +++ b/RESTController/libs/RESTilias.php @@ -103,7 +103,7 @@ protected static function getIniHost() { * It does some extra-work to make sure ILIAS does not get any wrong idea * when having 'unpredicted' values in $_SERVER array. */ - public static function initILIAS($client) { + public static function initILIAS($client = null) { // Apply oAuth2 fix for client_id GET/POST value self::applyOAuth2Fix($client); diff --git a/sql/dbupdate.php b/sql/dbupdate.php index a52c8692..77ffa4c8 100644 --- a/sql/dbupdate.php +++ b/sql/dbupdate.php @@ -158,22 +158,28 @@ function gen_uuid() { 'default' => -1 ), 'grant_client_credentials' => array( - 'type' => 'integer' + 'type' => 'integer', + 'length' => 1 ), 'grant_authorization_code' => array( - 'type' => 'integer' + 'type' => 'integer', + 'length' => 1 ), 'grant_implicit' => array( - 'type' => 'integer' + 'type' => 'integer', + 'length' => 1 ), 'grant_resource_owner' => array( - 'type' => 'integer' + 'type' => 'integer', + 'length' => 1 ), 'refresh_authorization_code' => array( - 'type' => 'integer' + 'type' => 'integer', + 'length' => 1 ), 'refresh_resource_owner' => array( - 'type' => 'integer' + 'type' => 'integer', + 'length' => 1 ), 'grant_bridge' => array( 'type' => 'text',