Commit 4c1e44e7597d37f5e06d49ac57b0590374b365c0

Authored by Neil Blakey-Milner
1 parent db33cb2b

If the LDAP entry has multiple values for an attribute, use the first

one.  Either way, log what we got from the server.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5247 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
... ... @@ -535,7 +535,12 @@ class KTLDAPBaseAuthenticator extends Authenticator {
535 535 $aAttr = $oEntry->attributes();
536 536 $aAttr['dn'] = $oEntry->dn();
537 537  
  538 + global $default;
538 539 foreach ($aAttr as $k => $v) {
  540 + $default->log->info(sprintf("LDAP: For DN %s, attribute %s value is %s", $dn, $k, print_r($v, true)));
  541 + if (is_array($v)) {
  542 + $v = array_shift($v);
  543 + }
539 544 $aRet[strtolower($k)] = $v;
540 545 }
541 546 return $aRet;
... ...