LDAP Account Manager

modules.inc

Interfaces, Classes, Traits and Enums

passwordService
This interface needs to be implemented by all account modules which manage passwords.
AccountStatusProvider
Provides module information about the status of an LDAP account.
accountContainer
This class includes all modules and attributes of an account.
PasswordQuickChangeOption
Option for the password quick change page.
AccountStatus
Provides the complete information about the status of an LDAP account.
AccountStatusDetails
ScopeAndModuleValidation
Validation of scope and module names.

Table of Contents

getModuleAlias()  : string|null
Returns the alias name of a module
is_base_module()  : bool
Returns true if the module is a base module
get_ldap_filter()  : string
Returns the LDAP filter used by the account lists
getRDNAttributes()  : array<string|int, mixed>
Returns a list of LDAP attributes which can be used to form the RDN.
getModulesDependencies()  : array<string|int, mixed>
Returns a hash array (module name => dependencies) of all module dependencies
check_module_depends()  : mixed
Checks if there are missing dependencies between modules.
check_module_conflicts()  : bool
Checks if there are conflicts between modules
getAvailableModules()  : array<string|int, mixed>
Returns an array with all available user module names
getProfileOptions()  : array<string|int, mixed>
Returns the elements for the profile page.
checkProfileOptions()  : array<string|int, mixed>
Checks if the profile options are valid
getConfigOptions()  : array<string|int, mixed>
Returns a hash array (module name => elements) of all module options for the configuration page.
checkConfigOptions()  : array<string|int, mixed>
Checks if the configuration options are valid
getHelp()  : array<string|int, mixed>
Returns a help entry from an account module.
getAvailablePDFFields()  : array<string|int, mixed>
Returns a list of available PDF entries.
getUploadColumns()  : array<string|int, mixed>
Returns an array containing all input columns for the file upload.
buildUploadAccounts()  : mixed
This function builds the LDAP accounts for the file upload.
doUploadPreActions()  : array<string|int, mixed>
Runs any actions that need to be done before an LDAP entry is created.
doUploadPostActions()  : array<string|int, mixed>
This function executes one post upload action.
getRequiredExtensions()  : array<string|int, mixed>
Returns true if the module is a base module
parseHtml()  : array<string|int, mixed>
Takes a list of meta-HTML elements and prints the equivalent HTML output.
lamCompareDescriptiveOptions()  : int
Helper function to sort descriptive options in parseHTML().
printHelpLink()  : mixed
Prints a LAM help link.

Functions

getModuleAlias()

Returns the alias name of a module

getModuleAlias(string $name, string $scope) : string|null
Parameters
$name : string

the module name

$scope : string

the account type ("user", "group", "host")

Return values
string|null

alias name

is_base_module()

Returns true if the module is a base module

is_base_module(string $name, string $scope) : bool
Parameters
$name : string

the module name

$scope : string

the account type ("user", "group", "host")

Return values
bool

true if base module

get_ldap_filter()

Returns the LDAP filter used by the account lists

get_ldap_filter(string $typeId) : string
Parameters
$typeId : string

the account type ("user", "group", "host")

Return values
string

LDAP filter

getRDNAttributes()

Returns a list of LDAP attributes which can be used to form the RDN.

getRDNAttributes(string $typeId[, array<string|int, mixed> $selectedModules = null ]) : array<string|int, mixed>

The list is already sorted by the priority given by the nodules.

Parameters
$typeId : string

account type (user, group, host)

$selectedModules : array<string|int, mixed> = null

return only RDN attributes of these modules

Return values
array<string|int, mixed>

list of LDAP attributes

getModulesDependencies()

Returns a hash array (module name => dependencies) of all module dependencies

getModulesDependencies(string $scope) : array<string|int, mixed>

"dependencies" contains an array with two sub arrays: depends, conflicts
The elements of "depends" are either module names or an array of module names (OR-case).
The elements of conflicts are module names.

Parameters
$scope : string

the account type (user, group, host)

Return values
array<string|int, mixed>

dependencies

check_module_depends()

Checks if there are missing dependencies between modules.

check_module_depends(array<string|int, mixed> $selected, array<string|int, mixed> $deps) : mixed
Parameters
$selected : array<string|int, mixed>

selected module names

$deps : array<string|int, mixed>

module dependencies

Return values
mixed

false if no missing dependency was found, otherwise an array of array(selected module, depending module) if missing dependencies were found

check_module_conflicts()

Checks if there are conflicts between modules

check_module_conflicts(array<string|int, mixed> $selected, array<string|int, mixed> $deps) : bool
Parameters
$selected : array<string|int, mixed>

selected module names

$deps : array<string|int, mixed>

module dependencies

Return values
bool

false if no conflict was found, otherwise an array of array(selected module, conflicting module) if conflicts were found

getAvailableModules()

Returns an array with all available user module names

getAvailableModules(string $scope[, bool $mustSupportAdminInterface = false ]) : array<string|int, mixed>
Parameters
$scope : string

account type (user, group, host)

$mustSupportAdminInterface : bool = false

module must support LAM admin interface (default: false)

Return values
array<string|int, mixed>

list of possible modules

getProfileOptions()

Returns the elements for the profile page.

getProfileOptions(string $typeId) : array<string|int, mixed>
Parameters
$typeId : string

account type (user, group, host)

Return values
array<string|int, mixed>

profile elements

checkProfileOptions()

Checks if the profile options are valid

checkProfileOptions(string $typeId, array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$typeId : string

account type (user, group, host)

$options : array<string|int, mixed>

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

Return values
array<string|int, mixed>

list of error messages

getConfigOptions()

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

getConfigOptions(array<string|int, mixed> $moduleToScopes) : array<string|int, mixed>
Parameters
$moduleToScopes : array<string|int, mixed>

hash array (module name => array(account types))

Return values
array<string|int, mixed>

configuration options

checkConfigOptions()

Checks if the configuration options are valid

checkConfigOptions(array<string|int, mixed> $moduleToTypeIds, array<string|int, mixed> &$options) : array<string|int, mixed>
Parameters
$moduleToTypeIds : array<string|int, mixed>

hash array (module name => array(account type ids))

$options : array<string|int, mixed>

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

Return values
array<string|int, mixed>

list of error messages

getHelp()

Returns a help entry from an account module.

getHelp(string $module, string $helpID, string $scope) : array<string|int, mixed>
Parameters
$module : string

module name

$helpID : string

help identifier

$scope : string

account type

Return values
array<string|int, mixed>

help entry

getAvailablePDFFields()

Returns a list of available PDF entries.

getAvailablePDFFields(string $typeId) : array<string|int, mixed>
Parameters
$typeId : string

account type (user, group, host)

Return values
array<string|int, mixed>

PDF entries (field ID => field label)

getUploadColumns()

Returns an array containing all input columns for the file upload.

getUploadColumns(ConfiguredType &$type, array<string|int, mixed> $selectedModules) : array<string|int, mixed>

Syntax:
array(
string: name, // fixed non-translated name which is used as column name (should be of format: _)
string: description, // short descriptive name
string: help, // help ID
string: example, // example value
boolean: required // true, if user must set a value for this column
)

Parameters
$type : ConfiguredType

account type

$selectedModules : array<string|int, mixed>

selected account modules

Return values
array<string|int, mixed>

column list

buildUploadAccounts()

This function builds the LDAP accounts for the file upload.

buildUploadAccounts(ConfiguredType $type, array<string|int, mixed> $data, array<string|int, mixed> $ids, array<string|int, mixed> $selectedModules, htmlResponsiveRow $container) : mixed

If there are problems status messages will be printed automatically.

Parameters
$type : ConfiguredType

account type

$data : array<string|int, mixed>

array containing one account in each element

$ids : array<string|int, mixed>

array(<column_name> => )

$selectedModules : array<string|int, mixed>

selected account modules

$container : htmlResponsiveRow

HTML container

Return values
mixed

array including accounts or false if there were errors

doUploadPreActions()

Runs any actions that need to be done before an LDAP entry is created.

doUploadPreActions(ConfiguredType $type, array<string|int, mixed> $selectedModules, array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
$type : ConfiguredType

account type

$selectedModules : array<string|int, mixed>

list of selected account modules

$attributes : array<string|int, mixed>

LDAP attributes of this entry (attributes are provided as reference, handle modifications of $attributes with care)

Return values
array<string|int, mixed>

array which contains status messages. Each entry is an array containing the status message parameters.

doUploadPostActions()

This function executes one post upload action.

doUploadPostActions(ConfiguredType $type, array<string|int, mixed> &$data, array<string|int, mixed> $ids, array<string|int, mixed> $failed, array<string|int, mixed> $selectedModules, array<string|int, mixed> &$accounts) : array<string|int, mixed>
Parameters
$type : ConfiguredType

account type

$data : array<string|int, mixed>

array containing one account in each element

$ids : array<string|int, mixed>

array(<column_name> => )

$failed : array<string|int, mixed>

list of accounts which were not created successfully

$selectedModules : array<string|int, mixed>

list of selected account modules

$accounts : array<string|int, mixed>

list of LDAP entries

Return values
array<string|int, mixed>

current status
array (
'status' => 'finished' | 'inProgress'
'module' =>
'progress' => 0..100
'errors' => array (<array of parameters for StatusMessage>)
)

getRequiredExtensions()

Returns true if the module is a base module

getRequiredExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>

required extensions

parseHtml()

Takes a list of meta-HTML elements and prints the equivalent HTML output.

parseHtml(string $module, mixed $input, array<string|int, mixed> $values, bool $restricted, int &$tabindex, string $scope) : array<string|int, mixed>

The modules are not allowed to display HTML code directly but return meta HTML code. This allows to have a common design for all module pages.

Parameters
$module : string

Name of account module

$input : mixed

htmlElement or array of htmlElement elements

$values : array<string|int, mixed>

List of values which override the defaults in $input (name => value)

$restricted : bool

If true then no buttons will be displayed

$tabindex : int

Start value of tabulator index for input fields

$scope : string

Account type

Return values
array<string|int, mixed>

List of input field names and their type (name => type)

lamCompareDescriptiveOptions()

Helper function to sort descriptive options in parseHTML().

lamCompareDescriptiveOptions(array<string|int, mixed> &$a, array<string|int, mixed> &$b) : int

It compares the second entries of two arrays.

Parameters
$a : array<string|int, mixed>

first array

$b : array<string|int, mixed>

second array

Return values
int

compare result

Prints a LAM help link.

printHelpLink(array<string|int, mixed> $entry, string $number[, string $module = '' ][, string $scope = '' ][, array<string|int, mixed> $classes = array() ]) : mixed
Parameters
$entry : array<string|int, mixed>

help entry

$number : string

help number

$module : string = ''

module name

$scope : string = ''

account scope

$classes : array<string|int, mixed> = array()

CSS classes

Return values
mixed

Search results