modules

# Class: posixAccount

Source Location: /lib/modules/posixAccount.inc

### Class Overview

    baseModule
       |
       --posixAccount

Manages the object class "posixAccount" for users and hosts.

#### Author(s):

- Roland Gruber

Implements interfaces:

- passwordService

### Methods

- build_uploadAccounts
- checkASCII
- checkSelfServiceOptions
- check_configOptions
- delete_attributes
- display_html_attributes
- display_html_delete
- display_html_group
- display_html_homedir
- doUploadPostActions
- getNextUIDs
- getSelfServiceOptions
- get_metaData
- get_pdfEntries
- get_profileOptions
- init
- load_attributes
- load_Messages
- load_profile
- managesPasswordAttributes
- module_complete
- passwordChangeRequested
- postModifyActions
- preDeleteActions
- process_attributes
- process_group
- process_homedir
- save_attributes
- supportsForcePasswordChange

### Inherited Variables

#### Class: baseModule

baseModule::$attributes
baseModule::$autoAddObjectClasses
baseModule::$messages
baseModule::$meta
baseModule::$moduleSettings
baseModule::$orig
baseModule::$selfServiceSettings

### Inherited Methods

#### Class: baseModule

baseModule::__construct()
  Creates a new base module class
baseModule::build_uploadAccounts()
  In this function the LDAP accounts are built.
baseModule::can_manage()
  Returns true if this module can manage accounts of the current type, otherwise false.
baseModule::checkSelfServiceOptions()
  Checks if all input values are correct and returns the LDAP attributes which should be changed.
baseModule::checkSelfServiceSettings()
  Checks if the self service settings are valid.
baseModule::check_configOptions()
  Checks input values of module settings.
baseModule::check_profileOptions()
  Checks input values of account profiles.
baseModule::delete_attributes()
  This function returns an array with the same syntax as save_attributes().
baseModule::displaySpecialSelfServicePage()
  This function creates meta HTML code to display the module specific page for the self service.
baseModule::display_html_attributes()
  This function creates meta HTML code to display the module page.
baseModule::display_html_delete()
  This function creates meta HTML code which will be displayed when an account should be deleted.
baseModule::doUploadPostActions()
  This function is responsible to do additional tasks after the account has been created in LDAP (e.g. modifying group memberships, adding Quota etc..).
baseModule::getAccountContainer()
  Returns the accountContainer object.
baseModule::getAttributes()
  Returns the LDAP attributes which are managed in this module.
baseModule::getButtonStatus()
  Controls if the module button the account page is visible and activated.
baseModule::getIcon()
  Returns the path to the module icon.
baseModule::getLDAPAliases()
  Returns a list of aliases for LDAP attributes.
baseModule::getLinkToSpecialSelfServicePage()
  This allows modules to create a link to a module specific page for the self service.
baseModule::getManagedAttributes()
  Returns a list of LDAP attributes which are managed by this module.
baseModule::getManagedObjectClasses()
  Returns a list of managed object classes for this module.
baseModule::getOriginalAttributes()
  Returns the LDAP attributes which are managed in this module (with unchanged values).
baseModule::getRequiredExtensions()
  This function returns a list of PHP extensions (e.g. hash) which are needed by this module.
baseModule::getSelfServiceFields()
  Returns a list of possible input fields and their descriptions.
baseModule::getSelfServiceOptions()
  Returns the meta HTML code for each input field.
baseModule::getSelfServiceSearchAttributes()
  This function returns a list of possible LDAP attributes (e.g. uid, cn, ...) which can be used to search for LDAP objects.
baseModule::getSelfServiceSettings()
  Returns a list of self service configuration settings.
baseModule::get_alias()
  Returns an alias name for the module.
baseModule::get_configOptions()
  Returns a list of configuration options.
baseModule::get_dependencies()
  This function returns a list with all depending and conflicting modules.
baseModule::get_help()
  This function returns the help entry array for a specific help id.
baseModule::get_ldap_filter()
  Returns an LDAP filter for the account lists
baseModule::get_metaData()
  This function provides meta data which is interpreted by baseModule.
baseModule::get_pdfEntries()
  Returns the PDF entries for this module.
baseModule::get_pdfFields()
  Returns a hashtable with all entries that may be printed out in the PDF.
baseModule::get_profileOptions()
  This function defines what attributes will be used in the account profiles and their appearance in the profile editor.
baseModule::get_RDNAttributes()
  Returns a hash array containing a list of possible LDAP attributes that can be used to form the RDN (Relative Distinguished Name).
baseModule::get_scope()
  Returns the account type of this module (user, group, host)
baseModule::get_uploadColumns()
  Returns an array containing all input columns for the file upload.
baseModule::get_uploadPreDepends()
  Returns a list of module names which must be processed in building the account befor this module.
baseModule::handleAjaxRequest()
  Manages AJAX requests.
baseModule::init()
  Initializes the module after it became part of an accountContainer
baseModule::isBooleanConfigOptionSet()
  Returns if the given configuration option is set.
baseModule::is_base_module()
  Returns true if your module is a base module and otherwise false.
baseModule::load_attributes()
  This function loads the LDAP attributes when an account should be loaded.
baseModule::load_Messages()
  This function fills the $messages variable with output messages from this module.
baseModule::load_profile()
  This function loads the values from an account profile to the module's internal data structures.
baseModule::module_complete()
  This function is used to check if all settings for this module have been made.
baseModule::module_ready()
  This function is used to check if this module page can be displayed.
baseModule::postDeleteActions()
  Allows the module to run commands after the LDAP entry is deleted.
baseModule::postModifyActions()
  Allows the module to run commands after the LDAP entry is changed or created.
baseModule::postModifySelfService()
  Allows the module to run commands after the LDAP entry is changed or created.
baseModule::preDeleteActions()
  Allows the module to run commands before the LDAP entry is deleted.
baseModule::preModifyActions()
  Allows the module to run commands before the LDAP entry is changed or created.
baseModule::preModifySelfService()
  Allows the module to run commands before the LDAP entry is changed or created.
baseModule::process_attributes()
  This function processes user input.
baseModule::save_attributes()
  Returns a list of modifications which have to be made to the LDAP account.

### Class Details

[line 40]
Manages the object class "posixAccount" for users and hosts.

#### Tags:

author: | Roland Gruber

[ Top ]

### Class Methods

### method build_uploadAccounts [line 1564]

`array build_uploadAccounts( array $rawAccounts, array $ids, &$partialAccounts, array $selectedModules, array $partialAccounts)`

In this function the LDAP account is built up.

#### Tags:

return: | list of error messages if any

Overrides baseModule::build_uploadAccounts() (In this function the LDAP accounts are built.)

#### Parameters:

array | $rawAccounts | list of hash arrays (name => value) from user input
array | $partialAccounts | list of hash arrays (name => value) which are later added to LDAP
array | $ids | list of IDs for column position (e.g. "posixAccount_uid" => 5)
array | $selectedModules | list of selected account modules
| &$partialAccounts |

[ Top ]

### method checkASCII [line 923]

`string checkASCII( string $attribute)`

Checks if an attribute contains only ASCII charaters and replaces invalid characters.

#### Tags:

return: | attribute value with replaced non-ASCII characters

#### Parameters:

string | $attribute | attribute value

[ Top ]

### method checkSelfServiceOptions [line 2130]

`array checkSelfServiceOptions( string $fields, array $attributes, boolean $passwordChangeOnly)`

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" are 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 accountContainer.

#### Tags:

return: | messages and attributes (array('messages' => array(), 'add' => array('mail' => array('test@test.com')), 'del' => array(), 'mod' => array(), 'info' => array()))

Overrides baseModule::checkSelfServiceOptions() (Checks if all input values are correct and returns the LDAP attributes which should be changed.)

#### Parameters:

string | $fields | input fields
array | $attributes | LDAP attributes
boolean | $passwordChangeOnly | indicates that the user is only allowed to change his password and no LDAP content is readable

[ Top ]

### method check_configOptions [line 1504]

`array check_configOptions( array $scopes, array $options)`

Checks input values of module settings.

#### Tags:

return: | list of error messages

Overrides baseModule::check_configOptions() (Checks input values of module settings.)

#### Parameters:

array | $scopes | list of account types which are used
array | $options | hash array containing the settings (array('option' => array('value')))

[ Top ]

### method delete_attributes [line 662]

`List delete_attributes( )`

Additional LDAP operations on delete.

#### Tags:

return: | of LDAP operations, same as for save_attributes()

Overrides baseModule::delete_attributes() (This function returns an array with the same syntax as save_attributes().)
[ Top ]

### method display_html_attributes [line 1043]

`htmlElement display_html_attributes( )`

Returns the HTML meta data for the main account page.

#### Tags:

return: | HTML meta data

Overrides baseModule::display_html_attributes() (This function creates meta HTML code to display the module page.)
[ Top ]

### method display_html_delete [line 1173]

`htmlElement display_html_delete( )`

Displays the delete homedir option for the delete page.

#### Tags:

return: | meta HTML code

Overrides baseModule::display_html_delete() (This function creates meta HTML code which will be displayed when an account should be deleted.)
[ Top ]

### method display_html_group [line 1187]

`htmlElement display_html_group( )`

Displays the group selection.

#### Tags:

return: | meta HTML code

[ Top ]

### method display_html_homedir [line 1285]

`htmlElement display_html_homedir( )`

Displays the delete homedir option for the homedir page.

#### Tags:

return: | meta HTML code

[ Top ]

### method doUploadPostActions [line 1834]

`array doUploadPostActions( &$data, array $ids, array $failed, &$temp, &$accounts, array $data, array $temp, array $accounts)`

This function executes one post upload action.

#### Tags:

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

Overrides baseModule::doUploadPostActions() (This function is responsible to do additional tasks after the account has been created in LDAP (e.g. modifying group memberships, adding Quota etc..).)

#### Parameters:

array | $data | array containing one account in each element
array | $ids | array(<column_name> => <column number>)
array | $failed | list of accounts which were not created successfully
array | $temp | variable to store temporary data between two post actions
array | $accounts | list of LDAP entries
| &$data |
| &$temp |
| &$accounts |

[ Top ]

### method getNextUIDs [line 2015]

`mixed getNextUIDs( integer $count, &$errors, array $errors)`

Returns one or more free UID numbers.

#### Tags:

return: | Null if no UIDs are free else an array of free UIDs.

#### Parameters:

integer | $count | Number of needed free UIDs.
array | $errors | list of error messages where errors can be added
| &$errors |

[ Top ]

### method getSelfServiceOptions [line 2078]

`array getSelfServiceOptions( array $fields, array $attributes, boolean $passwordChangeOnly)`

Returns the meta HTML code for each input field.

format: array(<field1> => array(<META HTML>), ...) It is not possible to display help links.

#### Tags:

return: | meta HTML

Overrides baseModule::getSelfServiceOptions() (Returns the meta HTML code for each input field.)

#### Parameters:

array | $fields | list of active fields
array | $attributes | attributes of LDAP account
boolean | $passwordChangeOnly | indicates that the user is only allowed to change his password and no LDAP content is readable

[ Top ]

### method get_metaData [line 114]

`array get_metaData( )`

Returns meta data that is interpreted by parent class

#### Tags:

return: | array with meta data
see: | baseModule::get_metaData()

Overrides baseModule::get_metaData() (This function provides meta data which is interpreted by baseModule.)
[ Top ]

### method get_pdfEntries [line 1464]

`array get_pdfEntries( )`

Returns the PDF entries for this module.

#### Tags:

return: | list of possible PDF entries

Overrides baseModule::get_pdfEntries() (Returns the PDF entries for this module.)
[ Top ]

### method get_profileOptions [line 1357]

`profile get_profileOptions( )`

Returns a list of elements for the account profiles.

#### Tags:

return: | elements

Overrides baseModule::get_profileOptions() (This function defines what attributes will be used in the account profiles and their appearance in the profile editor.)
[ Top ]

### method init [line 439]

`void init( string $base)`

Initializes the module after it became part of an accountContainer
Overrides baseModule::init() (Initializes the module after it became part of an accountContainer)

#### Parameters:

string | $base | the name of the accountContainer object ($_SESSION[$base])

[ Top ]

### method load_attributes [line 472]

`void load_attributes( array $attr)`

This function loads all needed LDAP attributes.
Overrides baseModule::load_attributes() (This function loads the LDAP attributes when an account should be loaded.)

#### Parameters:

array | $attr | list of attributes

[ Top ]

### method load_Messages [line 65]

`void load_Messages( )`

This function fills the error message array with messages.
Overrides baseModule::load_Messages() (This function fills the $messages variable with output messages from this module.)
[ Top ]

### method load_profile [line 1423]

`void load_profile( array $profile)`

Loads the values of an account profile into internal variables.
Overrides baseModule::load_profile() (This function loads the values from an account profile to the module's internal data structures.)

#### Parameters:

array | $profile | hash array with profile values (identifier => value)

[ Top ]

### method managesPasswordAttributes [line 2190]

`boolean managesPasswordAttributes( )`

This method specifies if a module manages password attributes.

#### Tags:

return: | true if this module manages password attributes
see: | passwordService::managesPasswordAttributes
access: | public

Implementation of:

passwordService::managesPasswordAttributes()
  This method specifies if a module manages password attributes. The module alias will then appear as option in the GUI.

[ Top ]

### method module_complete [line 458]

`boolean module_complete( )`

This functions is used to check if all settings for this module have been made.

#### Tags:

return: | true, if settings are complete

Overrides baseModule::module_complete() (This function is used to check if all settings for this module have been made.)
[ Top ]

### method passwordChangeRequested [line 2214]

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

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.

#### Tags:

return: | list of error messages if any as parameter array for StatusMessage e.g. return arrray(array('ERROR', 'Password change failed.'))
see: | passwordService::passwordChangeRequested
access: | public

Implementation of:

passwordService::passwordChangeRequested()
  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.

#### Parameters:

String | $password | new password
boolean | $forcePasswordChange | force the user to change his password at next login
$modules | $modules | list of modules for which the password should be changed

[ Top ]

### method postModifyActions [line 578]

`array postModifyActions( boolean $newAccount, array $attributes)`

#### Tags:

return: | array which contains status messages. Each entry is an array containing the status message parameters.
see: | baseModule::postModifyActions()
access: | public

Overrides baseModule::postModifyActions() (Allows the module to run commands after the LDAP entry is changed or created.)

#### Parameters:

boolean | $newAccount |
array | $attributes | LDAP attributes of this entry

[ Top ]

### method preDeleteActions [line 677]

`array preDeleteActions( )`

Allows the module to run commands before the LDAP entry is deleted.

#### Tags:

return: | Array which contains status messages. Each entry is an array containing the status message parameters.

Overrides baseModule::preDeleteActions() (Allows the module to run commands before the LDAP entry is deleted.)
[ Top ]

### method process_attributes [line 722]

`array process_attributes( )`

Processes user input of the primary module page.

It checks if all input values are correct and updates the associated LDAP attributes.

#### Tags:

return: | list of info/error messages

Overrides baseModule::process_attributes() (This function processes user input.)
[ Top ]

### method process_group [line 948]

`array process_group( )`

Processes user input of the group selection page.

It checks if all input values are correct and updates the associated LDAP attributes.

#### Tags:

return: | list of info/error messages

[ Top ]

### method process_homedir [line 976]

`array process_homedir( )`

Processes user input of the homedir check page.

It checks if all input values are correct and updates the associated LDAP attributes.

#### Tags:

return: | list of info/error messages

[ Top ]

### method save_attributes [line 506]

`array save_attributes( )`

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

#### Tags:

return:

list of modifications
This function returns an array with 3 entries:
array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... )
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)
"add" are attributes which have to be added to LDAP entry
"remove" are attributes which have to be removed from LDAP entry
"modify" are attributes which have to been modified in LDAP entry
"info" are values with informational value (e.g. to be used later by pre/postModify actions)

Overrides baseModule::save_attributes() (Returns a list of modifications which have to be made to the LDAP account.)
[ Top ]

### method supportsForcePasswordChange [line 2199]

`boolean supportsForcePasswordChange( )`

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

#### Tags:

return: | force password change supported
access: | public

Implementation of:

passwordService::supportsForcePasswordChange()
  Specifies if this module supports to force that a user must change his password on next login.

[ Top ]

Documentation generated on Sun, 25 Mar 2012 19:35:50 +0200 by phpDocumentor 1.4.1