2013-06-19 14:20:29 -04:00
|
|
|
<?php
|
2013-06-17 16:11:23 -04:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The interface authentication provider classes have to implement.
|
|
|
|
*
|
|
|
|
* @package auth
|
|
|
|
*/
|
2013-06-19 14:20:29 -04:00
|
|
|
interface phpbb_auth_provider_interface
|
2013-06-17 16:11:23 -04:00
|
|
|
{
|
2013-06-18 15:17:14 -04:00
|
|
|
/**
|
|
|
|
* Checks whether the user is currently identified to the authentication
|
|
|
|
* provider.
|
|
|
|
* Called in acp_board while setting authentication plugins.
|
2013-06-27 14:17:29 -04:00
|
|
|
* Changing to an authentication provider will not be permitted in acp_board
|
|
|
|
* if there is an error.
|
2013-06-18 15:17:14 -04:00
|
|
|
*
|
|
|
|
* @return boolean|string False if the user is identified, otherwise an
|
2013-06-27 14:17:29 -04:00
|
|
|
* error message, or null if not implemented.
|
2013-06-18 15:17:14 -04:00
|
|
|
*/
|
2013-06-17 16:11:23 -04:00
|
|
|
public function init();
|
|
|
|
|
2013-06-18 15:17:14 -04:00
|
|
|
/**
|
|
|
|
* Performs login.
|
|
|
|
*
|
2013-06-27 14:17:29 -04:00
|
|
|
* @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
|
|
|
|
* )
|
2013-06-18 15:17:14 -04:00
|
|
|
*/
|
|
|
|
public function login($username, $password);
|
2013-06-17 16:11:23 -04:00
|
|
|
|
2013-06-18 15:17:14 -04:00
|
|
|
/**
|
|
|
|
* Autologin function
|
|
|
|
*
|
2013-06-27 14:17:29 -04:00
|
|
|
* @return array|null containing the user row, empty if no auto login
|
|
|
|
* should take place, or null if not impletmented.
|
2013-06-18 15:17:14 -04:00
|
|
|
*/
|
2013-06-17 16:11:23 -04:00
|
|
|
public function autologin();
|
|
|
|
|
2013-06-18 15:17:14 -04:00
|
|
|
/**
|
|
|
|
* This function is used to output any required fields in the authentication
|
|
|
|
* admin panel. It also defines any required configuration table fields.
|
2013-06-19 15:32:20 -04:00
|
|
|
*
|
2013-06-27 14:17:29 -04:00
|
|
|
* @return array|null Returns null if not implemented or an array of the
|
2013-07-08 14:02:53 -04:00
|
|
|
* configuration fields of the provider.
|
2013-06-18 15:17:14 -04:00
|
|
|
*/
|
2013-07-08 14:02:53 -04:00
|
|
|
public function acp();
|
2013-06-19 15:32:20 -04:00
|
|
|
|
2013-07-05 13:31:05 -04:00
|
|
|
/**
|
|
|
|
* This function updates the template with variables related to the acp
|
|
|
|
* options with whatever configuraton values are passed to it as an array.
|
|
|
|
* It then returns the name of the acp file related to this authentication
|
|
|
|
* provider.
|
|
|
|
* @param array $new_config Contains the new configuration values that
|
|
|
|
* have been set in acp_board.
|
2013-07-12 15:53:36 -04:00
|
|
|
* @return array|null Returns null if not implemented or an array with
|
|
|
|
* the template file name and an array of the vars
|
|
|
|
* that the template needs that must conform to the
|
|
|
|
* following example:
|
|
|
|
* array(
|
|
|
|
* 'TEMPLATE_FILE' => string,
|
|
|
|
* 'TEMPLATE_VARS' => array(...),
|
|
|
|
* )
|
2013-07-23 14:41:21 -04:00
|
|
|
* An optional third element may be added to this
|
|
|
|
* array: 'BLOCK_VAR_NAME'. If this is present,
|
|
|
|
* then it's value should be a string that is used
|
|
|
|
* to designate the name of the loop used in the
|
|
|
|
* ACP template file. In addition to this, an
|
|
|
|
* additional key named 'BLOCK_VARS' is required.
|
|
|
|
* This must be an array containing at least one
|
|
|
|
* array of variables that will be assigned during
|
|
|
|
* the loop in the template. An example of this is
|
|
|
|
* presented below:
|
|
|
|
* array(
|
|
|
|
* 'BLOCK_VAR_NAME' => string,
|
|
|
|
* 'BLOCK_VARS' => array(
|
|
|
|
* 'KEY IS UNIMPORTANT' => array(...),
|
|
|
|
* ),
|
|
|
|
* 'TEMPLATE_FILE' => string,
|
|
|
|
* 'TEMPLATE_VARS' => array(...),
|
|
|
|
* )
|
2013-07-05 13:31:05 -04:00
|
|
|
*/
|
|
|
|
public function get_acp_template($new_config);
|
|
|
|
|
2013-06-19 15:32:20 -04:00
|
|
|
/**
|
2013-06-27 14:17:29 -04:00
|
|
|
* Performs additional actions during logout.
|
2013-06-19 15:32:20 -04:00
|
|
|
*
|
2013-06-27 14:17:29 -04:00
|
|
|
* @param array $data An array corresponding to
|
|
|
|
* phpbb_session::data
|
|
|
|
* @param boolean $new_session True for a new session, false for no new
|
|
|
|
* session.
|
2013-06-19 15:32:20 -04:00
|
|
|
*/
|
|
|
|
public function logout($data, $new_session);
|
|
|
|
|
|
|
|
/**
|
2013-06-27 14:17:29 -04:00
|
|
|
* The session validation function checks whether the user is still logged
|
|
|
|
* into phpBB.
|
2013-06-19 15:32:20 -04:00
|
|
|
*
|
2013-06-27 14:17:29 -04:00
|
|
|
* @param array $user
|
2013-06-19 15:32:20 -04:00
|
|
|
* @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);
|
2013-06-17 16:11:23 -04:00
|
|
|
}
|