From 35b45cdff1ad3a91f0e36853c721c7ec6472490c Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 23 Aug 2007 13:41:34 +0000 Subject: - added an option to specify a port for the LDAP server - restricted access to "Recent searches" to admins who are allowed to configure search [Bug #14085] git-svn-id: file:///svn/phpbb/trunk@8064 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth/auth_ldap.php | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 1e90aebe7e..a4e6365183 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -26,7 +26,17 @@ function init_ldap() return $user->lang['LDAP_NO_LDAP_EXTENSION']; } - if (!($ldap = @ldap_connect($config['ldap_server']))) + $config['ldap_port'] = (int) $config['ldap_port']; + if ($config['ldap_port']) + { + $ldap = @ldap_connect($config['ldap_server'], $config['ldap_port']); + } + else + { + $ldap = @ldap_connect($config['ldap_server']); + } + + if (!$ldap) { return $user->lang['LDAP_NO_SERVER_CONNECTION']; } @@ -91,7 +101,17 @@ function login_ldap(&$username, &$password) ); } - if (!($ldap = @ldap_connect($config['ldap_server']))) + $config['ldap_port'] = (int) $config['ldap_port']; + if ($config['ldap_port']) + { + $ldap = @ldap_connect($config['ldap_server'], $config['ldap_port']); + } + else + { + $ldap = @ldap_connect($config['ldap_server']); + } + + if (!$ldap) { return array( 'status' => LOGIN_ERROR_EXTERNAL_AUTH, @@ -256,6 +276,10 @@ function acp_ldap(&$new)

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

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

' . $user->lang['LDAP_DN_EXPLAIN'] . '
@@ -285,7 +309,7 @@ function acp_ldap(&$new) // These are fields required in the config table return array( 'tpl' => $tpl, - 'config' => array('ldap_server', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password') + 'config' => array('ldap_server', 'ldap_port', 'ldap_base_dn', 'ldap_uid', 'ldap_user_filter', 'ldap_email', 'ldap_user', 'ldap_password') ); } -- cgit v1.2.1