From a3650e1477f8e464bd2d4600ffacab0666053f22 Mon Sep 17 00:00:00 2001 From: "J.P. Pasnak" Date: Sat, 22 Nov 2025 21:30:07 -0600 Subject: [PATCH] Fix issue #28 - Grav username defaults to the LDAP users full DN Additional fix assignment operator bug in error handling --- login-ldap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/login-ldap.php b/login-ldap.php index 740a587..0819f50 100644 --- a/login-ldap.php +++ b/login-ldap.php @@ -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; }