mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 07:13:23 -04:00
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
This commit is contained in:
commit
75fc1a3967
1 changed files with 5 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue