diff options
Diffstat (limited to 'phpBB/phpbb/auth/provider')
-rw-r--r-- | phpBB/phpbb/auth/provider/apache.php | 26 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/base.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/db.php | 20 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/ldap.php | 12 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/provider_interface.php (renamed from phpBB/phpbb/auth/provider/interface.php) | 12 |
5 files changed, 42 insertions, 32 deletions
diff --git a/phpBB/phpbb/auth/provider/apache.php b/phpBB/phpbb/auth/provider/apache.php index 2e80436f78..cd1330e7b0 100644 --- a/phpBB/phpbb/auth/provider/apache.php +++ b/phpBB/phpbb/auth/provider/apache.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider; + /** * @ignore */ @@ -20,19 +22,19 @@ if (!defined('IN_PHPBB')) * * @package auth */ -class phpbb_auth_provider_apache extends phpbb_auth_provider_base +class apache extends \phpbb\auth\provider\base { /** * Apache Authentication Constructor * - * @param phpbb_db_driver $db - * @param phpbb_config $config - * @param phpbb_request $request - * @param phpbb_user $user + * @param \phpbb\db\driver\driver $db + * @param \phpbb\config\config $config + * @param \phpbb\request\request $request + * @param \phpbb\user $user * @param string $phpbb_root_path * @param string $php_ext */ - public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext) { $this->db = $db; $this->config = $config; @@ -47,7 +49,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base */ public function init() { - if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'))) + if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'))) { return $this->user->lang['APACHE_SETUP_BEFORE_USE']; } @@ -78,7 +80,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base ); } - if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER)) + if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER)) { return array( 'status' => LOGIN_ERROR_EXTERNAL_AUTH, @@ -149,7 +151,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base */ public function autologin() { - if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER)) + if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER)) { return array(); } @@ -202,8 +204,8 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base * This function generates an array which can be passed to the user_add * function in order to create a user * - * @param string $username The username of the new user. - * @param string $password The password of the new user. + * @param string $username The username of the new \user. + * @param string $password The password of the new \user. * @return array Contains data that can be passed directly to * the user_add function. */ @@ -241,7 +243,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base public function validate_session($user) { // Check if PHP_AUTH_USER is set and handle this case - if ($this->request->is_set('PHP_AUTH_USER', phpbb_request_interface::SERVER)) + if ($this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER)) { $php_auth_user = $this->request->server('PHP_AUTH_USER'); diff --git a/phpBB/phpbb/auth/provider/base.php b/phpBB/phpbb/auth/provider/base.php index 09e918cee4..2222d8c1b6 100644 --- a/phpBB/phpbb/auth/provider/base.php +++ b/phpBB/phpbb/auth/provider/base.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package auth */ -abstract class phpbb_auth_provider_base implements phpbb_auth_provider_interface +abstract class base implements \phpbb\auth\provider\provider_interface { /** * {@inheritdoc} diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php index 0934c56d9b..f613bafc6a 100644 --- a/phpBB/phpbb/auth/provider/db.php +++ b/phpBB/phpbb/auth/provider/db.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider; + /** * @ignore */ @@ -22,20 +24,20 @@ if (!defined('IN_PHPBB')) * * @package auth */ -class phpbb_auth_provider_db extends phpbb_auth_provider_base +class db extends \phpbb\auth\provider\base { /** * Database Authentication Constructor * - * @param phpbb_db_driver $db - * @param phpbb_config $config - * @param phpbb_request $request - * @param phpbb_user $user + * @param \phpbb\db\driver\driver $db + * @param \phpbb\config\config $config + * @param \phpbb\request\request $request + * @param \phpbb\user $user * @param string $phpbb_root_path * @param string $php_ext */ - public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext) { $this->db = $db; $this->config = $config; @@ -149,7 +151,7 @@ class phpbb_auth_provider_db extends phpbb_auth_provider_base include ($this->phpbb_root_path . 'includes/captcha/captcha_factory.' . $this->php_ext); } - $captcha = phpbb_captcha_factory::get_instance($this->config['captcha_plugin']); + $captcha = \phpbb_captcha_factory::get_instance($this->config['captcha_plugin']); $captcha->init(CONFIRM_LOGIN); $vc_response = $captcha->validate($row); if ($vc_response) @@ -202,7 +204,7 @@ class phpbb_auth_provider_db extends phpbb_auth_provider_base { $hash = phpbb_hash($password_new_format); - // Update the password in the users table to the new format and remove user_pass_convert flag + // Update the password in the users table to the new \format and remove user_pass_convert flag $sql = 'UPDATE ' . USERS_TABLE . ' SET user_password = \'' . $this->db->sql_escape($hash) . '\', user_pass_convert = 0 @@ -239,7 +241,7 @@ class phpbb_auth_provider_db extends phpbb_auth_provider_base { $hash = phpbb_hash($password); - // Update the password in the users table to the new format + // Update the password in the users table to the new \format $sql = 'UPDATE ' . USERS_TABLE . " SET user_password = '" . $this->db->sql_escape($hash) . "', user_pass_convert = 0 diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php index 0196529408..9d29789567 100644 --- a/phpBB/phpbb/auth/provider/ldap.php +++ b/phpBB/phpbb/auth/provider/ldap.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider; + /** * @ignore */ @@ -22,16 +24,16 @@ if (!defined('IN_PHPBB')) * * @package auth */ -class phpbb_auth_provider_ldap extends phpbb_auth_provider_base +class ldap extends \phpbb\auth\provider\base { /** * LDAP Authentication Constructor * - * @param phpbb_db_driver $db - * @param phpbb_config $config - * @param phpbb_user $user + * @param \phpbb\db\driver\driver $db + * @param \phpbb\config\config $config + * @param \phpbb\user $user */ - public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_user $user) + public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\user $user) { $this->db = $db; $this->config = $config; diff --git a/phpBB/phpbb/auth/provider/interface.php b/phpBB/phpbb/auth/provider/provider_interface.php index eadd5f01d1..46245d34ca 100644 --- a/phpBB/phpbb/auth/provider/interface.php +++ b/phpBB/phpbb/auth/provider/provider_interface.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\auth\provider; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package auth */ -interface phpbb_auth_provider_interface +interface provider_interface { /** * Checks whether the user is currently identified to the authentication @@ -75,7 +77,7 @@ interface phpbb_auth_provider_interface * options with whatever configuraton values are passed to it as an array. * It then returns the name of the acp file related to this authentication * provider. - * @param array $new_config Contains the new configuration values that + * @param array $new_config Contains the new \configuration values that * have been set in acp_board. * @return array|null Returns null if not implemented or an array with * the template file name and an array of the vars @@ -131,8 +133,8 @@ interface phpbb_auth_provider_interface * Performs additional actions during logout. * * @param array $data An array corresponding to - * phpbb_session::data - * @param boolean $new_session True for a new session, false for no new + * \phpbb\session::data + * @param boolean $new_session True for a new \session, false for no new * session. */ public function logout($data, $new_session); @@ -142,7 +144,7 @@ interface phpbb_auth_provider_interface * into phpBB. * * @param array $user - * @return boolean true if the given user is authenticated, false if the + * @return boolean true if the given user is authenticated, false if the * session should be closed, or null if not implemented. */ public function validate_session($user); |