Class humhub\modules\ldap\authclient\LdapAuth

Inheritancehumhub\modules\ldap\authclient\LdapAuth » humhub\modules\user\authclient\BaseFormAuth » humhub\modules\user\authclient\BaseClient » yii\authclient\BaseClient
Implementshumhub\modules\user\authclient\interfaces\ApprovalBypass, humhub\modules\user\authclient\interfaces\AutoSyncUsers, humhub\modules\user\authclient\interfaces\PrimaryClient, humhub\modules\user\authclient\interfaces\SyncAttributes
Available since version1.1

LDAP Authentication

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$autoRefreshUsers boolean|null humhub\modules\ldap\authclient\LdapAuth
$baseDn string The ldap base dn humhub\modules\ldap\authclient\LdapAuth
$bindPassword string humhub\modules\ldap\authclient\LdapAuth
$bindUsername string humhub\modules\ldap\authclient\LdapAuth
$byPassApproval humhub\modules\ldap\authclient\LdapAuth
$clientId string The auth client id humhub\modules\ldap\authclient\LdapAuth
$emailAttribute string The email attribute humhub\modules\ldap\authclient\LdapAuth
$hostname string humhub\modules\ldap\authclient\LdapAuth
$idAttribute string Attribute name to identify node humhub\modules\ldap\authclient\LdapAuth
$login humhub\modules\user\models\forms\Login The login form model humhub\modules\user\authclient\BaseFormAuth
$loginFilter string The login filter humhub\modules\ldap\authclient\LdapAuth
$networkTimeout integer The value for network timeout when connect to the LDAP server. humhub\modules\ldap\authclient\LdapAuth
$port integer 389 humhub\modules\ldap\authclient\LdapAuth
$syncUserTableAttributes array Of attributes which are synced with the user table humhub\modules\ldap\authclient\LdapAuth
$useSsl boolean humhub\modules\ldap\authclient\LdapAuth
$useStartTls boolean humhub\modules\ldap\authclient\LdapAuth
$userFilter string The ldap query to find humhub users humhub\modules\ldap\authclient\LdapAuth
$usernameAttribute string The ldap username attribute humhub\modules\ldap\authclient\LdapAuth


Hide inherited events

EventTypeDescriptionDefined By
EVENT_CREATE_USER \humhub\modules\user\authclient\Event An event raised on create user. humhub\modules\user\authclient\BaseClient
EVENT_UPDATE_USER \humhub\modules\user\authclient\Event An event raised on update user data. humhub\modules\user\authclient\BaseClient

Property Details

$autoRefreshUsers public property
$baseDn public property

The ldap base dn

public string $baseDn null
$bindPassword public property
public string $bindPassword null
$bindUsername public property
public string $bindUsername null
$byPassApproval public property
public $byPassApproval true
$clientId public property

The auth client id

public string $clientId 'ldap'
$emailAttribute public property

The email attribute

public string $emailAttribute null
$hostname public property
public string $hostname null
$idAttribute public property

Attribute name to identify node

public string $idAttribute null
$loginFilter public property

The login filter

public string $loginFilter null
$networkTimeout public property

The value for network timeout when connect to the LDAP server.

$port public property


public integer $port null
$syncUserTableAttributes public property

Of attributes which are synced with the user table

public array $syncUserTableAttributes = ['username''email']
$useSsl public property
public boolean $useSsl false
$useStartTls public property
public boolean $useStartTls false
$userFilter public property

The ldap query to find humhub users

public string $userFilter null
$usernameAttribute public property

The ldap username attribute

public string $usernameAttribute null

Method Details

auth() public method

Authenticate the user using the login form.

public void auth ( )
throws \yii\base\NotSupportedException
defaultName() protected method

protected void defaultName ( )
defaultNormalizeUserAttributeMap() protected method

protected void defaultNormalizeUserAttributeMap ( )
defaultTitle() protected method

protected void defaultTitle ( )
getAuthClientInstance() public method

public humhub\modules\ldap\authclient\LdapAuth getAuthClientInstance ( $ldapEntry )


getId() public method

public void getId ( )
getIdAttribute() public method

public void getIdAttribute ( )
getLdap() public method

Returns Zend LDAP

public humhub\modules\ldap\components\ZendLdap getLdap ( )
throws \Zend\Ldap\Exception\LdapException
getSyncAttributes() public method

Returns attribute names which should be synced on login

public array getSyncAttributes ( )
return array

Attribute names to be synced

getUser() public method

Find user based on ldap attributes

See also humhub\modules\user\authclient\interfaces\PrimaryClient.

public humhub\modules\user\models\User getUser ( )
return humhub\modules\user\models\User

The user

getUserAttributes() public method

public array getUserAttributes ( )
return array

List of user attributes

getUserAuto() protected method

Try to find the user if authclient_id mapping is not set yet (legency) or idAttribute is not specified.

protected humhub\modules\user\models\User getUserAuto ( )
getUserCollection() public method

public array getUserCollection ( )
throws \Zend\Ldap\Exception\LdapException
getUserDn() protected method

Returns the users LDAP DN

protected string getUserDn ( )
return string

The user dn if found

getUserNode() protected method

Returns Users LDAP Node

protected \Zend\Ldap\Node getUserNode ( )
return \Zend\Ldap\Node

The users ldap node

throws \Zend\Ldap\Exception\LdapException
init() public method

public void init ( )
normalizeUserAttributes() protected method

protected void normalizeUserAttributes ( $attributes )
setLdap() public method

Sets an Zend LDAP Instance

public void setLdap ( \Zend\Ldap\Ldap $ldap )
$ldap \Zend\Ldap\Ldap
setNormalizeUserAttributeMap() public method

public void setNormalizeUserAttributeMap ( $normalizeUserAttributeMap )
$normalizeUserAttributeMap array

Normalize user attribute map.

syncUsers() public method

Refresh ldap users

New users (found in ldap) will be automatically created if all required fiƩlds are set. Profile fields which are bind to LDAP will automatically updated.

public void syncUsers ( )