Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ldap->user()->info($username, $fields) always returns "false" #114

Open
yarosdev opened this issue Jul 26, 2016 · 1 comment
Open

$ldap->user()->info($username, $fields) always returns "false" #114

yarosdev opened this issue Jul 26, 2016 · 1 comment

Comments

@yarosdev
Copy link

yarosdev commented Jul 26, 2016

$ldap->user()->info($username, $fields);
This method always returns false.

After removing "escape(value)" info method of user works fine

Adldap\Query\Builder line 235:
private function addWhere($field, $operator, $value = null)
{
    $this->wheres[] = [
        'field' => $field,
        'operator' => $this->getOperator($operator),
        'value' => $value,//$this->connection->escape($value),
    ];
}
@XONOSNET
Copy link

XONOSNET commented Nov 29, 2017

It doesn't return false. It returns an object, assuming that $fields is an array of valid attributes to filter.

ie:

$ldap = new adLDAP();
$userdata = $ldap->user()->info('john.doe',array('*'));
echo $userdata->displayName;
//Outputs: John Doe

With this being said, I used to (with older versions) be able to run the following:

$ldap = new adLDAP();
$userdata =  $ldap->user()->info('john.doe',array('*'));
echo '<pre>'.print_r(json_decode(json_encode($userdata[0])),1).'</pre>';

I would occasionally do this because the users in my network have hundreds of populated attributes and I often want running examples. Now, when I do this - I get a null result. Still trying to figure out what's changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants