diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-03-07 10:58:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 10:58:23 +0100 |
commit | 75fc1a3967815cd1fbba31305855d83ea081da59 (patch) | |
tree | 0fcc8280269908ea797d0f568b6ef36730b7754c | |
parent | 7033967115ae7f5e5be8551f0530143d5b1a7885 (diff) | |
parent | 2874dff773691111b7d2b38540a160c15e874ed5 (diff) | |
download | nextcloud-server-75fc1a3967815cd1fbba31305855d83ea081da59.tar.gz nextcloud-server-75fc1a3967815cd1fbba31305855d83ea081da59.zip |
Merge pull request #44042 from nextcloud/fix/fix-erronous-log-on-login-attempt-with-no-password
fix(user_ldap): Early failure for empty password login attempt
-rw-r--r-- | apps/user_ldap/lib/Access.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 70f9e1411b1..3a1690c3b76 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -1593,17 +1593,15 @@ class Access extends LDAPUtility { return $filter; } - /** - * @param string $name - * @param string $password - * @return bool - */ - public function areCredentialsValid($name, $password) { + public function areCredentialsValid(string $name, string $password): bool { + if ($name === '' || $password === '') { + return false; + } $name = $this->helper->DNasBaseParameter($name); $testConnection = clone $this->connection; $credentials = [ 'ldapAgentName' => $name, - 'ldapAgentPassword' => $password + 'ldapAgentPassword' => $password, ]; if (!$testConnection->setConfiguration($credentials)) { return false; |