# LDAP Account Manager

# lib/modules/inetOrgPerson.inc

# Properties

author
author
author
package

## Description

Manages the atrributes of object class inetOrgPerson.

## Classes

### inetOrgPerson

# Properties

Extends
Implements
\passwordService
package
modules
Abstract
No
Final
No

#### Description

This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address).
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 "<class name>.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

ajaxDeleteSelfServiceUserCertificate, ajaxUpload, build_uploadAccounts, checkSelfServiceOptions, check_profileOptions, display_html_attributes, display_html_manager, display_html_photo, display_html_userCertificate, doUploadPostActions, getButtonStatus, getManagers, getSelfServiceOptions, getSelfServiceUserCertificates, getSelfServiceUserCertificatesJSBlock, get_metaData, get_pdfEntries, get_uploadColumns, handleAjaxRequest, initCache, invalidAjaxRequest, load_Messages, load_profile, managesPasswordAttributes, module_complete, passwordChangeRequested, process_attributes, process_manager, process_photo, process_userCertificate, save_attributes, supportsForcePasswordChange,

### ajaxDeleteSelfServiceUserCertificate( array $data, ) : n/a

#### Description

Manages the deletion of a certificate.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$data | array | JSON data |

#### Return value

Type | Description
--- | ---
n/a | n/a

### ajaxUpload( ) : n/a

#### Description

Handles an AJAX file upload and prints the JSON result.

#### Return value

Type | Description
--- | ---
n/a | n/a

### 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(&#039;messages&#039; =&gt; array(), &#039;add&#039; =&gt; array(&#039;mail&#039; =&gt; array(&#039;test@test.com&#039;)), &#039;del&#039; =&gt; array(), &#039;mod&#039; =&gt; array(), &#039;info&#039; =&gt; array()))

### check_profileOptions( array $options, ) : array

#### Description

Checks input values of account profiles.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$options | array | a hash array (name => value) containing the options |

#### Return value

Type | Description
--- | ---
array | list of error messages (array(type, title, text)) to generate StatusMessages, if any

### display_html_attributes( ) : array

#### Description

Returns the HTML meta data for the main account page.

#### Return value

Type | Description
--- | ---
array | HTML meta data

### display_html_manager( ) : \htmlElement

#### Description

This function will create the meta HTML code to show a page to change the manager attribute.

#### Return value

Type | Description
--- | ---
\htmlElement | HTML meta data

### display_html_photo( ) : array

#### Description

Displays the photo upload page.

#### Return value

Type | Description
--- | ---
array | meta HTML code

### display_html_userCertificate( ) : array

#### Description

Displays the certificate upload page.

#### Return value

Type | Description
--- | ---
array | meta HTML code

### doUploadPostActions( array $data, array $ids, array $failed, array $temp, array $accounts, ) : array

#### Description

This function executes one post upload action.

#### Arguments

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

#### Return value

Type | Description
--- | ---
array | current status &lt;br&gt; array ( &lt;br&gt; &#039;status&#039; =&gt; &#039;finished&#039; | &#039;inProgress&#039; &lt;br&gt; &#039;progress&#039; =&gt; 0..100 &lt;br&gt; &#039;errors&#039; =&gt; array (&lt;array of parameters for StatusMessage&gt;) &lt;br&gt; )

### getButtonStatus( ) : string

#### Description

Controls if the module button the account page is visible and activated.

#### Return value

Type | Description
--- | ---
string | status (&quot;enabled&quot;, &quot;disabled&quot;, &quot;hidden&quot;)

### getManagers( ) : array

#### Description

Returns a list of possible managers.

#### Return value

Type | Description
--- | ---
array | list of format array(abstract DN =&gt; DN)

### getSelfServiceOptions( array $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields, ) : array

#### Description

Returns the meta HTML code for each input field.
format: array(<field1> => array(), ...) It is not possible to display help links.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$fields | array | list of active fields |
$attributes | array | attributes of LDAP account |
$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 | list of meta HTML elements (field name =&gt; htmlTableRow)

### getSelfServiceUserCertificates( ) : \htmlTable

#### Description

Returns the meta HTML code to display the certificate area.
This also includes the file upload.

#### Return value

Type | Description
--- | ---
\htmlTable | certificate content

### getSelfServiceUserCertificatesJSBlock( ) : \htmlJavaScript

#### Description

Returns the Java Script functions to manage the certificates.

#### Return value

Type | Description
--- | ---
\htmlJavaScript | JS block

### get_metaData( ) : array

#### Description

Returns meta data that is interpreted by parent class

#### Return value

Type | Description
--- | ---
array | array with meta data

#### Tags

Name | Description
--- | ---
see |

### get_pdfEntries( ) : array

#### Description

Returns the PDF entries for this module.

#### Return value

Type | Description
--- | ---
array | list of possible PDF entries

### get_uploadColumns( array $selectedModules, ) : array

#### Description

Returns an array containing all input columns for the file upload.
Syntax:
array(
string: name, // fixed non-translated name which is used as column name (should be of format: <module name>_<column name>)
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
)

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$selectedModules | array | list of selected account modules |

#### Return value

Type | Description
--- | ---
array | column list

### handleAjaxRequest( ) : n/a

#### Description

Manages AJAX requests.
This function may be called with or without an account container.

#### Return value

Type | Description
--- | ---
n/a | n/a

### initCache( ) : n/a

#### Description

Loads cached data from LDAP such as departmets etc.

#### Return value

Type | Description
--- | ---
n/a | n/a

### invalidAjaxRequest( String $message = null, ) : n/a

#### Description

Invalid AJAX request received.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$message | String | error message | null

#### Return value

Type | Description
--- | ---
n/a | n/a

### load_Messages( ) : n/a

#### Description

This function fills the message array.

#### Return value

Type | Description
--- | ---
n/a | n/a

### load_profile( array $profile, ) : n/a

#### Description

Loads the values of an account profile into internal variables.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$profile | array | hash array with profile values (identifier => value) |

#### 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 |

### module_complete( ) : boolean

#### Description

This functions return true if all needed settings are done.

#### Return value

Type | Description
--- | ---
boolean | true, if all is ok

### 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(&#039;ERROR&#039;, &#039;Password change failed.&#039;))

#### Tags

Name | Description
--- | ---
see |

### process_attributes( ) : array

#### Description

Processes user input of the primary module page.
It checks if all input values are correct and updates the associated LDAP attributes.

#### Return value

Type | Description
--- | ---
array | list of info/error messages

### process_manager( ) : array

#### Description

Processes user input of the manager page.
It checks if all input values are correct and updates the associated LDAP attributes.

#### Return value

Type | Description
--- | ---
array | list of info/error messages

### process_photo( ) : n/a

#### Description

Sets a new photo.

#### Return value

Type | Description
--- | ---
n/a | n/a

### process_userCertificate( ) : n/a

#### Description

Sets a new certificate or deletes old ones.

#### 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 &lt;br&gt;This function returns an array with 3 entries: &lt;br&gt;array( DN1 (&#039;add&#039; =&gt; array($attr), &#039;remove&#039; =&gt; array($attr), &#039;modify&#039; =&gt; array($attr)), DN2 .... ) &lt;br&gt;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) &lt;br&gt;&quot;add&quot; are attributes which have to be added to LDAP entry &lt;br&gt;&quot;remove&quot; are attributes which have to be removed from LDAP entry &lt;br&gt;&quot;modify&quot; are attributes which have to been modified in LDAP entry &lt;br&gt;&quot;info&quot; 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

#### Properties

$businessCategoryCache, $cachedManagers, $clearTextPassword, $departmentCache, $employeeTypeCache, $oCache, $ouCache, $titleCache,

### private $businessCategoryCache = null

business category cache

### private $cachedManagers = null

caches the list of possible managers

### private $clearTextPassword = null

clear text password

### private $departmentCache = null

cache for departments

### private $employeeTypeCache = null

employee type cache

### private $oCache = null

organization cache

### private $ouCache = null

organizational unit cache

### private $titleCache = null

title cache

#### Constants

### SESS_CERTIFICATES_LIST = 'inetOrgPerson_certificatesList'

session variable for existing user certificates in self service
Documentation was generated by phpDocumentor 2.0.1 .

# Namespaces

- global

# Packages

- Crypt_AES
  - Crypt_AES
    Pure-PHP implementation of AES.
- Crypt_DES
  - Crypt_DES
    Pure-PHP implementation of DES.
- Crypt_Hash
  - Crypt_Hash
    Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.
- Crypt_RC4
  - Crypt_RC4
    Pure-PHP implementation of RC4.
- Crypt_RSA
  - Crypt_RSA
    Pure-PHP PKCS#1 compliant implementation of RSA.
- Crypt_Random
- Crypt_Rijndael
  - Crypt_Rijndael
    Pure-PHP implementation of Rijndael.
- Crypt_TerraDES
  - Crypt_TripleDES
    Pure-PHP implementation of Triple DES.
- Crypt_TripleDES
- Help
- LDAP
  - Ldap
    Ldap manages connection to LDAP and includes several helper functions.
- Math_BigInteger
  - Math_BigInteger
    Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 numbers.
- Net_SFTP
  - Net_SFTP
    Pure-PHP implementations of SFTP.
- Net_SSH1
  - Net_SSH1
    Pure-PHP implementation of SSHv1.
- Net_SSH2
  - Net_SSH2
    Pure-PHP implementation of SSHv2.
- PDF
  - UFPDF
    Main UFPDF class for creating Unicode PDF documents
  - lamPDF
    Creates a LAM information page in PDF format.
  - xmlParser
    Simple XML parser.
- PHP_Compat
- configuration
  - LAMCfgMain
    This class manages config.cfg.
  - LAMConfig
    This class manages .conf files.
- horde.cipher
  - Horde_Cipher_blowfish
- lam
  - smbHash
    Calculates NT and LM hashes.
- lib
  - AttributeType
    Represents an LDAP AttributeType
  - MatchingRule
    Represents an LDAP MatchingRule
  - MatchingRuleUse
    Represents an LDAP schema matchingRuleUse entry
  - ObjectClass
    Represents an LDAP objectClass
  - ObjectClassAttribute
    A simple class for representing AttributeTypes used only by the ObjectClass class.
  - SchemaItem
    Generic parent class for all schema items. A schema item is an ObjectClass, an AttributeBype, a MatchingRule, or a Syntax.
  - Syntax
    Represents an LDAP Syntax
- lists
  - lamAsteriskExtList
    Generates the list view.
  - lamBooleanListOption
    Boolean option for list configuration.
  - lamDHCPList
    Generates the list view.
  - lamGroupList
    Generates the list view.
  - lamHostList
    Generates the list view.
  - lamList
    Generates the list view.
  - lamListOption
    Represents a list configuration option.
  - lamListTool
    Represents a tool which can be included in the account lists.
  - lamMailAliasList
    Generates the list view.
  - lamNetgroupList
    Generates the list view.
  - lamSelectListOption
    Boolean option for list configuration.
  - lamSmbDomainList
    Generates the list view.
  - lamUserList
    Generates the list view.
- main
- metaHTML
  - htmlAccountPageButton
    Prints a button for the account pages.
  - htmlButton
    Simple button.
  - htmlDiv
    Creates a simple DIV element.
  - htmlElement
    Represents a HTML element.
  - htmlEqualHeight
    Sets all given elements to the same height.
  - htmlEqualWidth
    Sets all given elements to the same width.
  - htmlFieldset
    Generates a fieldset.
  - htmlGroup
    Groups multiple htmlElements.
  - htmlHelpLink
    Renders a help link.
  - htmlHiddenInput
    Generates a hidden input field.
  - htmlHorizontalLine
    Prints a horizontal line.
  - htmlImage
    Prints the HTML code for an image.
  - htmlInputCheckbox
    Prints the HTML code for a checkbox.
  - htmlInputField
    A standard input field.
  - htmlInputFileUpload
    Prints the HTML code for a file upload field.
  - htmlInputTextarea
    Prints the HTML code for a textarea.
  - htmlJavaScript
    Creates a JavaScript element.
  - htmlLink
    Generates a link.
  - htmlOutputText
    Prints the text and escapes contained HTML code by default.
  - htmlRadio
    Represents a radio selection.
  - htmlSelect
    Represents a select box.
  - htmlSortableList
    Creates a list of elements that can be sorted by the user via drag'n'drop.
  - htmlSpacer
    Adds an empty space with given width and height.
  - htmlStatusMessage
    Prints a status message (e.g. error message).
  - htmlSubTitle
    Generates a subtitle line. This is used to group multiple fields.
  - htmlTable
    Structures elements using a table.
  - htmlTableExtendedInputCheckbox
    Checkbox with descriptive label and help link.
  - htmlTableExtendedInputField
    An extended input field that combines label, input field and help.
  - htmlTableExtendedInputFileUpload
    File upload with descriptive label and help link.
  - htmlTableExtendedInputTextarea
    Text area with label and help link.
  - htmlTableExtendedRadio
    Radio list with descriptive label and help link.
  - htmlTableExtendedSelect
    Select with label and help link.
  - htmlTableRow
    A row inside a htmlTable.
  - htmlTitle
    Generates a title line. This is used for page titles.
- modules
  - account
    Manages the object class "account" for users and hosts.
  - accountContainer
    This class includes all modules and attributes of an account.
  - asteriskAccount
    Manages the Asterisk extension of user accounts.
  - asteriskExtension
    Manages Asterisk extensions.
  - asteriskVoicemail
    Manages the Asterisk extension of user accounts.
  - authorizedServiceObject
    Provides Authorized Service for accounts.
  - baseModule
    Parent class of all account modules.
  - ddns
    Manages DDNS entries.
  - dhcp_settings
    Manages DHCP entries.
  - eduPerson
    Manages the eduPerson extension for user accounts.
  - fixed_ip
    Manages DHCP host entries.
  - freeRadius
    Manages FreeRadius accounts.
  - generalInformation
    Shows general information like the creation time of an account.
  - hostObject
    Manages the hosts to which a user may login.
  - ieee802device
    Provides MAC addresses for hosts.
  - imapAccess
    Manages mailboxes on an IMAP server.
  - inetLocalMailRecipient
    Provides mail routing for users.
  - inetOrgPerson
    This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address).
  - kolabGroup
    Manages Kolab group accounts.
  - kolabUser
    Manages Kolab user accounts.
  - ldapPublicKey
    Manages SSH public keys.
  - nisMailAlias
    Provides NIS mail alias management.
  - nisnetgroup
    Manages entries based on the object class nisNetgroup.
  - passwordService
    This interface needs to be implemented by all account modules which manage passwords.
  - posixAccount
    Manages the object class "posixAccount" for users and hosts.
  - posixGroup
    Manages the object class "posixGroup" for groups.
  - puppetClient
    Manages Puppet configuration options.
  - quota
    Manages quotas for users and groups.
  - range
    Manages DHCP ranges for DHCP server.
  - samba3domain
    Represents a Samba 3 domain entry
  - sambaDomain
    Manages Samba 3 domain entries.
  - sambaGroupMapping
    Manages the object class "sambaGroupMapping" for groups.
  - sambaMungedDial
    Manages terminal server settings for Samba 3.
  - sambaSamAccount
    Manages the object class "sambaSamAccount" for users and hosts.
  - shadowAccount
    Manages the object class "shadowAccount" for users.
  - smbHash
    Calculates NT and LM hashes.
  - systemQuotas
    Manages user quotas with the object class systemQuotas.
  - windowsGroup
    Manages Windows AD (e.g. Samba 4) groups.
  - windowsHost
    Manages Windows AD (e.g. Samba 4) hosts.
  - windowsPosixGroup
    Manages Unix groups in Windows LDAP schema.
  - windowsUser
    Manages Windows AD (e.g. Samba 4) users.
- phpLDAPadmin
- profiles
- selfService
  - selfServiceProfile
    Includes all settings of a self service profile.
- tools
  - LAMSubTool
    Represents a subtool.
  - LAMTool
    Represents a tool.
  - toolFileUpload
    File upload
  - toolOUEditor
    OU editor
  - toolPDFEditor
    PDF editor
  - toolProfileEditor
    Profile editor
  - toolSchemaBrowser
    Schema browser
  - toolServerInformation
    Server information
  - toolTests
    Tests page
- types
  - asteriskExt
    The account type for Asterisk extensions.
  - baseType
    This is the parent class of all account types.
  - dhcp
    The account type for DHCP
  - group
    The account type for group accounts (e.g. Unix and Samba).
  - host
    The account type for host accounts (e.g. Samba).
  - mailAlias
    The account type for mail aliases.
  - netgroup
    The account type for NIS netgroups.
  - smbDomain
    The account type for Samba domains.
  - user
    The account type for user accounts (e.g. Unix, Samba and Kolab).