mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[feature/auth-refactor] Finish refactoring auth plugins
I believe that this commit should have final minimal changes needed to replace the old auth plugins with the refactored auth plugins. Added a few more elements to the interface based on the old auth plugins. Documentation is not complete and need works on these new elements. PHPBB3-9734
This commit is contained in:
parent
f4def220ce
commit
8214e6e837
@ -237,7 +237,7 @@ class phpbb_auth_provider_apache implements phpbb_auth_provider_interface
|
||||
* @return boolean true if the given user is authenticated or false if
|
||||
* the session should be closed
|
||||
*/
|
||||
public function validate_session(&$user)
|
||||
public function validate_session($user)
|
||||
{
|
||||
global $request;
|
||||
|
||||
@ -262,4 +262,9 @@ class phpbb_auth_provider_apache implements phpbb_auth_provider_interface
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -302,4 +302,14 @@ class phpbb_auth_provider_db implements phpbb_auth_provider_interface
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public function validate_session($user)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,25 @@ interface phpbb_auth_provider_interface
|
||||
/**
|
||||
* This function is used to output any required fields in the authentication
|
||||
* admin panel. It also defines any required configuration table fields.
|
||||
*
|
||||
* @param type $new
|
||||
*/
|
||||
public function acp($new);
|
||||
|
||||
/**
|
||||
* Special logout function.
|
||||
*
|
||||
* @param type $data
|
||||
* @param type $new_session
|
||||
*/
|
||||
public function logout($data, $new_session);
|
||||
|
||||
/**
|
||||
* The session validation function checks whether the user is still logged in.
|
||||
*
|
||||
* @param type $user
|
||||
* @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);
|
||||
}
|
||||
|
@ -358,4 +358,14 @@ class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface
|
||||
{
|
||||
return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
|
||||
}
|
||||
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public function validate_session($user)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -402,12 +402,13 @@ class phpbb_session
|
||||
|
||||
// Check whether the session is still valid if we have one
|
||||
$method = basename(trim($config['auth_method']));
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
$method = 'validate_session_' . $method;
|
||||
if (function_exists($method))
|
||||
$class = 'phpbb_auth_provider_' . $method;
|
||||
if (class_exists($class))
|
||||
{
|
||||
if (!$method($this->data))
|
||||
$provider = new $class();
|
||||
$ret = $provider->validate_session($this->data);
|
||||
if ($ret !== null && !$ret)
|
||||
{
|
||||
$session_expired = true;
|
||||
}
|
||||
@ -573,7 +574,7 @@ class phpbb_session
|
||||
if (class_exists($class))
|
||||
{
|
||||
$provider = new $class();
|
||||
$this->data = $class->autologin();
|
||||
$this->data = $provider->autologin();
|
||||
|
||||
if (sizeof($this->data))
|
||||
{
|
||||
@ -893,12 +894,12 @@ class phpbb_session
|
||||
|
||||
// Allow connecting logout with external auth method logout
|
||||
$method = basename(trim($config['auth_method']));
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
$method = 'logout_' . $method;
|
||||
if (function_exists($method))
|
||||
$class = 'phpbb_auth_provider_' . $method;
|
||||
if (class_exists($class))
|
||||
{
|
||||
$method($this->data, $new_session);
|
||||
$provider = new $class();
|
||||
$provider->logout($this->data, $new_session);
|
||||
}
|
||||
|
||||
if ($this->data['user_id'] != ANONYMOUS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user