No need to try checking for LDAPAUTH_USERNAME_FIELD without lowercasing. PHP manual confirms array index is always lower case
This commit is contained in:
parent
a7fe07614a
commit
7c1f6be501
@ -148,11 +148,8 @@ function ldapauth_is_valid_user( $value ) {
|
|||||||
if (!$in_group) die('Not in admin group');
|
if (!$in_group) die('Not in admin group');
|
||||||
}
|
}
|
||||||
|
|
||||||
$username = $searchResult[0][LDAPAUTH_USERNAME_FIELD][0];
|
// attribute index returned by ldap_get_entries is lowercased (http://php.net/manual/en/function.ldap-get-entries.php)
|
||||||
if (empty($username)) {
|
|
||||||
// try with it lower cased
|
|
||||||
$username = $searchResult[0][strtolower(LDAPAUTH_USERNAME_FIELD)][0];
|
$username = $searchResult[0][strtolower(LDAPAUTH_USERNAME_FIELD)][0];
|
||||||
}
|
|
||||||
yourls_set_user($username);
|
yourls_set_user($username);
|
||||||
|
|
||||||
if (LDAPAUTH_ADD_NEW && !array_key_exists($username, $yourls_user_passwords)) {
|
if (LDAPAUTH_ADD_NEW && !array_key_exists($username, $yourls_user_passwords)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user