Skip to content

Commit

Permalink
Merge pull request #44055 from nextcloud/backport/44042/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(user_ldap): Early failure for empty password login attempt
  • Loading branch information
come-nc authored Mar 11, 2024
2 parents 50e8eee + 7fc5a15 commit 6ab0992
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1593,17 +1593,15 @@ public function getFilterForUserCount(): string {
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;
Expand Down

0 comments on commit 6ab0992

Please sign in to comment.