diff options
author | Nils Adermann <naderman@naderman.de> | 2007-08-23 13:41:34 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2007-08-23 13:41:34 +0000 |
commit | 35b45cdff1ad3a91f0e36853c721c7ec6472490c (patch) | |
tree | b5783c7d7d430d5f2b52b7b0f8725755d93be811 /phpBB/includes/auth/auth_ldap.php | |
parent | 382fe7cab41182eb0fe852de9736beaa153132b3 (diff) | |
download | forums-35b45cdff1ad3a91f0e36853c721c7ec6472490c.tar forums-35b45cdff1ad3a91f0e36853c721c7ec6472490c.tar.gz forums-35b45cdff1ad3a91f0e36853c721c7ec6472490c.tar.bz2 forums-35b45cdff1ad3a91f0e36853c721c7ec6472490c.tar.xz forums-35b45cdff1ad3a91f0e36853c721c7ec6472490c.zip |
- 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
Diffstat (limited to 'phpBB/includes/auth/auth_ldap.php')
-rw-r--r-- | phpBB/includes/auth/auth_ldap.php | 30 |
1 files changed, 27 insertions, 3 deletions
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, @@ -257,6 +277,10 @@ function acp_ldap(&$new) <dd><input type="text" id="ldap_server" size="40" name="config[ldap_server]" value="' . $new['ldap_server'] . '" /></dd> </dl> <dl> + <dt><label for="ldap_port">' . $user->lang['LDAP_PORT'] . ':</label><br /><span>' . $user->lang['LDAP_PORT_EXPLAIN'] . '</span></dt> + <dd><input type="text" id="ldap_port" size="40" name="config[ldap_port]" value="' . $new['ldap_port'] . '" /></dd> + </dl> + <dl> <dt><label for="ldap_dn">' . $user->lang['LDAP_DN'] . ':</label><br /><span>' . $user->lang['LDAP_DN_EXPLAIN'] . '</span></dt> <dd><input type="text" id="ldap_dn" size="40" name="config[ldap_base_dn]" value="' . $new['ldap_base_dn'] . '" /></dd> </dl> @@ -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') ); } |