From 794c5749696c9fa2595ed3a1d7c836a0d984e11c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 22 Feb 2009 15:29:18 +0000 Subject: remove global and change $user-> to phpbb::$user-> git-svn-id: file:///svn/phpbb/trunk@9334 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth/auth_ldap.php | 40 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'phpBB/includes/auth/auth_ldap.php') diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 19ec9db683..84eb6f33d4 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -27,11 +27,9 @@ if (!defined('IN_PHPBB')) */ function init_ldap() { - global $user; - if (!@extension_loaded('ldap')) { - return $user->lang['LDAP_NO_LDAP_EXTENSION']; + return phpbb::$user->lang['LDAP_NO_LDAP_EXTENSION']; } phpbb::$config['ldap_port'] = (int) phpbb::$config['ldap_port']; @@ -46,7 +44,7 @@ function init_ldap() if (!$ldap) { - return $user->lang['LDAP_NO_SERVER_CONNECTION']; + return phpbb::$user->lang['LDAP_NO_SERVER_CONNECTION']; } @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); @@ -56,7 +54,7 @@ function init_ldap() { if (!@ldap_bind($ldap, htmlspecialchars_decode(phpbb::$config['ldap_user']), htmlspecialchars_decode(phpbb::$config['ldap_password']))) { - return $user->lang['LDAP_INCORRECT_USER_PASSWORD']; + return phpbb::$user->lang['LDAP_INCORRECT_USER_PASSWORD']; } } @@ -64,7 +62,7 @@ function init_ldap() $search = @ldap_search( $ldap, phpbb::$config['ldap_base_dn'], - ldap_user_filter($user->data['username']), + ldap_user_filter(phpbb::$user->data['username']), (empty(phpbb::$config['ldap_email'])) ? array(phpbb::$config['ldap_uid']) : array(phpbb::$config['ldap_uid'], phpbb::$config['ldap_email']), 0, 1 @@ -72,7 +70,7 @@ function init_ldap() if ($search === false) { - return $user->lang['LDAP_NO_SERVER_CONNECTION']; + return phpbb::$user->lang['LDAP_NO_SERVER_CONNECTION']; } $result = @ldap_get_entries($ldap, $search); @@ -82,12 +80,12 @@ function init_ldap() if (!is_array($result) || sizeof($result) < 2) { - return sprintf($user->lang['LDAP_NO_IDENTITY'], $user->data['username']); + return sprintf(phpbb::$user->lang['LDAP_NO_IDENTITY'], phpbb::$user->data['username']); } if (!empty(phpbb::$config['ldap_email']) && !isset($result[0][phpbb::$config['ldap_email']])) { - return $user->lang['LDAP_NO_EMAIL']; + return phpbb::$user->lang['LDAP_NO_EMAIL']; } return false; @@ -98,8 +96,6 @@ function init_ldap() */ function login_ldap(&$username, &$password) { - global $db, $user; - // do not allow empty password if (!$password) { @@ -154,7 +150,7 @@ function login_ldap(&$username, &$password) { if (!@ldap_bind($ldap, phpbb::$config['ldap_user'], htmlspecialchars_decode(phpbb::$config['ldap_password']))) { - return $user->lang['LDAP_NO_SERVER_CONNECTION']; + return phpbb::$user->lang['LDAP_NO_SERVER_CONNECTION']; } } @@ -226,7 +222,7 @@ function login_ldap(&$username, &$password) 'user_email' => (!empty(phpbb::$config['ldap_email'])) ? $ldap_result[0][phpbb::$config['ldap_email']][0] : '', 'group_id' => (int) $row['group_id'], 'user_type' => phpbb::USER_NORMAL, - 'user_ip' => $user->ip, + 'user_ip' => phpbb::$user->ip, ); unset($ldap_result); @@ -293,40 +289,38 @@ function ldap_escape($string) */ function acp_ldap(&$new) { - global $user; - $tpl = '
-

' . $user->lang['LDAP_SERVER_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_SERVER_EXPLAIN'] . '
-

' . $user->lang['LDAP_PORT_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_PORT_EXPLAIN'] . '
-

' . $user->lang['LDAP_DN_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_DN_EXPLAIN'] . '
-

' . $user->lang['LDAP_UID_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_UID_EXPLAIN'] . '
-

' . $user->lang['LDAP_USER_FILTER_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_USER_FILTER_EXPLAIN'] . '
-

' . $user->lang['LDAP_EMAIL_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_EMAIL_EXPLAIN'] . '
-

' . $user->lang['LDAP_USER_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_USER_EXPLAIN'] . '
-

' . $user->lang['LDAP_PASSWORD_EXPLAIN'] . '
+

' . phpbb::$user->lang['LDAP_PASSWORD_EXPLAIN'] . '
'; -- cgit v1.2.1