mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(user_ldap): Early failure for empty password login attempt
This avoids user_ldap logging about an invalid configuration with an empty password when the empty password actually comes from a login attempt. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
321240d247
commit
71e2af3d97
1 changed files with 5 additions and 7 deletions
|
|
@ -1574,17 +1574,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