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

Commit

Permalink
Merge pull and update readme with breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Apr 15, 2015
1 parent f7b4b75 commit 29b21eb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ instead of returning false
instead of returning false
- If LDAP is not bound when running query methods (such as `$adLDAP->search()`) then an `adLDAPException` will be thrown instead
of previously returning false.



The arguments for finding a user has been changed from:

$adldap->user()->find($includeDescription = false, $searchField = false, $searchFilter = false, $sorted = true)

To:

$adldap->user()->find($includeDescription = false, $searchArray = array(), $sorted = true))

This allows you to search for multiple parameters when looking for a user. [Thanks To](https://github.com/adldap/adLDAP/pull/17)
12 changes: 7 additions & 5 deletions src/Adldap/Classes/AdldapUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,21 +624,23 @@ public function usernameToGuid($username)
* Return a list of all users in AD that have a specific value in a field
*
* @param bool $includeDescription Return a description of the user
* @param bool $searchField Field to search search for
* @param bool $searchFilter Value to search for in the specified field
* @param array $searchArray Fields to search for
* @param bool $sorted Sort the user accounts
* @return array|bool
*/
public function find($includeDescription = false, $searchField = false, $searchFilter = false, $sorted = true)
public function find($includeDescription = false, $searchArray = array(), $sorted = true)
{
$this->adldap->utilities()->validateLdapIsBound();

// Perform the search and grab all their details
$searchParams = "";

if ($searchField)
if (is_array($searchArray) && count($searchArray) > 0)
{
$searchParams = "(" . $searchField . "=" . $searchFilter . ")";
foreach($searchArray as $field => $filter)
{
$searchParams .= "(" . $field . "=" . $filter . ")";
}
}

$filter = "(&(objectClass=user)(samaccounttype=" . Adldap::ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)" . $searchParams . ")";
Expand Down

0 comments on commit 29b21eb

Please sign in to comment.