PHP 클래스 LdapTools\LdapManager

저자: Chad Sikorra ([email protected])
파일 보기 프로젝트 열기: ldaptools/ldaptools 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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