PHP Класс LdapTools\LdapManager

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

Защищенные свойства (Protected)

Свойство Тип Описание
$cache LdapTools\Cache\CacheInterface
$config The main configuration for the library.
$connections An array of "domain name" => "LdapConnection" pairs.
$context The current domain in focus for calls to this class.
$domains An array of "domain name" => "DomainConfiguration" pairs.
$ldapObjectManager LdapTools\Object\LdapObjectManager[]
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory
$schemaParser LdapTools\Schema\Parser\SchemaParserInterface

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

Метод Описание
__construct ( Configuration $config, variadic $connections )
addConnection ( variadic $connections ) Explicitly add connections using already constructed connection objects.
authenticate ( string $user, string $password, boolean | string &$errorMessage = false, boolean | string &$errorNumber = false ) : boolean A shorthand method for verifying a username/password combination against LDAP. Optionally you can pass a variable to store the error message or error number returned from LDAP for more detailed information on authentication failures.
buildLdapQuery ( ) : LdapQueryBuilder Get a LdapQueryBuilder object.
createLdapObject ( string | null $type = null ) : LdapObjectCreator Get a LdapObjectCreator object.
createLdif ( ) : Ldif Get a LDIF object to help build a LDIF file.
delete ( LdapObject $ldapObject, boolean $recursively = false ) Delete an object from LDAP. Optionally you can set the second argument to true which sends a control to LDAP to perform a recursive deletion. This is helpful in the case of deleting an OU with with objects underneath it. By setting the second parameter to true the OU and all objects below it would be deleted. Use with care!
getCache ( ) : LdapTools\Cache\CacheInterface Retrieve the cache instance.
getConnection ( null | string $domain = null ) : LdapTools\Connection\LdapConnectionInterface Get the Ldap Connection object. By default it will get the connection of the domain currently in context. To get a different domain connection pass the domain name as a parameter.
getDomainContext ( ) : string Get the domain name currently being used.
getDomains ( ) : string[] Get all of the domain names that are loaded.
getEventDispatcher ( ) : LdapTools\Event\EventDispatcherInterface | null Get the event dispatcher instance.
getRepository ( string $type ) : LdapObjectRepository Get a repository for a specific LDAP object type.
getSchemaFactory ( ) : LdapObjectSchemaFactory Retrieve the schema factory instance.
getSchemaParser ( ) : LdapTools\Schema\Parser\SchemaParserInterface Retrieve the schema parser instance.
move ( LdapObject $ldapObject, string $container ) Move an object in LDAP from one container/OU to another.
persist ( LdapObject $ldapObject ) Sends a LdapObject back to LDAP so the changes can be written to the directory.
restore ( LdapObject $ldapObject, string | null $container = null ) Restore a deleted LDAP object. Optionally specify where to restore it to (full DN of a container/OU).
switchDomain ( string $domain ) Switch the context of the LdapManager by passing a domain name (ie. 'example.local').

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

Метод Описание
getLdapObjectSchema ( string $type ) : LdapObjectSchema Get the LDAP object schema from the factory by its type.
getObjectManager ( ) : LdapObjectManager Retrieve the LdapObjectManager for the current domain context.
registerAttributeConverters ( array $attributeConverters ) Register any explicitly defined converters.
validateDomainName ( string $domain ) Validates that the domain name actually exists.

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

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

public __construct ( Configuration $config, variadic $connections )
$config Configuration
$connections variadic

addConnection() публичный метод

Explicitly add connections using already constructed connection objects.
public addConnection ( variadic $connections )
$connections variadic

authenticate() публичный метод

A shorthand method for verifying a username/password combination against LDAP. Optionally you can pass a variable to store the error message or error number returned from LDAP for more detailed information on authentication failures.
public authenticate ( string $user, string $password, boolean | string &$errorMessage = false, boolean | string &$errorNumber = false ) : boolean
$user string
$password string
$errorMessage boolean | string Optionally, this will store the LDAP error message on failure.
$errorNumber boolean | string Optionally, this will store the LDAP error number on failure.
Результат boolean

buildLdapQuery() публичный метод

Get a LdapQueryBuilder object.
public buildLdapQuery ( ) : LdapQueryBuilder
Результат LdapTools\Query\LdapQueryBuilder

createLdapObject() публичный метод

Get a LdapObjectCreator object.
public createLdapObject ( string | null $type = null ) : LdapObjectCreator
$type string | null
Результат LdapTools\Object\LdapObjectCreator

createLdif() публичный метод

Get a LDIF object to help build a LDIF file.
public createLdif ( ) : Ldif
Результат LdapTools\Ldif\Ldif

delete() публичный метод

If recursive deletion does not work, first check that 'accidental deletion' is not enabled on the object (AD).
public delete ( LdapObject $ldapObject, boolean $recursively = false )
$ldapObject LdapTools\Object\LdapObject
$recursively boolean

getCache() публичный метод

Retrieve the cache instance.
public getCache ( ) : LdapTools\Cache\CacheInterface
Результат LdapTools\Cache\CacheInterface

getConnection() публичный метод

Get the Ldap Connection object. By default it will get the connection of the domain currently in context. To get a different domain connection pass the domain name as a parameter.
public getConnection ( null | string $domain = null ) : LdapTools\Connection\LdapConnectionInterface
$domain null | string
Результат LdapTools\Connection\LdapConnectionInterface

getDomainContext() публичный метод

Get the domain name currently being used.
public getDomainContext ( ) : string
Результат string

getDomains() публичный метод

Get all of the domain names that are loaded.
public getDomains ( ) : string[]
Результат string[]

getEventDispatcher() публичный метод

Get the event dispatcher instance.
public getEventDispatcher ( ) : LdapTools\Event\EventDispatcherInterface | null
Результат LdapTools\Event\EventDispatcherInterface | null

getLdapObjectSchema() защищенный метод

Get the LDAP object schema from the factory by its type.
protected getLdapObjectSchema ( string $type ) : LdapObjectSchema
$type string
Результат LdapTools\Schema\LdapObjectSchema

getObjectManager() защищенный метод

Retrieve the LdapObjectManager for the current domain context.
protected getObjectManager ( ) : LdapObjectManager
Результат LdapTools\Object\LdapObjectManager

getRepository() публичный метод

Get a repository for a specific LDAP object type.
public getRepository ( string $type ) : LdapObjectRepository
$type string
Результат LdapTools\Object\LdapObjectRepository

getSchemaFactory() публичный метод

Retrieve the schema factory instance.
public getSchemaFactory ( ) : LdapObjectSchemaFactory
Результат LdapTools\Factory\LdapObjectSchemaFactory

getSchemaParser() публичный метод

Retrieve the schema parser instance.
public getSchemaParser ( ) : LdapTools\Schema\Parser\SchemaParserInterface
Результат LdapTools\Schema\Parser\SchemaParserInterface

move() публичный метод

Move an object in LDAP from one container/OU to another.
public move ( LdapObject $ldapObject, string $container )
$ldapObject LdapTools\Object\LdapObject
$container string The container/OU in DN format.

persist() публичный метод

Sends a LdapObject back to LDAP so the changes can be written to the directory.
public persist ( LdapObject $ldapObject )
$ldapObject LdapTools\Object\LdapObject

registerAttributeConverters() защищенный метод

Register any explicitly defined converters.
protected registerAttributeConverters ( array $attributeConverters )
$attributeConverters array

restore() публичный метод

Restore a deleted LDAP object. Optionally specify where to restore it to (full DN of a container/OU).
public restore ( LdapObject $ldapObject, string | null $container = null )
$ldapObject LdapTools\Object\LdapObject
$container string | null The container/OU in DN format of where it should be restored to.

switchDomain() публичный метод

Switch the context of the LdapManager by passing a domain name (ie. 'example.local').
public switchDomain ( string $domain )
$domain string

validateDomainName() защищенный метод

Validates that the domain name actually exists.
protected validateDomainName ( string $domain )
$domain string

Описание свойств

$cache защищенное свойство

protected CacheInterface,LdapTools\Cache $cache
Результат LdapTools\Cache\CacheInterface

$config защищенное свойство

The main configuration for the library.
protected $config

$connections защищенное свойство

An array of "domain name" => "LdapConnection" pairs.
protected $connections

$context защищенное свойство

The current domain in focus for calls to this class.
protected $context

$domains защищенное свойство

An array of "domain name" => "DomainConfiguration" pairs.
protected $domains

$ldapObjectManager защищенное свойство

protected LdapObjectManager[],LdapTools\Object $ldapObjectManager
Результат LdapTools\Object\LdapObjectManager[]

$schemaFactory защищенное свойство

protected LdapObjectSchemaFactory,LdapTools\Factory $schemaFactory
Результат LdapTools\Factory\LdapObjectSchemaFactory

$schemaParser защищенное свойство

protected SchemaParserInterface,LdapTools\Schema\Parser $schemaParser
Результат LdapTools\Schema\Parser\SchemaParserInterface