Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
come-nc authored and backportbot[bot] committed Mar 7, 2024
commit 7fc5a154847b3fe7500c7b92b1a20431b4bfd3c1
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