Skip to content

Commit 3ee2f1c

Browse files
author
Robin Kluth
committed
* fix: The single valued attributes werent populated if no users was being searched, so we move the population to the main login.
1 parent 8375c04 commit 3ee2f1c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/LdapAuth.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,18 @@ public function login($username, $password, $domainKey = false, $fetchUserDN = f
313313
$this->_singleValuedAttrs[$domainData['hostname']] = [];
314314
Yii::info("Getting attribute type definitions for this domain!", __METHOD__);
315315

316-
$result = @ldap_read($this->_l, '', "(objectClass=*)", ["subschemaSubentry"]);
316+
$result = @ldap_read($l, '', "(objectClass=*)", ["subschemaSubentry"]);
317317
if ($result) {
318-
$subSchema = ldap_get_entries($this->_l, $result);
318+
$subSchema = ldap_get_entries($l, $result);
319319
Yii::debug("Subschema entry:", __METHOD__);
320320
Yii::debug($subSchema, __METHOD__);
321321

322322
if (isset($subSchema[0]['subschemasubentry'][0])) {
323323

324-
$result = @ldap_read($this->_l, $subSchema[0]['subschemasubentry'][0], "(objectClass=*)", ["attributeTypes"]);
324+
$result = @ldap_read($l, $subSchema[0]['subschemasubentry'][0], "(objectClass=*)", ["attributeTypes"]);
325325

326326
if ($result) {
327-
$entries = ldap_get_entries($this->_l, $result);
327+
$entries = ldap_get_entries($l, $result);
328328
foreach ($entries[0]['attributetypes'] as $key => $definition) {
329329
if (stripos($definition, 'SINGLE-VALUE') !== false) {
330330
$match = preg_match("/NAME ['\"](.*?)['\"]/", $definition, $matches);
@@ -334,13 +334,13 @@ public function login($username, $password, $domainKey = false, $fetchUserDN = f
334334
}
335335
}
336336
} else {
337-
Yii::warning("Could not read attribute Types" . ldap_error($this->_l), __METHOD__);
337+
Yii::warning("Could not read attribute Types" . ldap_error($l), __METHOD__);
338338
}
339339
} else {
340340
Yii::warning("No subschema entry found!", __METHOD__);
341341
}
342342
} else {
343-
Yii::warning("Could not read subschema entry: " . ldap_error($this->_l), __METHOD__);
343+
Yii::warning("Could not read subschema entry: " . ldap_error($l), __METHOD__);
344344
}
345345
Yii::debug("Single-Value Attributes now: ", __METHOD__);
346346
Yii::debug($this->_singleValuedAttrs, __METHOD__);

0 commit comments

Comments
 (0)