lib/selfService.inc
Properties
Description
Interface between modules and self service pages.This file also includes the self service profile class and helper functions.
Functions
isLAMProVersion( ) : boolean
Description
Returns if this is a LAM Pro installation.Return value
| Type | Description | 
|---|---|
| boolean | LAM Pro installation | 
getSelfServiceSearchAttributes( string $scope, ) : array
Description
Returns a list of possible search attributes for the self service.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $scope | string | account type | 
Return value
| Type | Description | 
|---|---|
| array | attributes | 
getSelfServiceFieldSettings( string $scope, ) : array
Description
Returns the field settings for the self service.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $scope | string | account type | 
Return value
| Type | Description | 
|---|---|
| array | settings | 
getSelfServiceOptions( string $scope, array $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields, ) : array
Description
Returns meta HTML code for each self service field.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $scope | string | account type | |
| $fields | array | input fields (array( | |
| $attributes | array | LDAP attributes (attribute names in lower case) | |
| $passwordChangeOnly | boolean | indicates that the user is only allowed to change his password and no LDAP content is readable | |
| $readOnlyFields | array | list of read-only fields | 
Return value
| Type | Description | 
|---|---|
| array | meta HTML code (array(<moduleName> => htmlTableRow)) | 
checkSelfServiceOptions( string $scope, string $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields, ) : array
Description
Checks if all input values are correct and returns the LDAP commands which should be executed.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $scope | string | account type | |
| $fields | string | input fields (array( | |
| $attributes | array | LDAP attributes | |
| $passwordChangeOnly | boolean | indicates that the user is only allowed to change his password and no LDAP content is readable | |
| $readOnlyFields | array | list of read-only fields | 
Return value
| Type | Description | 
|---|---|
| array | messages and LDAP commands (array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array())) | 
getSelfServiceProfiles( ) : array
Description
Returns a list of all available self service profiles (without .conf)Return value
| Type | Description | 
|---|---|
| array | profile names (array(<account type> => array(<profile1>, <profile2>, ...))) | 
loadSelfServiceProfile( string $name, string $scope, ) : \selfServiceProfile
Description
Loads all settings of a self service profile.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $name | string | profile name | |
| $scope | string | account type | 
Return value
| Type | Description | 
|---|---|
| \selfServiceProfile | true if file was readable | 
saveSelfServiceProfile( string $name, string $scope, \selfServiceProfile $profile, ) : boolean
Description
Saves a self service profile.File is created, if needed
Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $name | string | name of the account profile | |
| $scope | string | account type | |
| $profile | \selfServiceProfile | self service profile | 
Return value
| Type | Description | 
|---|---|
| boolean | true, if saving succeeded | 
isSelfServiceProfileWritable( string $name, string $scope, ) : boolean
Description
Checks if a service profile is writable.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $name | string | profile name | |
| $scope | string | account type | 
Return value
| Type | Description | 
|---|---|
| boolean | true if file is writable | 
getSelfServiceSettings( string $scope, \selfServiceProfile $profile, ) : array
Description
Returns a hash array (module name => elements) of all module options for the configuration page.Arguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $scope | string | account type | |
| $profile | \selfServiceProfile | currently edited profile | 
Return value
| Type | Description | 
|---|---|
| array | configuration options | 
checkSelfServiceSettings( string $scope, array $options, \selfServiceProfile $profile, ) : array
Description
Checks if the self service settings are validArguments
| Name | Type | Description | Default | 
|---|---|---|---|
| $scope | string | account type | |
| $options | array | hash array containing all options (name => array(...)) | |
| $profile | \selfServiceProfile | profile | 
Return value
| Type | Description | 
|---|---|
| array | list of error messages | 
