Update plugin doc

This commit is contained in:
Frederic Guillot
2015-12-06 14:48:59 -05:00
parent 6d4286ec66
commit 70c65268fe
17 changed files with 380 additions and 59 deletions

View File

@@ -34,18 +34,18 @@ class User
}
/**
* Get user profile (helper)
* Get user profile
*
* @static
* @access public
* @param Client $client
* @param string $query
* @param string $username
* @return array
*/
public static function getUser(Client $client, $query)
public static function getUser(Client $client, $username)
{
$self = new self(new Query($client));
return $self->find($query);
return $self->find($self->getLdapUserPattern($username));
}
/**
@@ -204,4 +204,20 @@ class User
return LDAP_USER_BASE_DN;
}
/**
* Get LDAP user pattern
*
* @access public
* @param string $username
* @return string
*/
public function getLdapUserPattern($username)
{
if (! LDAP_USER_FILTER) {
throw new LogicException('LDAP user filter empty, check the parameter LDAP_USER_FILTER');
}
return sprintf(LDAP_USER_FILTER, $username);
}
}