1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/11700] Move all recent code to namespaces

PHPBB3-11700
This commit is contained in:
Nils Adermann
2013-09-10 14:01:09 +02:00
parent 196e1813cd
commit b95fdacdd3
420 changed files with 2316 additions and 1840 deletions

View File

@@ -7,6 +7,8 @@
*
*/
namespace phpbb\auth\provider;
/**
* @ignore
*/
@@ -20,19 +22,19 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
class phpbb_auth_provider_apache extends phpbb_auth_provider_base
class apache extends \phpbb\auth\provider\base
{
/**
* Apache Authentication Constructor
*
* @param phpbb_db_driver $db
* @param phpbb_config $config
* @param phpbb_request $request
* @param phpbb_user $user
* @param \phpbb\db\driver\driver $db
* @param \phpbb\config\config $config
* @param \phpbb\request\request $request
* @param \phpbb\user $user
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $phpbb_root_path, $php_ext)
public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
@@ -47,7 +49,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
*/
public function init()
{
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')))
if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER')))
{
return $this->user->lang['APACHE_SETUP_BEFORE_USE'];
}
@@ -78,7 +80,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
);
}
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER))
if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER))
{
return array(
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
@@ -149,7 +151,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
*/
public function autologin()
{
if (!$this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER))
if (!$this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER))
{
return array();
}
@@ -202,8 +204,8 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
* This function generates an array which can be passed to the user_add
* function in order to create a user
*
* @param string $username The username of the new user.
* @param string $password The password of the new user.
* @param string $username The username of the new \user.
* @param string $password The password of the new \user.
* @return array Contains data that can be passed directly to
* the user_add function.
*/
@@ -241,7 +243,7 @@ class phpbb_auth_provider_apache extends phpbb_auth_provider_base
public function validate_session($user)
{
// Check if PHP_AUTH_USER is set and handle this case
if ($this->request->is_set('PHP_AUTH_USER', phpbb_request_request_interface::SERVER))
if ($this->request->is_set('PHP_AUTH_USER', \phpbb\request\request_interface::SERVER))
{
$php_auth_user = $this->request->server('PHP_AUTH_USER');

View File

@@ -7,6 +7,8 @@
*
*/
namespace phpbb\auth\provider;
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
abstract class phpbb_auth_provider_base implements phpbb_auth_provider_provider_interface
abstract class base implements \phpbb\auth\provider\provider_interface
{
/**
* {@inheritdoc}

View File

@@ -7,6 +7,8 @@
*
*/
namespace phpbb\auth\provider;
/**
* @ignore
*/
@@ -22,20 +24,20 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
class phpbb_auth_provider_db extends phpbb_auth_provider_base
class db extends \phpbb\auth\provider\base
{
/**
* Database Authentication Constructor
*
* @param phpbb_db_driver $db
* @param phpbb_config $config
* @param phpbb_request $request
* @param phpbb_user $user
* @param \phpbb\db\driver\driver $db
* @param \phpbb\config\config $config
* @param \phpbb\request\request $request
* @param \phpbb\user $user
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $phpbb_root_path, $php_ext)
public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
@@ -149,7 +151,7 @@ class phpbb_auth_provider_db extends phpbb_auth_provider_base
include ($this->phpbb_root_path . 'includes/captcha/captcha_factory.' . $this->php_ext);
}
$captcha = phpbb_captcha_factory::get_instance($this->config['captcha_plugin']);
$captcha = \phpbb_captcha_factory::get_instance($this->config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
$vc_response = $captcha->validate($row);
if ($vc_response)
@@ -202,7 +204,7 @@ class phpbb_auth_provider_db extends phpbb_auth_provider_base
{
$hash = phpbb_hash($password_new_format);
// Update the password in the users table to the new format and remove user_pass_convert flag
// Update the password in the users table to the new \format and remove user_pass_convert flag
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_password = \'' . $this->db->sql_escape($hash) . '\',
user_pass_convert = 0
@@ -239,7 +241,7 @@ class phpbb_auth_provider_db extends phpbb_auth_provider_base
{
$hash = phpbb_hash($password);
// Update the password in the users table to the new format
// Update the password in the users table to the new \format
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_password = '" . $this->db->sql_escape($hash) . "',
user_pass_convert = 0

View File

@@ -7,6 +7,8 @@
*
*/
namespace phpbb\auth\provider;
/**
* @ignore
*/
@@ -22,16 +24,16 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
class phpbb_auth_provider_ldap extends phpbb_auth_provider_base
class ldap extends \phpbb\auth\provider\base
{
/**
* LDAP Authentication Constructor
*
* @param phpbb_db_driver $db
* @param phpbb_config $config
* @param phpbb_user $user
* @param \phpbb\db\driver\driver $db
* @param \phpbb\config\config $config
* @param \phpbb\user $user
*/
public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_user $user)
public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\user $user)
{
$this->db = $db;
$this->config = $config;

View File

@@ -7,6 +7,8 @@
*
*/
namespace phpbb\auth\provider;
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
interface phpbb_auth_provider_provider_interface
interface provider_interface
{
/**
* Checks whether the user is currently identified to the authentication
@@ -70,7 +72,7 @@ interface phpbb_auth_provider_provider_interface
* 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
* @param array $new_config Contains the new \configuration values that
* have been set in acp_board.
* @return array|null Returns null if not implemented or an array with
* the template file name and an array of the vars
@@ -87,8 +89,8 @@ interface phpbb_auth_provider_provider_interface
* Performs additional actions during logout.
*
* @param array $data An array corresponding to
* phpbb_session::data
* @param boolean $new_session True for a new session, false for no new
* \phpbb\session::data
* @param boolean $new_session True for a new \session, false for no new
* session.
*/
public function logout($data, $new_session);