Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from wunc/master
Browse files Browse the repository at this point in the history
Add possibility of 'dn' attribute & fix defaultQueryFields assignment loc
  • Loading branch information
stevebauman committed Apr 20, 2015
2 parents 1ed2895 + f443023 commit 6cfa70f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Adldap/Classes/AdldapUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ public function info($username, array $fields = array(), $isGUID = false)

$this->adldap->utilities()->validateLdapIsBound();

// Make sure we assign the default fields if none are given
if (count($fields) === 0) $fields = $this->defaultQueryFields;

$personCategory = $this->adldap->getPersonFilter('category');
$person = $this->adldap->getPersonFilter('person');

Expand All @@ -222,9 +225,6 @@ public function info($username, array $fields = array(), $isGUID = false)
->select($fields)
->where($personCategory, '=', $person);

// Make sure we assign the default fields if none are given
if (count($fields) === 0) $fields = $this->defaultQueryFields;

if ($isGUID === true)
{
$search->where('objectguid', '=', $username);
Expand Down
4 changes: 2 additions & 2 deletions src/Adldap/Objects/LdapEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public function applyGenericAttributes(array $attributes = array())
}

// Does the entry contain a distinguished name?
if(array_key_exists('distinguishedname', $attributes))
if(array_key_exists('dn', $attributes) || array_key_exists('distinguishedname', $attributes))
{
$dn = $attributes['distinguishedname'][0];
$dn = (array_key_exists('dn', $attributes)) ? $attributes['dn'] : $attributes['distinguishedname'][0];

// We'll assign the string distinguished name
$this->setAttribute('dn', $dn);
Expand Down

0 comments on commit 6cfa70f

Please sign in to comment.