diff options
Diffstat (limited to 'phpBB/phpbb/auth')
| -rw-r--r-- | phpBB/phpbb/auth/auth.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/auth/provider/apache.php | 4 | ||||
| -rw-r--r-- | phpBB/phpbb/auth/provider/db.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/auth/provider/oauth/oauth.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/auth/provider_collection.php | 8 | 
5 files changed, 14 insertions, 12 deletions
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index 38755ccf99..b59f0e60ec 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -927,11 +927,11 @@ class auth  	*/  	function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)  	{ -		global $config, $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; +		global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; -		$method = trim(basename($config['auth_method'])); +		$provider_collection = $phpbb_container->get('auth.provider_collection'); -		$provider = $phpbb_container->get('auth.provider.' . $method); +		$provider = $provider_collection->get_provider();  		if ($provider)  		{  			$login = $provider->login($username, $password); diff --git a/phpBB/phpbb/auth/provider/apache.php b/phpBB/phpbb/auth/provider/apache.php index 9137a77210..aa5bf64335 100644 --- a/phpBB/phpbb/auth/provider/apache.php +++ b/phpBB/phpbb/auth/provider/apache.php @@ -137,7 +137,7 @@ class apache extends \phpbb\auth\provider\base  			return array(  				'status'		=> LOGIN_SUCCESS_CREATE_PROFILE,  				'error_msg'		=> false, -				'user_row'		=> user_row_apache($php_auth_user, $php_auth_pw), +				'user_row'		=> $this->user_row($php_auth_user, $php_auth_pw),  			);  		} @@ -185,7 +185,7 @@ class apache extends \phpbb\auth\provider\base  			}  			// create the user if he does not exist yet -			user_add(user_row_apache($php_auth_user, $php_auth_pw)); +			user_add($this->user_row($php_auth_user, $php_auth_pw));  			$sql = 'SELECT *  				FROM ' . USERS_TABLE . " diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php index 722eeffa9a..ba67c11e75 100644 --- a/phpBB/phpbb/auth/provider/db.php +++ b/phpBB/phpbb/auth/provider/db.php @@ -87,7 +87,7 @@ class db extends \phpbb\auth\provider\base  		$username_clean = utf8_clean_string($username); -		$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts +		$sql = 'SELECT *  			FROM ' . USERS_TABLE . "  			WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";  		$result = $this->db->sql_query($sql); @@ -123,7 +123,7 @@ class db extends \phpbb\auth\provider\base  				'username_clean'		=> $username_clean,  			);  			$sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $this->db->sql_build_array('INSERT', $attempt_data); -			$result = $this->db->sql_query($sql); +			$this->db->sql_query($sql);  		}  		else  		{ @@ -175,7 +175,7 @@ class db extends \phpbb\auth\provider\base  		}  		// Check password ... -		if ($this->passwords_manager->check($password, $row['user_password'])) +		if ($this->passwords_manager->check($password, $row['user_password'], $row))  		{  			// Check for old password hash...  			if ($this->passwords_manager->convert_flag || strlen($row['user_password']) == 32) diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 902c6ae84c..c0ce3f1fba 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -105,7 +105,7 @@ class oauth extends \phpbb\auth\provider\base  	protected $phpbb_root_path;  	/** -	* PHP extenstion +	* PHP file extension  	*  	* @var string  	*/ diff --git a/phpBB/phpbb/auth/provider_collection.php b/phpBB/phpbb/auth/provider_collection.php index a74a2135dc..8e7e9e2cc1 100644 --- a/phpBB/phpbb/auth/provider_collection.php +++ b/phpBB/phpbb/auth/provider_collection.php @@ -38,6 +38,7 @@ class provider_collection extends \phpbb\di\service_collection  	/**  	* Get an auth provider.  	* +	* @param string $provider_name The name of the auth provider  	* @return object	Default auth provider selected in config if it  	*			does exist. Otherwise the standard db auth  	*			provider. @@ -46,11 +47,12 @@ class provider_collection extends \phpbb\di\service_collection  	*			auth provider exist. The db auth provider  	*			should always exist in a phpBB installation.  	*/ -	public function get_provider() +	public function get_provider($provider_name = '')  	{ -		if ($this->offsetExists('auth.provider.' . basename(trim($this->config['auth_method'])))) +		$provider_name = ($provider_name !== '') ? $provider_name : basename(trim($this->config['auth_method'])); +		if ($this->offsetExists('auth.provider.' . $provider_name))  		{ -			return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method']))); +			return $this->offsetGet('auth.provider.' . $provider_name);  		}  		// Revert to db auth provider if selected method does not exist  		else if ($this->offsetExists('auth.provider.db'))  | 
