Skip to content

Commit 6ab0992

Browse files
authored
Merge pull request #44055 from nextcloud/backport/44042/stable27
[stable27] fix(user_ldap): Early failure for empty password login attempt
2 parents 50e8eee + 7fc5a15 commit 6ab0992

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

apps/user_ldap/lib/Access.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,17 +1593,15 @@ public function getFilterForUserCount(): string {
15931593
return $filter;
15941594
}
15951595

1596-
/**
1597-
* @param string $name
1598-
* @param string $password
1599-
* @return bool
1600-
*/
1601-
public function areCredentialsValid($name, $password) {
1596+
public function areCredentialsValid(string $name, string $password): bool {
1597+
if ($name === '' || $password === '') {
1598+
return false;
1599+
}
16021600
$name = $this->helper->DNasBaseParameter($name);
16031601
$testConnection = clone $this->connection;
16041602
$credentials = [
16051603
'ldapAgentName' => $name,
1606-
'ldapAgentPassword' => $password
1604+
'ldapAgentPassword' => $password,
16071605
];
16081606
if (!$testConnection->setConfiguration($credentials)) {
16091607
return false;

0 commit comments

Comments
 (0)