mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 21:08:53 +00:00
[feature/auth-refactor] Have a base auth class
PHPBB3-9734
This commit is contained in:
parent
2fcae1ca16
commit
3c11052fb3
4 changed files with 75 additions and 83 deletions
|
@ -20,7 +20,8 @@ if (!defined('IN_PHPBB'))
|
|||
*
|
||||
* @package auth
|
||||
*/
|
||||
class phpbb_auth_provider_apache implements phpbb_auth_provider_interface
|
||||
class phpbb_auth_provider_apache extends phpbb_auth_provider_base
|
||||
implements phpbb_auth_provider_interface
|
||||
{
|
||||
/**
|
||||
* Apache Authentication Constructor
|
||||
|
@ -256,20 +257,4 @@ class phpbb_auth_provider_apache implements phpbb_auth_provider_interface
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function acp($new)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
69
phpBB/includes/auth/provider/base.php
Normal file
69
phpBB/includes/auth/provider/base.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package auth
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base authentication provider class that all other providers must implement.
|
||||
*
|
||||
* @package auth
|
||||
*/
|
||||
abstract class phpbb_auth_provider_base implements phpbb_auth_provider_interface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
abstract public function login($username, $password);
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function autologin()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function acp($new)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function validate_session($user)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -22,7 +22,8 @@ if (!defined('IN_PHPBB'))
|
|||
*
|
||||
* @package auth
|
||||
*/
|
||||
class phpbb_auth_provider_db implements phpbb_auth_provider_interface
|
||||
class phpbb_auth_provider_db extends phpbb_auth_provider_base
|
||||
implements phpbb_auth_provider_interface
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -45,14 +46,6 @@ class phpbb_auth_provider_db implements phpbb_auth_provider_interface
|
|||
$this->php_ext = $php_ext;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -302,36 +295,4 @@ class phpbb_auth_provider_db implements phpbb_auth_provider_interface
|
|||
'user_row' => $row,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function autologin()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function acp($new)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function validate_session($user)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@ if (!defined('IN_PHPBB'))
|
|||
*
|
||||
* @package auth
|
||||
*/
|
||||
class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface
|
||||
class phpbb_auth_provider_ldap extends phpbb_auth_provider_base
|
||||
implements phpbb_auth_provider_interface
|
||||
{
|
||||
/**
|
||||
* LDAP Authentication Constructor
|
||||
|
@ -283,14 +284,6 @@ class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function autologin()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -367,20 +360,4 @@ class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface
|
|||
{
|
||||
return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function logout($data, $new_session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function validate_session($user)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue