PHP Class BookStack\Services\Ldap

Allows the standard LDAP functions to be mocked for testing.
Show file Open project: ssddanbrown/bookstack

Public Methods

Method Description
bind ( resource $ldapConnection, string $bindRdn = null, string $bindPassword = null ) : boolean Bind to LDAP directory.
connect ( string $hostName, integer $port ) : resource Connect to a LDAP server.
getEntries ( resource $ldapConnection, resource $ldapSearchResult ) : array Get entries from an ldap search result.
search ( resource $ldapConnection, string $baseDn, string $filter, array $attributes = null ) : resource Search LDAP tree using the provided filter.
searchAndGetEntries ( resource $ldapConnection, string $baseDn, string $filter, array $attributes = null ) : resource Search and get entries immediately.
setOption ( resource $ldapConnection, integer $option, mixed $value ) : boolean Set the value of a LDAP option for the given connection.
setVersion ( $ldapConnection, $version ) : boolean Set the version number for the given ldap connection.

Method Details

bind() public method

Bind to LDAP directory.
public bind ( resource $ldapConnection, string $bindRdn = null, string $bindPassword = null ) : boolean
$ldapConnection resource
$bindRdn string
$bindPassword string
return boolean

connect() public method

Connect to a LDAP server.
public connect ( string $hostName, integer $port ) : resource
$hostName string
$port integer
return resource

getEntries() public method

Get entries from an ldap search result.
public getEntries ( resource $ldapConnection, resource $ldapSearchResult ) : array
$ldapConnection resource
$ldapSearchResult resource
return array

searchAndGetEntries() public method

Search and get entries immediately.
public searchAndGetEntries ( resource $ldapConnection, string $baseDn, string $filter, array $attributes = null ) : resource
$ldapConnection resource
$baseDn string
$filter string
$attributes array
return resource

setOption() public method

Set the value of a LDAP option for the given connection.
public setOption ( resource $ldapConnection, integer $option, mixed $value ) : boolean
$ldapConnection resource
$option integer
$value mixed
return boolean

setVersion() public method

Set the version number for the given ldap connection.
public setVersion ( $ldapConnection, $version ) : boolean
$ldapConnection
$version
return boolean