lib/modules/asteriskAccount.inc

Properties

Description

Manages the Asterisk extension of user accounts.

Classes

asteriskAccount

Properties

 
\passwordService
 
modules  
No 
No 

Description

Manages the Asterisk extension of user accounts.
It implements the complete module interface and uses meta-data provided by the account modules for its functions.

Location and naming of modules
All LAM modules are placed in lib/modules/ and are named ".inc". E.g. if you create a new module and its class name is "qmail" then the filename would be "qmail.inc". The class name of a module must contain only a-z, A-Z, 0-9, -, and _.

You can avoid to override many functions by using {@link get_metaData()}.

All module classes should extend the baseModule class.

Methods

__construct, buildPasswordString, build_uploadAccounts, checkSelfServiceOptions, display_html_attributes, get_metaData, get_pdfEntries, hashPassword, load_Messages, managesPasswordAttributes, passwordChangeRequested, process_attributes, save_attributes, supportsForcePasswordChange,

__construct( string   $scope, ) : n/a

Description

Creates a new asteriskAccount object.

Arguments

Name Type Description Default
$scope string

account type (user, group, host)

Return value

Type Description
n/a n/a

buildPasswordString( array   $attributes, array   $moduleSettings, String   $password, ) : String

Description

Builds the password string for the password attribute.

Arguments

Name Type Description Default
$attributes array

LDAP attributes

$moduleSettings array

module configuration settings

$password String

password

Return value

Type Description
String value for password attribute

build_uploadAccounts( array   $rawAccounts, array   $ids, array   $partialAccounts, array   $selectedModules, ) : array

Description

In this function the LDAP account is built up.

Arguments

Name Type Description Default
$rawAccounts array

list of hash arrays (name => value) from user input

$ids array

list of IDs for column position (e.g. "posixAccount_uid" => 5)

$partialAccounts array

list of hash arrays (name => value) which are later added to LDAP

$selectedModules array

list of selected account modules

Return value

Type Description
array list of error messages if any

checkSelfServiceOptions( string   $fields, array   $attributes, boolean   $passwordChangeOnly, array   $readOnlyFields, ) : array

Description

Checks if all input values are correct and returns the LDAP attributes which should be changed.

Return values:
messages: array of parameters to create status messages
add: array of attributes to add
del: array of attributes to remove
mod: array of attributes to modify
info: array of values with informational value (e.g. to be used later by pre/postModify actions) Calling this method does not require the existence of an enclosing {@link accountContainer}.

Arguments

Name Type Description Default
$fields string

input fields

$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 attributes (array('messages' => array(), 'add' => array('mail' => array('test@test.com')), 'del' => array(), 'mod' => array(), 'info' => array()))

display_html_attributes( ) : \htmlElement

Description

Returns the HTML meta data for the main account page.

Return value

Type Description
\htmlElement HTML meta data

get_metaData( ) : array

Description

Returns meta data that is interpreted by parent class.

Return value

Type Description
array array with meta data

get_pdfEntries( ) : n/a

Description

Returns a list of PDF entries

Return value

Type Description
n/a n/a

hashPassword( String   $password, ) : String

Description

Hashes a password value to Asterisk format.

Arguments

Name Type Description Default
$password String

password

Return value

Type Description
String hash

load_Messages( ) : n/a

Description

This function fills the error message array with messages

Return value

Type Description
n/a n/a

managesPasswordAttributes( ) : boolean

Description

This method specifies if a module manages password attributes.

Return value

Type Description
boolean true if this module manages password attributes

Tags

Name Description
see

passwordChangeRequested( String   $password,   $modules, boolean   $forcePasswordChange, ) : array

Description

This function is called whenever the password should be changed. Account modules must change their password attributes only if the modules list contains their module name.

Arguments

Name Type Description Default
$password String

new password

$modules n/a

list of modules for which the password should be changed

$forcePasswordChange boolean

force the user to change his password at next login

Return value

Type Description
array list of error messages if any as parameter array for StatusMessage e.g. return arrray(array('ERROR', 'Password change failed.'))

Tags

Name Description
see

process_attributes( ) : n/a

Description

Write variables into object and do some regex checks

Return value

Type Description
n/a n/a

save_attributes( ) : array

Description

Returns a list of modifications which have to be made to the LDAP account.

Return value

Type Description
array list of modifications <br>This function returns an array with 3 entries: <br>array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... ) <br>DN is the DN to change. It may be possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid) <br>"add" are attributes which have to be added to LDAP entry <br>"remove" are attributes which have to be removed from LDAP entry <br>"modify" are attributes which have to been modified in LDAP entry <br>"info" are values with informational value (e.g. to be used later by pre/postModify actions)

supportsForcePasswordChange( ) : boolean

Description

Specifies if this module supports to force that a user must change his password on next login.

Return value

Type Description
boolean force password change supported

Constants

  ASTERISK_DEFAULT_REALM = "asterisk"




Documentation was generated by phpDocumentor 2.1.0 .

Namespaces

  • global

    Packages