mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #44055 from nextcloud/backport/44042/stable27
[stable27] fix(user_ldap): Early failure for empty password login attempt
This commit is contained in:
commit
6ab099297f
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