Inheritances
Files
Overview
FRAMES
NO FRAMES

Class Zend_Auth_Adapter_Ldap

Zend_Auth
|-Zend_Auth_Zend_Auth_Adapter
|- class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
Defined in line 35 of file Auth/Adapter/Ldap.php.
CategoryZend
PackageZend_Auth
SubpackageZend_Auth_Adapter
CopyrightCopyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
Licensehttp://framework.zend.com/license/new-bsd New BSD License

Summary

Instance fields
# $_authenticatedDn The DN of the authenticated account
# $_ldap The Zend_Ldap context
# $_options The array of arrays of Zend_Ldap options passed to the constructor
# $_password The password of the account being authenticated
# $_username The username of the account being authenticated
Instance methods
+ __construct() Constructor
# _checkGroupMembership() Checks the group membership of the bound user
# _getAuthorityName() Returns a domain name for the current LDAP options
- _optionsToString() Converts options to string
# _prepareOptions() Sets the LDAP specific options on the Zend_Ldap instance
+ authenticate() Authenticate the user
+ getAccountObject() getAccountObject() - Returns the result entry as a stdClass object
+ getLdap() Returns the LDAP Object
+ getOptions() Returns the array of arrays of Zend_Ldap options of this adapter
+ getPassword() Returns the password of the account being authenticated, or
+ getUsername() Returns the username of the account being authenticated, or
+ setCredential() setCredential() - set the credential (password) value to be used
+ setIdentity() setIdentity() - set the identity (username) to be used
+ setLdap() Set an Ldap connection
+ setOptions() Sets the array of arrays of Zend_Ldap options to be used by
+ setPassword() Sets the passwort for the account
+ setUsername() Sets the username for binding

Details

Instance fields

$_authenticatedDn
protected $_authenticatedDn = null
The DN of the authenticated account. Used to retrieve the account entry on request.
Var string
$_ldap
protected $_ldap = null
The Zend_Ldap context.
$_options
protected $_options = null
The array of arrays of Zend_Ldap options passed to the constructor.
Var array
$_password
protected $_password = null
The password of the account being authenticated.
Var string
$_username
protected $_username = null
The username of the account being authenticated.
Var string

Instance methods

__construct()
public function __construct( array $options = array()
$username = null
$password = null
)
Constructor
Parameters
array $options
string $username The username of the account being authenticated
string $password The password of the account being authenticated
Returns void
_checkGroupMembership()
protected function _checkGroupMembership( Zend_Ldap $ldap
$canonicalName
$dn
array $adapterOptions
)
Checks the group membership of the bound user
Parameters
Zend_Ldap $ldap
string $canonicalName
string $dn
array $adapterOptions
Returns string|true
_getAuthorityName()
protected function _getAuthorityName( )
Returns a domain name for the current LDAP options. This is used
for skipping redundant operations (e.g. authentications).
Returns string
_optionsToString()
private function _optionsToString( array $options)
Converts options to string
Parameters
array $options
Returns string
_prepareOptions()
protected function _prepareOptions( Zend_Ldap $ldap
array $options
)
Sets the LDAP specific options on the Zend_Ldap instance
Parameters
Zend_Ldap $ldap
array $options
Returns array of auth-adapter specific options
authenticate()
public function authenticate( )
Authenticate the user
getAccountObject()
public function getAccountObject( array $returnAttribs = array())
getAccountObject() - Returns the result entry as a stdClass object

This ressembles the feature {@see Zend_Auth_Adapter_DbTable::getResultRowObject()}.
Closes ZF-6813
Parameters
array $returnAttribs
Returns stdClass|boolean
getLdap()
public function getLdap( )
Returns the LDAP Object
Returns Zend_Ldap The Zend_Ldap object used to authenticate the credentials
getOptions()
public function getOptions( )
Returns the array of arrays of Zend_Ldap options of this adapter.
Returns array|null
getPassword()
public function getPassword( )
Returns the password of the account being authenticated, or
NULL if none is set.
Returns string|null
getUsername()
public function getUsername( )
Returns the username of the account being authenticated, or
NULL if none is set.
Returns string|null
setCredential()
public function setCredential( $credential)
setCredential() - set the credential (password) value to be used

Proxies to {@see setPassword()}

Closes ZF-6813
Parameters
string $credential
Returns Zend_Auth_Adapter_Ldap Provides a fluent interface
setIdentity()
public function setIdentity( $identity)
setIdentity() - set the identity (username) to be used

Proxies to {@see setPassword()}

Closes ZF-6813
Parameters
string $identity
Returns Zend_Auth_Adapter_Ldap Provides a fluent interface
setLdap()
public function setLdap( Zend_Ldap $ldap)
Set an Ldap connection
Parameters
Zend_Ldap $ldap
Returns Zend_Auth_Adapter_Ldap Provides a fluent interface
setOptions()
public function setOptions( $options)
Sets the array of arrays of Zend_Ldap options to be used by
this adapter.
Parameters
array $options The array of arrays of Zend_Ldap options
Returns Zend_Auth_Adapter_Ldap Provides a fluent interface
setPassword()
public function setPassword( $password)
Sets the passwort for the account
Parameters
string $password The password of the account being authenticated
Returns Zend_Auth_Adapter_Ldap Provides a fluent interface
setUsername()
public function setUsername( $username)
Sets the username for binding
Parameters
string $username The username for binding
Returns Zend_Auth_Adapter_Ldap Provides a fluent interface