PHP Класс Scalr\Net\Ldap\LdapClient

С версии: 06.06.2013
Автор: Vitaliy Demidov ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Scalr\Net\Ldap\LdapConfig $config, string $username, string $password, $uid = null ) Constructor
__destruct ( ) Destructor
__sleep ( )
__wakeup ( )
clearLog ( ) Clears log
escape ( string $string ) : string Escapes query string
getConfig ( ) : Scalr\Net\Ldap\LdapConfig Gets LdapConfig
getEmail ( ) : string Gets the user email
getFullName ( ) : string Gets the user's full name
getGroupsDetails ( array $groups ) : array Retrieves information (for now only displayname/description) about groups from LDAP
getLdapError ( ) : string Gets last LDAP error
getLog ( ) : string Gets log
getUserGroups ( ) : array Gets the list of the groups in which specified user has memberships.
getUsername ( ) : string Gets username
isValidUser ( ) : boolean Checks is this user can be authenticated to LDAP
isValidUsername ( ) : boolean Checks if the username exists in the LDAP
realEscape ( string $string ) : string Escapes query string including asterisk and parentheses
unbind ( ) : boolean Unbinds LDAP connection

Защищенные методы

Метод Описание
bindRdn ( string $username = null, string $password = null ) : boolean Binds to the LDAP directory with specified RDN and password.
getConnection ( ) : resource Gets LDAP connection link identifier
log ( string $format, mixed $args = null, mixed $_ = null ) Adds formatted string to log output

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Scalr\Net\Ldap\LdapConfig $config, string $username, string $password, $uid = null )
$config Scalr\Net\Ldap\LdapConfig LDAP config
$username string LDAP rdn to check. It should look like [email protected]
$password string LDAP password for the specified user

__destruct() публичный Метод

Destructor
public __destruct ( )

__sleep() публичный Метод

public __sleep ( )

__wakeup() публичный Метод

public __wakeup ( )

bindRdn() защищенный Метод

Binds to the LDAP directory with specified RDN and password.
protected bindRdn ( string $username = null, string $password = null ) : boolean
$username string RDN
$password string Password
Результат boolean Returns TRUE on success or FALSE otherwise

clearLog() публичный Метод

Clears log
public clearLog ( )

escape() публичный статический Метод

Escapes query string
public static escape ( string $string ) : string
$string string The query string
Результат string

getConfig() публичный Метод

Gets LdapConfig
public getConfig ( ) : Scalr\Net\Ldap\LdapConfig
Результат Scalr\Net\Ldap\LdapConfig Returns LdapConfig instance

getConnection() защищенный Метод

Gets LDAP connection link identifier
protected getConnection ( ) : resource
Результат resource Returns LDAP connection link edentifier

getEmail() публичный Метод

Gets the user email
public getEmail ( ) : string
Результат string Returns user email address

getFullName() публичный Метод

Gets the user's full name
public getFullName ( ) : string
Результат string Returns user's full name

getGroupsDetails() публичный Метод

Retrieves information (for now only displayname/description) about groups from LDAP
public getGroupsDetails ( array $groups ) : array
$groups array List of group ids
Результат array Returns array of groups with their description

getLdapError() публичный Метод

Gets last LDAP error
public getLdapError ( ) : string
Результат string

getLog() публичный Метод

Gets log
public getLog ( ) : string
Результат string Returns the log output

getUserGroups() публичный Метод

Gets the list of the groups in which specified user has memberships.
public getUserGroups ( ) : array
Результат array Returns array of the sAMAccount name of the Groups

getUsername() публичный Метод

Gets username
public getUsername ( ) : string
Результат string Returns username which should look like [email protected]

isValidUser() публичный Метод

Checks is this user can be authenticated to LDAP
public isValidUser ( ) : boolean
Результат boolean Returns true on success or false otherwise

isValidUsername() публичный Метод

Checks if the username exists in the LDAP
public isValidUsername ( ) : boolean
Результат boolean Returns true on success or false if user does not exist

log() защищенный Метод

Adds formatted string to log output
protected log ( string $format, mixed $args = null, mixed $_ = null )
$format string format string. see sprintf rules
$args mixed optional argument 1
$_ mixed optional argument list

realEscape() публичный статический Метод

Escapes query string including asterisk and parentheses
public static realEscape ( string $string ) : string
$string string The query string
Результат string

unbind() публичный Метод

Unbinds LDAP connection
public unbind ( ) : boolean
Результат boolean