From e2c049c997c1829f4f71100bdbdbba9bf72b8868 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Mon, 17 Jun 2013 16:11:23 -0400 Subject: [feature/auth-refactor] Provider Interface Skeleton Creates a skeleton of the authentication provider interface. PHPBB3-9734 --- phpBB/includes/auth/provider_interface.php | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 phpBB/includes/auth/provider_interface.php (limited to 'phpBB/includes/auth/provider_interface.php') diff --git a/phpBB/includes/auth/provider_interface.php b/phpBB/includes/auth/provider_interface.php new file mode 100644 index 0000000000..ac7bb311a3 --- /dev/null +++ b/phpBB/includes/auth/provider_interface.php @@ -0,0 +1,32 @@ + Date: Tue, 18 Jun 2013 15:17:14 -0400 Subject: [feature/auth-refactor] Document the provider interface Provides basic documentation of the auth_provideR_interface. Changes the login method to login($username, $password) for consistency with the providers. acp() is not fully documented. It appears that it is meant to return an array of some sort and take in a variable by reference. PHPBB3-9734 --- phpBB/includes/auth/provider_interface.php | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/auth/provider_interface.php') diff --git a/phpBB/includes/auth/provider_interface.php b/phpBB/includes/auth/provider_interface.php index ac7bb311a3..8d966d8b3e 100644 --- a/phpBB/includes/auth/provider_interface.php +++ b/phpBB/includes/auth/provider_interface.php @@ -22,11 +22,41 @@ if (!defined('IN_PHPBB')) */ class phpbb_auth_provider_interface { + /** + * Checks whether the user is currently identified to the authentication + * provider. + * Called in acp_board while setting authentication plugins. + * + * @return boolean|string False if the user is identified, otherwise an + * error message. + */ public function init(); - public function login(); + /** + * Performs login. + * + * @param $username string The name of the user being authenticated. + * @param $password string The password of the user. + * @return array An associative array of the format: + * array( + * 'status' => status constant + * 'error_msg' => string + * 'user_row' => array + * ) + */ + public function login($username, $password); + /** + * Autologin function + * + * @return array containing the user row or empty if no auto login should + * take place + */ public function autologin(); + /** + * This function is used to output any required fields in the authentication + * admin panel. It also defines any required configuration table fields. + */ public function acp(); } -- cgit v1.2.1 From 553c300688818c36acc4d579762b3eb428d27321 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Wed, 19 Jun 2013 14:20:29 -0400 Subject: [feature/auth-refactor] Fix typos causing changes to not work Replaces short tags with long tags. Fixes the interface to be an interface and not class in the file. Removes unnecessary include_once from auth.php. PHPBB-9734 --- phpBB/includes/auth/provider_interface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/auth/provider_interface.php') diff --git a/phpBB/includes/auth/provider_interface.php b/phpBB/includes/auth/provider_interface.php index 8d966d8b3e..3dd1dba9be 100644 --- a/phpBB/includes/auth/provider_interface.php +++ b/phpBB/includes/auth/provider_interface.php @@ -1,4 +1,4 @@ - Date: Wed, 19 Jun 2013 14:57:11 -0400 Subject: [feature/auth-refactor] Refactor acp_board for new auth interface Partially refactors acp_board for the new authentication interface. Leaves some questionable if statements in the file. Modifies the interface to correctly impletment the acp() method. Modifies each provider to comply with the above mentioned interface modification. PHPBB3-9734 --- phpBB/includes/auth/provider_interface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/auth/provider_interface.php') diff --git a/phpBB/includes/auth/provider_interface.php b/phpBB/includes/auth/provider_interface.php index 3dd1dba9be..a789dccce7 100644 --- a/phpBB/includes/auth/provider_interface.php +++ b/phpBB/includes/auth/provider_interface.php @@ -58,5 +58,5 @@ 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. */ - public function acp(); + public function acp($new); } -- cgit v1.2.1 From 8214e6e8377b0858092e48aba3ba2a01994be47f Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Wed, 19 Jun 2013 15:32:20 -0400 Subject: [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 --- phpBB/includes/auth/provider_interface.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'phpBB/includes/auth/provider_interface.php') diff --git a/phpBB/includes/auth/provider_interface.php b/phpBB/includes/auth/provider_interface.php index a789dccce7..534f198c21 100644 --- a/phpBB/includes/auth/provider_interface.php +++ b/phpBB/includes/auth/provider_interface.php @@ -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); } -- cgit v1.2.1 From 24e323d59353810293dea41d6b9b4114dd627543 Mon Sep 17 00:00:00 2001 From: Joseph Warner Date: Thu, 27 Jun 2013 14:17:29 -0400 Subject: [feature/auth-refactor] Finish and clean up documentation PHPBB3-9734 --- phpBB/includes/auth/provider_interface.php | 46 +++++++++++++++++++----------- 1 file changed, 29 insertions(+), 17 deletions(-) (limited to 'phpBB/includes/auth/provider_interface.php') diff --git a/phpBB/includes/auth/provider_interface.php b/phpBB/includes/auth/provider_interface.php index 534f198c21..2d1935f8f0 100644 --- a/phpBB/includes/auth/provider_interface.php +++ b/phpBB/includes/auth/provider_interface.php @@ -26,31 +26,33 @@ interface phpbb_auth_provider_interface * Checks whether the user is currently identified to the authentication * provider. * Called in acp_board while setting authentication plugins. + * Changing to an authentication provider will not be permitted in acp_board + * if there is an error. * * @return boolean|string False if the user is identified, otherwise an - * error message. + * error message, or null if not implemented. */ public function init(); /** * Performs login. * - * @param $username string The name of the user being authenticated. - * @param $password string The password of the user. - * @return array An associative array of the format: - * array( - * 'status' => status constant - * 'error_msg' => string - * 'user_row' => array - * ) + * @param string $username The name of the user being authenticated. + * @param string $password The password of the user. + * @return array An associative array of the format: + * array( + * 'status' => status constant + * 'error_msg' => string + * 'user_row' => array + * ) */ public function login($username, $password); /** * Autologin function * - * @return array containing the user row or empty if no auto login should - * take place + * @return array|null containing the user row, empty if no auto login + * should take place, or null if not impletmented. */ public function autologin(); @@ -58,22 +60,32 @@ 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 + * @param array $new Contains the new configuration values that have + * been set in acp_board. + * @return array|null Returns null if not implemented or an array of the + * form: + * array( + * 'tpl' => string + * 'config' => array + * ) */ public function acp($new); /** - * Special logout function. + * Performs additional actions during logout. * - * @param type $data - * @param type $new_session + * @param array $data An array corresponding to + * phpbb_session::data + * @param boolean $new_session True for a new session, false for no new + * session. */ public function logout($data, $new_session); /** - * The session validation function checks whether the user is still logged in. + * The session validation function checks whether the user is still logged + * into phpBB. * - * @param type $user + * @param array $user * @return boolean true if the given user is authenticated, false if the * session should be closed, or null if not implemented. */ -- cgit v1.2.1