Update ldap.php
If the LDAP password is not provided then set authorized to false.
This commit is contained in:
parent
bd7867ef5e
commit
5c5446b953
|
|
@ -62,12 +62,20 @@ class plugin_ldap {
|
||||||
//Note: As of 4/16, the call below will fail randomly. PHP debug reports ldap_bind
|
//Note: As of 4/16, the call below will fail randomly. PHP debug reports ldap_bind
|
||||||
//called below with all arguments '*uninitialized*'. However, the debugger
|
//called below with all arguments '*uninitialized*'. However, the debugger
|
||||||
//single-stepping just before the failing call correctly displays all the values.
|
//single-stepping just before the failing call correctly displays all the values.
|
||||||
|
if (strlen($bind_pw) > 0) {
|
||||||
$bind = ldap_bind($connect, $bind_dn, $bind_pw);
|
$bind = ldap_bind($connect, $bind_dn, $bind_pw);
|
||||||
if ($bind) {
|
if ($bind) {
|
||||||
|
//connected and authorized
|
||||||
$user_authorized = true;
|
$user_authorized = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
//connection failed
|
||||||
|
$user_authorized = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//password not provided
|
||||||
$user_authorized = false;
|
$user_authorized = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue