Fix issue #28 - Grav username defaults to the LDAP users full DN
Additional fix assignment operator bug in error handling
This commit is contained in:
@@ -131,7 +131,7 @@ class LoginLDAPPlugin extends Plugin
|
|||||||
$ldap->bind($username, $credentials['password']);
|
$ldap->bind($username, $credentials['password']);
|
||||||
|
|
||||||
// Create Grav User
|
// Create Grav User
|
||||||
$grav_user = User::load(strtolower($username));
|
$grav_user = User::load(strtolower($credentials['username']));
|
||||||
|
|
||||||
// Set defaults with only thing we know... username provided
|
// Set defaults with only thing we know... username provided
|
||||||
$grav_user['login'] = $credentials['username'];
|
$grav_user['login'] = $credentials['username'];
|
||||||
@@ -258,7 +258,7 @@ class LoginLDAPPlugin extends Plugin
|
|||||||
$this->grav['log']->error('plugin.login-ldap: ['. $e->getCode() . '] ' . $username . ' - ' . $message);
|
$this->grav['log']->error('plugin.login-ldap: ['. $e->getCode() . '] ' . $username . ' - ' . $message);
|
||||||
|
|
||||||
// Just return so other authenticators can take a shot...
|
// Just return so other authenticators can take a shot...
|
||||||
if ($message = "Invalid credentials") {
|
if ($message == "Invalid credentials") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user