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

Add possibility of 'dn' attribute & fix defaultQueryFields assignment loc #14

Merged
merged 2 commits into from
Apr 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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