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:
J.P. Pasnak
2025-11-22 21:30:07 -06:00
committed by GitHub
parent a3f0a2cf88
commit a3650e1477

View File

@@ -131,7 +131,7 @@ class LoginLDAPPlugin extends Plugin
$ldap->bind($username, $credentials['password']);
// 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
$grav_user['login'] = $credentials['username'];
@@ -258,7 +258,7 @@ class LoginLDAPPlugin extends Plugin
$this->grav['log']->error('plugin.login-ldap: ['. $e->getCode() . '] ' . $username . ' - ' . $message);
// Just return so other authenticators can take a shot...
if ($message = "Invalid credentials") {
if ($message == "Invalid credentials") {
return;
}