Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(user_ldap): Early failure for empty password login attempt #44056

Merged
merged 1 commit into from Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions apps/user_ldap/lib/Access.php
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