diff options
author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-11 10:54:55 -0400 |
---|---|---|
committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-11 10:56:04 -0400 |
commit | 3c11052fb3896b43685f596dc6e52f9cc07d6807 (patch) | |
tree | e602f45a026c47250a132051c2afbd230073f820 /phpBB | |
parent | 2fcae1ca16d096d2839b487e8c1bcbe0f313d91f (diff) | |
download | forums-3c11052fb3896b43685f596dc6e52f9cc07d6807.tar forums-3c11052fb3896b43685f596dc6e52f9cc07d6807.tar.gz forums-3c11052fb3896b43685f596dc6e52f9cc07d6807.tar.bz2 forums-3c11052fb3896b43685f596dc6e52f9cc07d6807.tar.xz forums-3c11052fb3896b43685f596dc6e52f9cc07d6807.zip |
[feature/auth-refactor] Have a base auth class
PHPBB3-9734
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/auth/provider/apache.php | 19 | ||||
-rw-r--r-- | phpBB/includes/auth/provider/base.php | 69 | ||||
-rw-r--r-- | phpBB/includes/auth/provider/db.php | 43 | ||||
-rw-r--r-- | phpBB/includes/auth/provider/ldap.php | 27 |
4 files changed, 75 insertions, 83 deletions
diff --git a/phpBB/includes/auth/provider/apache.php b/phpBB/includes/auth/provider/apache.php index 5f6f2862b6..e0217725d6 100644 --- a/phpBB/includes/auth/provider/apache.php +++ b/phpBB/includes/auth/provider/apache.php @@ -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; - } } diff --git a/phpBB/includes/auth/provider/base.php b/phpBB/includes/auth/provider/base.php new file mode 100644 index 0000000000..e053a1829b --- /dev/null +++ b/phpBB/includes/auth/provider/base.php @@ -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; + } +} diff --git a/phpBB/includes/auth/provider/db.php b/phpBB/includes/auth/provider/db.php index 894041c9cf..b9b808cb5d 100644 --- a/phpBB/includes/auth/provider/db.php +++ b/phpBB/includes/auth/provider/db.php @@ -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 { /** @@ -48,14 +49,6 @@ class phpbb_auth_provider_db implements phpbb_auth_provider_interface /** * {@inheritdoc} */ - public function init() - { - return; - } - - /** - * {@inheritdoc} - */ public function login($username, $password) { // Auth plugins get the password untrimmed. @@ -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; - } } diff --git a/phpBB/includes/auth/provider/ldap.php b/phpBB/includes/auth/provider/ldap.php index f67c1e9247..dbb569f466 100644 --- a/phpBB/includes/auth/provider/ldap.php +++ b/phpBB/includes/auth/provider/ldap.php @@ -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 @@ -286,14 +287,6 @@ class phpbb_auth_provider_ldap implements phpbb_auth_provider_interface /** * {@inheritdoc} */ - public function autologin() - { - return; - } - - /** - * {@inheritdoc} - */ public function acp($new) { $tpl = ' @@ -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; - } } |