LDAP Account Manager

selfService.inc

Interfaces, Classes, Traits and Enums

SelfServicePersistenceStrategy
Interface for self-service profile persistence.
SelfServiceLoginHandler
Login handler for self-service
SelfServicePersistence
Manages reading and writing self-service profiles.
SelfServicePersistenceStrategyFileSystem
Uses local file system for storing self-service profiles.
SelfServicePersistenceStrategyPdo
Uses PDO for storing self-service profiles.
selfServiceProfile
Includes all settings of a self-service profile.
SelfServiceLdapConnection
LDAP connection for self-service.
SelfServiceUserPasswordLoginHandler
Performs login with user and password.
SelfServiceHttpAuthLoginHandler
Performs login with HTTP authentication.
SelfService2FaLoginHandler
Performs login with pure 2FA.

Table of Contents

isLAMProVersion()  : bool
Returns if this is a LAM Pro installation.
getSelfServiceSearchAttributes()  : array<string|int, string>
Returns a list of possible search attributes for the self-service.
getSelfServiceFieldSettings()  : array<string, array<string, string>>
Returns the field settings for the self-service.
getSelfServiceOptions()  : array<string, array<string, htmlResponsiveRow>>
Returns meta HTML code for each self-service field.
checkSelfServiceOptions()  : array<string, string[]|array>
Checks if all input values are correct and returns the LDAP commands which should be executed.
getSelfServiceSettings()  : array<string, htmlElement>
Returns a hash array (module name => elements) of all module options for the configuration page.
checkSelfServiceSettings()  : array<string|int, array<string|int, string>>
Checks if the self-service settings are valid
isSelfService()  : bool
Returns if script runs inside self-service.
openSelfServiceLdapConnection()  : Connection|null
Opens the LDAP connection and returns the handle. No bind is done.
bindLdapUser()  : bool
Binds the LDAP connections with given user and password.

Functions

isLAMProVersion()

Returns if this is a LAM Pro installation.

isLAMProVersion() : bool
Return values
bool

LAM Pro installation

getSelfServiceSearchAttributes()

Returns a list of possible search attributes for the self-service.

getSelfServiceSearchAttributes(string $scope) : array<string|int, string>
Parameters
$scope : string

account type

Return values
array<string|int, string>

attributes

getSelfServiceFieldSettings()

Returns the field settings for the self-service.

getSelfServiceFieldSettings(string $scope) : array<string, array<string, string>>
Parameters
$scope : string

account type

Return values
array<string, array<string, string>>

settings

getSelfServiceOptions()

Returns meta HTML code for each self-service field.

getSelfServiceOptions(string $scope, array<string, array<string|int, string>> $fields, array<string, string[]|string> $attributes, bool $passwordChangeOnly, array<string|int, string> $readOnlyFields) : array<string, array<string, htmlResponsiveRow>>
Parameters
$scope : string

account type

$fields : array<string, array<string|int, string>>

input fields (array(<moduleName> => array(, , ...)))

$attributes : array<string, string[]|string>

LDAP attributes (attribute names in lower-case)

$passwordChangeOnly : bool

indicates that the user is only allowed to change his password and no LDAP content is readable

$readOnlyFields : array<string|int, string>

list of read-only fields

Return values
array<string, array<string, htmlResponsiveRow>>

meta HTML code (array(<moduleName> => array(<optionName> => htmlResponsiveRow)))

checkSelfServiceOptions()

Checks if all input values are correct and returns the LDAP commands which should be executed.

checkSelfServiceOptions(string $scope, array<string, array<string|int, string>> $fields, array<string, string[]|string> $attributes, bool $passwordChangeOnly, array<string|int, string> $readOnlyFields) : array<string, string[]|array>
Parameters
$scope : string

account type

$fields : array<string, array<string|int, string>>

input fields (array(<moduleName> => array(, , ...)))

$attributes : array<string, string[]|string>

LDAP attributes

$passwordChangeOnly : bool

indicates that the user is only allowed to change his password and no LDAP content is readable

$readOnlyFields : array<string|int, string>

list of read-only fields

Return values
array<string, string[]|array>

messages and LDAP commands (array('messages' => [], 'add' => [], 'del' => [], 'mod' => []))

getSelfServiceSettings()

Returns a hash array (module name => elements) of all module options for the configuration page.

getSelfServiceSettings(string $scope, selfServiceProfile $profile) : array<string, htmlElement>
Parameters
$scope : string

account type

$profile : selfServiceProfile

currently edited profile

Return values
array<string, htmlElement>

configuration options

checkSelfServiceSettings()

Checks if the self-service settings are valid

checkSelfServiceSettings(string $scope, array<string, array<string|int, string>> &$options, selfServiceProfile &$profile) : array<string|int, array<string|int, string>>
Parameters
$scope : string

account type

$options : array<string, array<string|int, string>>

hash array containing all options (name => array(...))

$profile : selfServiceProfile

profile

Return values
array<string|int, array<string|int, string>>

list of error messages

isSelfService()

Returns if script runs inside self-service.

isSelfService() : bool
Return values
bool

is self-service

openSelfServiceLdapConnection()

Opens the LDAP connection and returns the handle. No bind is done.

openSelfServiceLdapConnection(selfServiceProfile $profile) : Connection|null
Parameters
$profile : selfServiceProfile

profile

Return values
Connection|null

LDAP handle or null if connection failed

bindLdapUser()

Binds the LDAP connections with given user and password.

bindLdapUser(Connection $handle, selfServiceProfile $profile, string $userDn, string $password) : bool
Parameters
$handle : Connection

LDAP handle

$profile : selfServiceProfile

profile

$userDn : string

bind DN

$password : string

bind password

Return values
bool

binding successful

Search results