diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-03-11 11:44:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 11:44:17 +0100 |
commit | 6ab099297fccc807643121bc9ba9af8d69f3d3ef (patch) | |
tree | 773d5d87c49f6ea85b6bbc4967572109a5039748 /apps | |
parent | 50e8eee022e6cfbf8f14e96199e01271b84b9b1e (diff) | |
parent | 7fc5a154847b3fe7500c7b92b1a20431b4bfd3c1 (diff) | |
download | nextcloud-server-6ab099297fccc807643121bc9ba9af8d69f3d3ef.tar.gz nextcloud-server-6ab099297fccc807643121bc9ba9af8d69f3d3ef.zip |
Merge pull request #44055 from nextcloud/backport/44042/stable27
[stable27] fix(user_ldap): Early failure for empty password login attempt
Diffstat (limited to 'apps')
-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 47f03cfa0e9..bd6a48813ce 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; |