aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-03-12 10:24:21 +0100
committerGitHub <noreply@github.com>2024-03-12 10:24:21 +0100
commit7d58ae3ac844663f0ff97d91df21c4fcd1b20d7a (patch)
tree5dc4b0bcf3aba486e97f1d66154ddcd032a7489f /apps/user_ldap
parent2fea1bb5438e9f197e836fcddaf73e0c17171816 (diff)
parentc26685a4df29c47e7be411e71e8dffcb59ccb11b (diff)
downloadnextcloud-server-7d58ae3ac844663f0ff97d91df21c4fcd1b20d7a.tar.gz
nextcloud-server-7d58ae3ac844663f0ff97d91df21c4fcd1b20d7a.zip
Merge pull request #44056 from nextcloud/backport/44042/stable28
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Access.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index e608d5f80f0..b6c5386fe62 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -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;