API Documentation

Auth/Adapter/Ldap.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Auth  
subpackage
Zend_Auth_Adapter  
version
$Id: Ldap.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Auth_Adapter_Ldap

Implements
\Zend_Auth_Adapter_Interface
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Auth  
subpackage
Zend_Auth_Adapter  

Properties

Propertyprotectedstring  $_authenticatedDn= 'null'

The DN of the authenticated account. Used to retrieve the account entry on request.

Default valuenullDetails
Type
string
Propertyprotected\Zend_Ldap  $_ldap= 'null'

The Zend_Ldap context.

Default valuenullDetails
Type
\Zend_Ldap
Propertyprotectedarray  $_options= 'null'

The array of arrays of Zend_Ldap options passed to the constructor.

Default valuenullDetails
Type
array
Propertyprotectedstring  $_password= 'null'

The password of the account being authenticated.

Default valuenullDetails
Type
string
Propertyprotectedstring  $_username= 'null'

The username of the account being authenticated.

Default valuenullDetails
Type
string

Methods

methodpublic__construct( array $options = array, string $username = null, string $password = null ) : void

Constructor

Parameters
Name Type Description
$options array An array of arrays of Zend_Ldap options
$username string The username of the account being authenticated
$password string The password of the account being authenticated
methodprotected_checkGroupMembership( \Zend_Ldap $ldap, string $canonicalName, string $dn, array $adapterOptions ) : string|true

Checks the group membership of the bound user

Parameters
Name Type Description
$ldap \Zend_Ldap
$canonicalName string
$dn string
$adapterOptions array
Returns
Type Description
stringtrue
methodprotected_getAuthorityName( ) : string

Returns a domain name for the current LDAP options. This is used for skipping redundant operations (e.g. authentications).

Returns
Type Description
string
methodprivate_optionsToString( array $options ) : string

Converts options to string

Parameters
Name Type Description
$options array
Returns
Type Description
string
methodprotected_prepareOptions( \Zend_Ldap $ldap, array $options ) : array

Sets the LDAP specific options on the Zend_Ldap instance

Parameters
Name Type Description
$ldap \Zend_Ldap
$options array
Returns
Type Description
array of auth-adapter specific options
methodpublicauthenticate( ) : \Zend_Auth_Result

Authenticate the user

Returns
Type Description
\Zend_Auth_Result
Throws
Exception Description
\Zend_Auth_Adapter_Exception
methodpublicgetAccountObject( array $returnAttribs = array, array $omitAttribs = array ) : \stdClass|boolean

getAccountObject() - Returns the result entry as a stdClass object

This resembles the feature {@see Zend_Auth_Adapter_DbTable::getResultRowObject()}. Closes ZF-6813

Parameters
Name Type Description
$returnAttribs array
$omitAttribs array
Returns
Type Description
\stdClassboolean
methodpublicgetLdap( ) : \Zend_Ldap

Returns the LDAP Object

Returns
Type Description
\Zend_Ldap The Zend_Ldap object used to authenticate the credentials
methodpublicgetOptions( ) : array|null

Returns the array of arrays of Zend_Ldap options of this adapter.

Returns
Type Description
arraynull
methodpublicgetPassword( ) : string|null

Returns the password of the account being authenticated, or NULL if none is set.

Returns
Type Description
stringnull
methodpublicgetUsername( ) : string|null

Returns the username of the account being authenticated, or NULL if none is set.

Returns
Type Description
stringnull
methodpublicsetCredential( string $credential ) : \Zend_Auth_Adapter_Ldap

setCredential() - set the credential (password) value to be used

Proxies to {@see setPassword()}

Closes ZF-6813

Parameters
Name Type Description
$credential string
Returns
Type Description
\Zend_Auth_Adapter_Ldap Provides a fluent interface
methodpublicsetIdentity( string $identity ) : \Zend_Auth_Adapter_Ldap

setIdentity() - set the identity (username) to be used

Proxies to {@see setUsername()}

Closes ZF-6813

Parameters
Name Type Description
$identity string
Returns
Type Description
\Zend_Auth_Adapter_Ldap Provides a fluent interface
methodpublicsetLdap( \Zend_Ldap $ldap ) : \Zend_Auth_Adapter_Ldap

Set an Ldap connection

Parameters
Name Type Description
$ldap \Zend_Ldap An existing Ldap object
Returns
Type Description
\Zend_Auth_Adapter_Ldap Provides a fluent interface
methodpublicsetOptions( array $options ) : \Zend_Auth_Adapter_Ldap

Sets the array of arrays of Zend_Ldap options to be used by this adapter.

Parameters
Name Type Description
$options array The array of arrays of Zend_Ldap options
Returns
Type Description
\Zend_Auth_Adapter_Ldap Provides a fluent interface
methodpublicsetPassword( string $password ) : \Zend_Auth_Adapter_Ldap

Sets the passwort for the account

Parameters
Name Type Description
$password string The password of the account being authenticated
Returns
Type Description
\Zend_Auth_Adapter_Ldap Provides a fluent interface
methodpublicsetUsername( string $username ) : \Zend_Auth_Adapter_Ldap

Sets the username for binding

Parameters
Name Type Description
$username string The username for binding
Returns
Type Description
\Zend_Auth_Adapter_Ldap Provides a fluent interface
Documentation was generated by DocBlox 0.13.3.