diff --git a/docs/simplesamlphp-authsource.md b/docs/simplesamlphp-authsource.md index 09a8bb03384aa2b694e96a41f6a0ef62bc939f18..b39d56c42dccb6a245b2f473698ef4a1684db9a4 100644 --- a/docs/simplesamlphp-authsource.md +++ b/docs/simplesamlphp-authsource.md @@ -42,7 +42,7 @@ The only function you need to implement is the `login($username, $password)`-fun This function receives the username and password the user entered, and is expected to return the attributes of that user. If the username or password is incorrect, it should throw an error saying so: - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \impleSAML\Error\Error('WRONGUSERPASS'); "[Implementing custom username/password authentication](./simplesamlphp-customauth)" describes how to implement username/password authentication using that base class. diff --git a/docs/simplesamlphp-customauth.md b/docs/simplesamlphp-customauth.md index 8238ba695b3dfbfafd23a356e6420ed3084cd43a..c9bc273a55f41e7033d992a7b276f7ebf822d21a 100644 --- a/docs/simplesamlphp-customauth.md +++ b/docs/simplesamlphp-customauth.md @@ -43,7 +43,7 @@ Create the file `modules/mymodule/lib/Auth/Source/MyAuth.php` with the following class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase { protected function login($username, $password) { if ($username !== 'theusername' || $password !== 'thepassword') { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } return array( 'uid' => array('theusername'), @@ -64,7 +64,7 @@ Some things to note: - The `login` function receives the username and password the user enters. It is expected to authenticate the user. If the username or password is correct, it must return a set of attributes for the user. - Otherwise, it must throw the `SimpleSAML_Error_Error('WRONGUSERPASS');` exception. + Otherwise, it must throw the `\SimpleSAML\Error\Error('WRONGUSERPASS');` exception. - Attributes are returned as an associative array of `name => values` pairs. All attributes can have multiple values, so the values are always stored in an array. @@ -187,7 +187,7 @@ The complete class file should look like this: protected function login($username, $password) { if ($username !== $this->username || $password !== $this->password) { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } return array( 'uid' => array($this->username), @@ -323,14 +323,14 @@ The class follows: if (!$row) { /* User not found. */ SimpleSAML\Logger::warning('MyAuth: Could not find user ' . var_export($username, TRUE) . '.'); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } /* Check the password. */ if (!$this->checkPassword($row['password_hash'], $password)) { /* Invalid password. */ SimpleSAML\Logger::warning('MyAuth: Wrong password for user ' . var_export($username, TRUE) . '.'); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } /* Create the attribute array of the user. */ diff --git a/docs/simplesamlphp-errorhandling.md b/docs/simplesamlphp-errorhandling.md index 2a5c08a0d962875eb7bf4652cc7a8a3c493c4c88..3482dddcf1bd21a4902a8bace00b8653172b8692 100644 --- a/docs/simplesamlphp-errorhandling.md +++ b/docs/simplesamlphp-errorhandling.md @@ -78,7 +78,7 @@ If it is unable to convert the exception, it will return a generic SAML 2 error To return a specific SAML 2 error, you should: -* Create a new exception class for your error. This exception class must subclass `SimpleSAML_Error_Exception`. +* Create a new exception class for your error. This exception class must subclass `\SimpleSAML\Error\Exception`. * Add that exception to the list in `fromException()`. * Consider adding the exception to `toException()` in the same file. (See the next section.) diff --git a/docs/simplesamlphp-maintenance.md b/docs/simplesamlphp-maintenance.md index 02e43b4f6e4aecaeb4c8c657262e7f6bcf0f6b52..cfd2d7e3766a20921ea6e9b0b1fc89e0c106d534 100644 --- a/docs/simplesamlphp-maintenance.md +++ b/docs/simplesamlphp-maintenance.md @@ -178,7 +178,7 @@ example configuration of different metadata sources in use at the same time: ``` You may also implement your own metadata storage handler, in a very similar way to how you would implement -your own session handler. Your class **must** extend the `SimpleSAML_Metadata_MetaDataStorageSource` class +your own session handler. Your class **must** extend the `\SimpleSAML\Metadata\MetaDataStorageSource` class and override the methods needed to change the backend used. This class **must** also be located in the `lib/MetadataStore/` directory of your custom module. @@ -190,7 +190,7 @@ module is named _mymodule_ and your class is named _MyMetadataHandler_, you shou <?php namespace SimpleSAML\Module\mymodule\MetadataStore; -class MyMetadataHandler extends SimpleSAML_Metadata_MetaDataStorageSource +class MyMetadataHandler extends \SimpleSAML\Metadata\MetaDataStorageSource { ... ``` diff --git a/docs/simplesamlphp-nostate.md b/docs/simplesamlphp-nostate.md index 6d0535fb18eb8b6489cb8d7248b73ce62084b46e..208d9d5773c9ee89449585758d8c6370087fedf3 100644 --- a/docs/simplesamlphp-nostate.md +++ b/docs/simplesamlphp-nostate.md @@ -1,7 +1,7 @@ Debugging "State Information Lost" errors ========================================= -**"State Information Lost"** (`SimpleSAML_Error_NoState: NOSTATE`) +**"State Information Lost"** (`\SimpleSAML\Error\NoState: NOSTATE`) This is one of the most common errors that you can encounter when configuring SimpleSAMLphp. Unfortunately, it is also a generic error that can have many diff --git a/docs/simplesamlphp-sp-migration.md b/docs/simplesamlphp-sp-migration.md index f3251610eb343ef6ca23efeac97e9c547778031d..92187b802ebccd51be22412e4aa67db448953618 100644 --- a/docs/simplesamlphp-sp-migration.md +++ b/docs/simplesamlphp-sp-migration.md @@ -155,7 +155,7 @@ This is a quick overview of the API: Generally, if you have: $config = \SimpleSAML\Configuration::getInstance(); - $session = \SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); you should replace it with this single line: diff --git a/docs/simplesamlphp-theming.md b/docs/simplesamlphp-theming.md index 7d0ea7310c5f47e2c31f9009dfa96a15c79f9b89..51cbe65b5bdfd7d3bdea78d37b78c888e3c7fdc0 100644 --- a/docs/simplesamlphp-theming.md +++ b/docs/simplesamlphp-theming.md @@ -128,7 +128,7 @@ If you need to make more extensive customizations to the base template, you shou cp templates/base.twig modules/mymodule/themes/fancytheme/default/ -Any references to `$this->data['baseurlpath']` in old-style templates can be replaced with `{{baseurlpath}}` in Twig templates. Likewise, references to `SimpleSAML_Module::getModuleURL()` can be replaced with `{{baseurlpath}}module.php/mymodule/...` +Any references to `$this->data['baseurlpath']` in old-style templates can be replaced with `{{baseurlpath}}` in Twig templates. Likewise, references to `\SimpleSAML\Module::getModuleURL()` can be replaced with `{{baseurlpath}}module.php/mymodule/...` See the [Twig documentation](https://twig.symfony.com/doc/1.x/templates.html) for more information on using variables and expressions in Twig templates, and the SimpleSAMLphp wiki for [our conventions](https://github.com/simplesamlphp/simplesamlphp/wiki/Twig-conventions). diff --git a/lib/SimpleSAML/Auth/ProcessingChain.php b/lib/SimpleSAML/Auth/ProcessingChain.php index 08ffb0ce9e5520ee96f1781a719f7aeede0b83c3..620c5c5ce46a53fa00f966f601c3059b2f73a213 100644 --- a/lib/SimpleSAML/Auth/ProcessingChain.php +++ b/lib/SimpleSAML/Auth/ProcessingChain.php @@ -151,7 +151,7 @@ class ProcessingChain throw new \Exception('Authentication processing filter without name given.'); } - $className = \SimpleSAML\Module::resolveClass($config['class'], 'Auth\Process', '\SimpleSAML\Auth\ProcessingFilter'); + $className = \SimpleSAML\Module::resolveClass($config['class'], 'Auth_Process', '\SimpleSAML\Auth\ProcessingFilter'); $config['%priority'] = $priority; unset($config['class']); return new $className($config, null); diff --git a/lib/SimpleSAML/Auth/Source.php b/lib/SimpleSAML/Auth/Source.php index eacec3ead2392fe8a5f1bea3336dad1c81fdb920..9f18a0af3124a137d56f703f2ed5753afbae8769 100644 --- a/lib/SimpleSAML/Auth/Source.php +++ b/lib/SimpleSAML/Auth/Source.php @@ -303,14 +303,14 @@ abstract class Source try { // Check whether or not there's a factory responsible for instantiating our Auth Source instance - $factoryClass = \SimpleSAML\Module::resolveClass($id, 'Auth\Source\Factory', '\SimpleSAML\Auth\SourceFactory'); + $factoryClass = \SimpleSAML\Module::resolveClass($id, 'Auth_Source_Factory', '\SimpleSAML\Auth\SourceFactory'); /** @var SourceFactory $factory */ $factory = new $factoryClass; $authSource = $factory->create($info, $config); } catch (\Exception $e) { // If not, instantiate the Auth Source here - $className = \SimpleSAML\Module::resolveClass($id, 'Auth\Source', '\SimpleSAML\Auth\Source'); + $className = \SimpleSAML\Module::resolveClass($id, 'Auth_Source', '\SimpleSAML\Auth\Source'); $authSource = new $className($info, $config); } diff --git a/lib/SimpleSAML/Error/Exception.php b/lib/SimpleSAML/Error/Exception.php index cc3c408802ab1320dde4530fd962f40696e3ee13..4131c993d21df8b046ca967c958c8b27d5a7d2b3 100644 --- a/lib/SimpleSAML/Error/Exception.php +++ b/lib/SimpleSAML/Error/Exception.php @@ -40,9 +40,9 @@ class Exception extends \Exception * * @param string $message Exception message * @param int $code Error code - * @param Exception|null $cause The cause of this exception. + * @param \Exception|null $cause The cause of this exception. */ - public function __construct($message, $code = 0, Exception $cause = null) + public function __construct($message, $code = 0, \Exception $cause = null) { assert(is_string($message)); assert(is_int($code)); @@ -60,11 +60,11 @@ class Exception extends \Exception /** * Convert any exception into a \SimpleSAML\Error\Exception. * - * @param Exception $e The exception. + * @param \Exception $e The exception. * * @return Exception The new exception. */ - public static function fromException(Exception $e) + public static function fromException(\Exception $e) { if ($e instanceof Exception) { return $e; @@ -76,9 +76,9 @@ class Exception extends \Exception /** * Load the backtrace from the given exception. * - * @param Exception $exception The exception we should fetch the backtrace from. + * @param \Exception $exception The exception we should fetch the backtrace from. */ - protected function initBacktrace(Exception $exception) + protected function initBacktrace(\Exception $exception) { $this->backtrace = array(); diff --git a/lib/SimpleSAML/Error/UnserializableException.php b/lib/SimpleSAML/Error/UnserializableException.php index 515b46091f87cd151085b6ce2a8e60882cf92f2d..54f4eb34feb9a98d40aabc48e985e7687be37b94 100644 --- a/lib/SimpleSAML/Error/UnserializableException.php +++ b/lib/SimpleSAML/Error/UnserializableException.php @@ -28,9 +28,9 @@ class UnserializableException extends Exception /** * Create a serializable exception representing an unserializable exception. * - * @param Exception $original The original exception. + * @param \Exception $original The original exception. */ - public function __construct(Exception $original) + public function __construct(\Exception $original) { $this->class = get_class($original); diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php index 865610dd92964462381c5411f73d2f61b3a2c049..ab53ad46cd6c7fe594d84b9c04d0cec6b52091d9 100644 --- a/lib/SimpleSAML/Memcache.php +++ b/lib/SimpleSAML/Memcache.php @@ -207,7 +207,7 @@ class Memcache * The timeout for contacting this server, in seconds. * The default value is 3 seconds. * - * @param Memcache $memcache The Memcache object we should add this server to. + * @param \Memcache $memcache The Memcache object we should add this server to. * @param array $server An associative array with the configuration options for the server to add. * * @throws \Exception If any configuration option for the server is invalid. @@ -304,19 +304,19 @@ class Memcache * * @param array $group Array of servers which should be created as a group. * - * @return Memcache A Memcache object of the servers in the group + * @return \Memcache A Memcache object of the servers in the group * * @throws \Exception If the servers configuration is invalid. */ private static function loadMemcacheServerGroup(array $group) { - $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : false); + $class = class_exists('\Memcache') ? '\Memcache' : (class_exists('\Memcached') ? '\Memcached' : false); if (!$class) { throw new \Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.'); } self::$extension = strtolower($class); - // create the Memcache object + // create the \Memcache object $memcache = new $class(); // iterate over all the servers in the group and add them to the Memcache object @@ -350,7 +350,7 @@ class Memcache * This function gets a list of all configured memcache servers. This list is initialized based * on the content of 'memcache_store.servers' in the configuration. * - * @return Memcache[] Array with Memcache objects. + * @return \Memcache[] Array with Memcache objects. * * @throws \Exception If the servers configuration is invalid. */ diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php index ed575c555073397f1c3e8230d7a54c215e0ab040..47eec7be89eea4c67b371ecf3cb45bd5af74aeff 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php @@ -169,12 +169,12 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource while ($d = $stmt->fetch()) { if (++$rowCount > 1) { - SimpleSAML\Logger::warning("Duplicate match for $entityId in set $set"); + \SimpleSAML\Logger::warning("Duplicate match for $entityId in set $set"); break; } $data = json_decode($d['entity_data'], true); if ($data === null) { - throw new SimpleSAML_Error_Exception("Cannot decode metadata for entity '${d['entity_id']}'"); + throw new \SimpleSAML\Error\Exception("Cannot decode metadata for entity '${d['entity_id']}'"); } if (!array_key_exists('entityid', $data)) { $data['entityid'] = $d['entity_id']; @@ -182,7 +182,7 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource } return $data; } else { - throw new Exception('PDO metadata handler: Database error: '.var_export($this->db->getLastError(), true)); + throw new \Exception('PDO metadata handler: Database error: '.var_export($this->db->getLastError(), true)); } } diff --git a/lib/SimpleSAML/Stats.php b/lib/SimpleSAML/Stats.php index 9329310b8f1f58c9e1430773712e5a8087e9b719..5a1dbf47fea703bbf92b4481365595fac05b595b 100644 --- a/lib/SimpleSAML/Stats.php +++ b/lib/SimpleSAML/Stats.php @@ -38,7 +38,7 @@ class Stats private static function createOutput(\SimpleSAML\Configuration $config) { $cls = $config->getString('class'); - $cls = SimpleSAML\Module::resolveClass($cls, 'Stats\Output', '\SimpleSAML\Stats\Output'); + $cls = \SimpleSAML\Module::resolveClass($cls, 'Stats_Output', '\SimpleSAML\Stats\Output'); $output = new $cls($config); return $output; diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index 15739a034ca4e330b57fb07e019114ba6bf94857..e3ed6dedbcc4908d8707dfd6d81dfa490fa7e4cb 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -176,7 +176,7 @@ class Utilities /** * @deprecated This method will be removed in SSP 2.0. Please raise a SimpleSAML\Error\Error exception instead. */ - public static function fatalError($trackId = 'na', $errorCode = null, Exception $e = null) + public static function fatalError($trackId = 'na', $errorCode = null, \Exception $e = null) { throw new \SimpleSAML\Error\Error($errorCode, $e); } @@ -301,7 +301,7 @@ class Utilities * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::isDOMNodeOfType() * instead. */ - public static function isDOMElementOfType(DOMNode $element, $name, $nsURI) + public static function isDOMElementOfType(\DOMNode $element, $name, $nsURI) { return \SimpleSAML\Utils\XML::isDOMNodeOfType($element, $name, $nsURI); } @@ -310,7 +310,7 @@ class Utilities /** * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::getDOMChildren() instead. */ - public static function getDOMChildren(DOMElement $element, $localName, $namespaceURI) + public static function getDOMChildren(\DOMElement $element, $localName, $namespaceURI) { return \SimpleSAML\Utils\XML::getDOMChildren($element, $localName, $namespaceURI); } @@ -570,7 +570,7 @@ class Utilities $session = \SimpleSAML\Session::getSessionFromRequest(); $session->setData('core_postdatalink', $postId, $postData); - $redirInfo = base64_encode(SimpleSAML\Utils\Crypto::aesEncrypt($session->getSessionId().':'.$postId)); + $redirInfo = base64_encode(\SimpleSAML\Utils\Crypto::aesEncrypt($session->getSessionId().':'.$postId)); $url = \SimpleSAML\Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $redirInfo)); $url = preg_replace("#^https:#", "http:", $url); @@ -694,7 +694,7 @@ class Utilities */ public static function isWindowsOS() { - return \SimpleSAML\Utils\System::getOS() === SimpleSAML\Utils\System::WINDOWS; + return \SimpleSAML\Utils\System::getOS() === \SimpleSAML\Utils\System::WINDOWS; } diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php index 22d815be6db975f911f1588a844d51d894a4bda7..34b70132d39831aaaa59d39037460cec396e4a52 100644 --- a/lib/SimpleSAML/XHTML/IdPDisco.php +++ b/lib/SimpleSAML/XHTML/IdPDisco.php @@ -129,7 +129,7 @@ class IdPDisco // standard discovery service parameters if (!array_key_exists('entityID', $_GET)) { - throw new Exception('Missing parameter: entityID'); + throw new \Exception('Missing parameter: entityID'); } else { $this->spEntityId = $_GET['entityID']; } @@ -176,7 +176,7 @@ class IdPDisco */ protected function log($message) { - SimpleSAML\Logger::info('idpDisco.'.$this->instance.': '.$message); + \SimpleSAML\Logger::info('idpDisco.'.$this->instance.': '.$message); } diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php index 342e110f264ad38eef282bc04f46dc5a57de1b56..6398845700cf6bbf800aed1037deccc6c8799235 100644 --- a/modules/consent/lib/Auth/Process/Consent.php +++ b/modules/consent/lib/Auth/Process/Consent.php @@ -10,8 +10,9 @@ */ use SimpleSAML\Logger; +use SimpleSAML\Module; use SimpleSAML\Stats; -use SimpleSAML\Error; +use SimpleSAML\Utils; class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFilter { @@ -53,7 +54,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil /** * Attributes which should not require consent * - * @var aray + * @var array */ private $_noconsentattributes = array(); @@ -73,7 +74,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil * @param array $config Configuration information. * @param mixed $reserved For future use. * - * @throws Error\Exception if the configuration is not valid. + * @throws \SimpleSAML\Error\Exception if the configuration is not valid. */ public function __construct($config, $reserved) { @@ -82,7 +83,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil if (array_key_exists('includeValues', $config)) { if (!is_bool($config['includeValues'])) { - throw new Error\Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: includeValues must be boolean. '. var_export($config['includeValues'], true).' given.' ); @@ -92,7 +93,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil if (array_key_exists('checked', $config)) { if (!is_bool($config['checked'])) { - throw new Error\Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: checked must be boolean. '. var_export($config['checked'], true).' given.' ); @@ -102,7 +103,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil if (array_key_exists('focus', $config)) { if (!in_array($config['focus'], array('yes', 'no'), true)) { - throw new Error\Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: focus must be a string with values `yes` or `no`. '. var_export($config['focus'], true).' given.' ); @@ -112,7 +113,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil if (array_key_exists('hiddenAttributes', $config)) { if (!is_array($config['hiddenAttributes'])) { - throw new Error\Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: hiddenAttributes must be an array. '. var_export($config['hiddenAttributes'], true).' given.' ); @@ -122,7 +123,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil if (array_key_exists('attributes.exclude', $config)) { if (!is_array($config['attributes.exclude'])) { - throw new Error\Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: attributes.exclude must be an array. '. var_export($config['attributes.exclude'], true).' given.' ); @@ -131,7 +132,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil } elseif (array_key_exists('noconsentattributes', $config)) { Logger::warning("The 'noconsentattributes' option has been deprecated in favour of 'attributes.exclude'."); if (!is_array($config['noconsentattributes'])) { - throw new Error\Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: noconsentattributes must be an array. '. var_export($config['noconsentattributes'], true).' given.' ); @@ -152,7 +153,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil if (array_key_exists('showNoConsentAboutService', $config)) { if (!is_bool($config['showNoConsentAboutService'])) { - throw new Error\Exception('Consent: showNoConsentAboutService must be a boolean.'); + throw new \SimpleSAML\Error\Exception('Consent: showNoConsentAboutService must be a boolean.'); } $this->_showNoConsentAboutService = $config['showNoConsentAboutService']; } @@ -226,7 +227,7 @@ class sspmod_consent_Auth_Process_Consent extends \SimpleSAML\Auth\ProcessingFil * * @return void * - * @throws Error\NoPassive if the request was passive and consent is needed. + * @throws \SimpleSAML\Error\NoPassive if the request was passive and consent is needed. */ public function process(&$state) { diff --git a/modules/ldap/lib/ConfigHelper.php b/modules/ldap/lib/ConfigHelper.php index e1f0fb64bc6adac38b4016821d79d6c493285820..cc5e1e8763a51f15b198726b7b81d82cf141fc0a 100644 --- a/modules/ldap/lib/ConfigHelper.php +++ b/modules/ldap/lib/ConfigHelper.php @@ -176,7 +176,7 @@ class sspmod_ldap_ConfigHelper * * @param string $username The username the user wrote. * @param string $password The password the user wrote. - * @param arrray $sasl_args Array of SASL options for LDAP bind. + * @param array $sasl_args Array of SASL options for LDAP bind. * @return array Associative array with the users attributes. */ public function login($username, $password, array $sasl_args = null) diff --git a/modules/saml/www/disco.php b/modules/saml/www/disco.php index 8a229f9f37ca0a7b6b69316922ca68f272938fad..147338f0d6d3ea980bcbcd8eea4afe2fa514a747 100644 --- a/modules/saml/www/disco.php +++ b/modules/saml/www/disco.php @@ -4,5 +4,5 @@ * Built-in IdP discovery service. */ -$discoHandler = new \impleSAML\XHTML\IdPDisco(array('saml20-idp-remote', 'shib13-idp-remote'), 'saml'); +$discoHandler = new \SimpleSAML\XHTML\IdPDisco(array('saml20-idp-remote', 'shib13-idp-remote'), 'saml'); $discoHandler->handleRequest(); diff --git a/www/_include.php b/www/_include.php index 092e5008913691fab7c8346ed993ba5d048284f2..a1bbe0e98d1d285394058fb8edea032acfdd021b 100644 --- a/www/_include.php +++ b/www/_include.php @@ -9,22 +9,20 @@ require_once(dirname(dirname(__FILE__)).'/lib/_autoload.php'); // show error page on unhandled exceptions function SimpleSAML_exception_handler($exception) { - SimpleSAML\Module::callHooks('exception_handler', $exception); + \SimpleSAML\Module::callHooks('exception_handler', $exception); if ($exception instanceof \SimpleSAML\Error\Error) { $exception->show(); - } elseif ($exception instanceof Exception) { + } elseif ($exception instanceof \Exception) { $e = new \SimpleSAML\Error\Error('UNHANDLEDEXCEPTION', $exception); $e->show(); - } else { - if (class_exists('Error') && $exception instanceof Error) { - $code = $exception->getCode(); - $errno = ($code > 0) ? $code : E_ERROR; - $errstr = $exception->getMessage(); - $errfile = $exception->getFile(); - $errline = $exception->getLine(); - SimpleSAML_error_handler($errno, $errstr, $errfile, $errline); - } + } else if (class_exists('Error') && $exception instanceof \Error) { + $code = $exception->getCode(); + $errno = ($code > 0) ? $code : E_ERROR; + $errstr = $exception->getMessage(); + $errfile = $exception->getFile(); + $errline = $exception->getLine(); + SimpleSAML_error_handler($errno, $errstr, $errfile, $errline); } } @@ -33,7 +31,7 @@ set_exception_handler('SimpleSAML_exception_handler'); // log full backtrace on errors and warnings function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0, $errcontext = null) { - if (!class_exists('SimpleSAML\Logger')) { + if (!class_exists('\SimpleSAML\Logger')) { /* We are probably logging a deprecation-warning during parsing. Unfortunately, the autoloader is disabled at * this point, so we should stop here. * @@ -42,7 +40,7 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0 return false; } - if (SimpleSAML\Logger::isErrorMasked($errno)) { + if (\SimpleSAML\Logger::isErrorMasked($errno)) { // masked error return false; } @@ -66,11 +64,11 @@ set_error_handler('SimpleSAML_error_handler'); try { \SimpleSAML\Configuration::getInstance(); -} catch (Exception $e) { +} catch (\Exception $e) { throw new \SimpleSAML\Error\CriticalConfigurationError( $e->getMessage() ); } // set the timezone -SimpleSAML\Utils\Time::initTimezone(); +\SimpleSAML\Utils\Time::initTimezone();