diff --git a/composer.json b/composer.json index f812457..5f65a2f 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ } ], "require": { - "php": "^5.6.0|^7.0|^8.0", - "simplesamlphp/simplesamlphp": "~1.0", + "php": "^5.6.0|^7.0|^8.0|^8.1", + "simplesamlphp/simplesamlphp": "dev-simplesamlphp-2.1", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { @@ -34,7 +34,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.9.x-dev" } } } diff --git a/www/resume.php b/public/resume.php similarity index 100% rename from www/resume.php rename to public/resume.php diff --git a/lib/Auth/Source/External.php b/src/Auth/Source/External.php similarity index 96% rename from lib/Auth/Source/External.php rename to src/Auth/Source/External.php index 6be7226..6900295 100755 --- a/lib/Auth/Source/External.php +++ b/src/Auth/Source/External.php @@ -13,6 +13,8 @@ use SimpleSAML\Module\drupalauth\ConfigHelper; use SimpleSAML\Module\drupalauth\DrupalHelper; use SimpleSAML\Utils\HTTP; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; /** * Drupal authentication source for SimpleSAMLphp using Drupal's login page. @@ -169,7 +171,7 @@ private function getUser() * * @param array &$state Information about the current authentication. */ - public function authenticate(&$state) + public function authenticate(array &$state): void { assert(is_array($state)); @@ -235,14 +237,10 @@ public function authenticate(&$state) * Note the 'ReturnTo' parameter. This must most likely be replaced with * the real name of the parameter for the login page. */ - HTTP::redirectTrustedURL($authPage, [ + $http_utils = new HTTP(); + $http_utils->redirectTrustedURL($authPage, [ 'ReturnTo' => $returnTo, ]); - - /* - * The redirect function never returns, so we never get this far. - */ - assert(false); } /** @@ -327,7 +325,7 @@ public static function resume() * * @param array &$state The logout state array. */ - public function logout(&$state) + public function logout(array &$state): void { assert(is_array($state)); @@ -347,6 +345,7 @@ public function logout(&$state) $parameters['ReturnTo'] = $state['ReturnTo']; } - HTTP::redirectTrustedURL($logout_url, $parameters); + $http_utils = new HTTP(); + $http_utils->redirectTrustedURL($logout_url, $parameters); } } diff --git a/lib/Auth/Source/UserPass.php b/src/Auth/Source/UserPass.php similarity index 100% rename from lib/Auth/Source/UserPass.php rename to src/Auth/Source/UserPass.php diff --git a/lib/ConfigHelper.php b/src/ConfigHelper.php similarity index 97% rename from lib/ConfigHelper.php rename to src/ConfigHelper.php index 0b72c0c..11e0753 100644 --- a/lib/ConfigHelper.php +++ b/src/ConfigHelper.php @@ -93,7 +93,8 @@ public function __construct($config, $location) $this->drupal_login_url = $config->getString('drupal_login_url', null); $this->cookie_path = Configuration::getInstance()->getBasePath(); - $this->cookie_salt = Config::getSecretSalt(); + $config_utils = new Config(); + $this->cookie_salt = $config_utils->getSecretSalt(); } diff --git a/lib/DrupalHelper.php b/src/DrupalHelper.php similarity index 100% rename from lib/DrupalHelper.php rename to src/DrupalHelper.php