allow specifying LDAP version 2 or 3 in the config

git-svn-id: http://www.observium.org/svn/observer/trunk@978 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-03-01 01:23:37 +00:00
parent 1e7860e930
commit 5c15e4ec95
2 changed files with 7 additions and 0 deletions

View File

@@ -7,6 +7,10 @@ function authenticate($username,$password)
$ds=@ldap_connect($config['auth_ldap_server'],$config['auth_ldap_port']);
if ($ds)
{
if ($config['auth_ldap_version'])
{
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $config['auth_ldap_version']);
}
if (ldap_bind($ds, $config['auth_ldap_prefix'] . $username . $config['auth_ldap_suffix'], $password))
{
if (!$config['auth_ldap_group'])