diff --git a/libraries/classmap.php b/libraries/classmap.php index faa6a67c50e48..a744ef3e5add4 100644 --- a/libraries/classmap.php +++ b/libraries/classmap.php @@ -148,3 +148,6 @@ JLoader::registerAlias('JVersion', '\\Joomla\\CMS\\Version', '4.0'); +JLoader::registerAlias('JAuthentication', '\\Joomla\\CMS\\Authentication\\Authentication', '4.0'); +JLoader::registerAlias('JAuthenticationResponse', '\\Joomla\\CMS\\Authentication\\AuthenticationResponse', '4.0'); + diff --git a/libraries/joomla/authentication/authentication.php b/libraries/src/Joomla/CMS/Authentication/Authentication.php similarity index 80% rename from libraries/joomla/authentication/authentication.php rename to libraries/src/Joomla/CMS/Authentication/Authentication.php index 062645965237b..3909b3f215770 100644 --- a/libraries/joomla/authentication/authentication.php +++ b/libraries/src/Joomla/CMS/Authentication/Authentication.php @@ -1,12 +1,15 @@ observers[] = $observer; - $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); + $methods = array_diff(get_class_methods($observer), get_class_methods('\\JPlugin')); } $key = key($this->observers); @@ -245,24 +248,24 @@ public function detach($observer) * @param array $credentials Array holding the user credentials. * @param array $options Array holding user options. * - * @return JAuthenticationResponse Response object with status variable filled in for last plugin or first successful plugin. + * @return AuthenticationResponse Response object with status variable filled in for last plugin or first successful plugin. * - * @see JAuthenticationResponse + * @see AuthenticationResponse * @since 11.1 */ public function authenticate($credentials, $options = array()) { // Get plugins - $plugins = JPluginHelper::getPlugin('authentication'); + $plugins = PluginHelper::getPlugin('authentication'); // Create authentication response - $response = new JAuthenticationResponse; + $response = new AuthenticationResponse; /* * Loop through the plugins and check if the credentials can be used to authenticate * the user * - * Any errors raised in the plugin should be returned via the JAuthenticationResponse + * Any errors raised in the plugin should be returned via the AuthenticationResponse * and handled appropriately. */ foreach ($plugins as $plugin) @@ -276,7 +279,7 @@ public function authenticate($credentials, $options = array()) else { // Bail here if the plugin can't be created - JLog::add(JText::sprintf('JLIB_USER_ERROR_AUTHENTICATION_FAILED_LOAD_PLUGIN', $className), JLog::WARNING, 'jerror'); + \JLog::add(\JText::sprintf('JLIB_USER_ERROR_AUTHENTICATION_FAILED_LOAD_PLUGIN', $className), \JLog::WARNING, 'jerror'); continue; } @@ -316,20 +319,20 @@ public function authenticate($credentials, $options = array()) /** * Authorises that a particular user should be able to login * - * @param JAuthenticationResponse $response response including username of the user to authorise - * @param array $options list of options + * @param AuthenticationResponse $response response including username of the user to authorise + * @param array $options list of options * - * @return array[JAuthenticationResponse] results of authorisation + * @return array[AuthenticationResponse] results of authorisation * * @since 11.2 */ public static function authorise($response, $options = array()) { // Get plugins in case they haven't been imported already - JPluginHelper::importPlugin('user'); + PluginHelper::importPlugin('user'); - JPluginHelper::importPlugin('authentication'); - $dispatcher = JEventDispatcher::getInstance(); + PluginHelper::importPlugin('authentication'); + $dispatcher = \JEventDispatcher::getInstance(); $results = $dispatcher->trigger('onUserAuthorisation', array($response, $options)); return $results; diff --git a/libraries/joomla/authentication/response.php b/libraries/src/Joomla/CMS/Authentication/AuthenticationResponse.php similarity index 87% rename from libraries/joomla/authentication/response.php rename to libraries/src/Joomla/CMS/Authentication/AuthenticationResponse.php index 3deab4d9806b1..90b0a859a6139 100644 --- a/libraries/joomla/authentication/response.php +++ b/libraries/src/Joomla/CMS/Authentication/AuthenticationResponse.php @@ -1,12 +1,13 @@