# LDAP Account Manager

# lib/lists.inc

# Properties

author
package

## Description

This file includes functions to manage the list views.

## Classes

### lamList

# Properties

Extends
Implements
author
Roland Gruber
package
lists
Abstract
No
Final
No

#### Description

Generates the list view.

#### Methods

__construct, addExtraInputElementsToTopArea, buildLDAPAttributeFilter, canBeFiltered, forceRefresh, getAdditionalLDAPAttributesToRead, getAdditionalTools, getFilterAsTextForURL, listBuildFilter, listConfigurationChanged, listCreateSortMapping, listDoPost, listDrawNavigationBar, listGetAllConfigOptions, listGetAttributeDescriptionList, listGetConfigOptionByID, listGetParams, listPrintButtons, listPrintConfigurationPage, listPrintFooter, listPrintHeader, listPrintRedirectMessages, listPrintTableBody, listPrintTableCellContent, listPrintTableHeader, listPrintToolLinks, listReadOptionsFromCookie, listRefreshData, listShowOUSelection, showPDFPage, showPage,

### __construct( string $type, ) : \lamList

#### Description

Constructor

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$type | string | account type |

#### Return value

Type | Description
--- | ---
\lamList | list object

### addExtraInputElementsToTopArea( \htmlGroup $left, \htmlGroup $right, ) : n/a

#### Description

Can be used by subclasses to add e.g. additional buttons to the top area.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$left | \htmlGroup | left part |
$right | \htmlGroup | right part |

#### Return value

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

### buildLDAPAttributeFilter( ) : String

#### Description

Builds the LDAP filter based on the filter entries in the GUI.

#### Return value

Type | Description
--- | ---
String | LDAP filter

### canBeFiltered( String $attr, ) : boolean

#### Description

Returns if the given attribute can be filtered.
If filtering is not possible then no filter box will be displayed. By default all attributes can be filtered.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$attr | String | attribute name |

#### Return value

Type | Description
--- | ---
boolean | filtering possible

### forceRefresh( ) : n/a

#### Description

Forces a refresh of the LDAP data.
Function must be called before $this->refresh option is checked to load new LDAP data (e.g. in listGetParams).

#### Return value

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

### getAdditionalLDAPAttributesToRead( ) : array

#### Description

Returns a list of additional LDAP attributes that should be read.
This can be used to show additional data even if the user selected other attributes to show in the list.

#### Return value

Type | Description
--- | ---
array | additional attribute names

### getAdditionalTools( ) : \lamListTool[]

#### Description

Returns a list of lamListTool objects to display next to the edit/delete buttons.

#### Return value

Type | Description
--- | ---
\lamListTool[] | tools

### getFilterAsTextForURL( ) : String

#### Description

Returns the filter as text to be used as URL parameter.

#### Return value

Type | Description
--- | ---
String | filter text

### listBuildFilter( ) : n/a

#### Description

Builds the regular expressions from the filter values.

#### Return value

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

### listConfigurationChanged( ) : n/a

#### Description

Called when the configuration options changed.

#### Return value

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

### listCreateSortMapping( array $info, ) : n/a

#### Description

Determines the sort mapping and stores it in $this->sortMapping.
The sort mapping is used to display the right rows when the account table is created.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$info | array | the account list |

#### Return value

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

### listDoPost( ) : String

#### Description

Manages all POST actions (e.g. button pressed) for the account lists.

#### Return value

Type | Description
--- | ---
String | HTML fragment to insert into beginning of account list

### listDrawNavigationBar( integer $count, ) : n/a

#### Description

Draws a navigation bar to switch between pages

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$count | integer | number of account entries |

#### Return value

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

### listGetAllConfigOptions( ) : array

#### Description

Returns a list of possible configuration options.

#### Return value

Type | Description
--- | ---
array | list of lamListOption objects

### listGetAttributeDescriptionList( ) : array

#### Description

Returns an hash array containing with all attributes to be shown and their descriptions.
Format: array(attribute => description)

#### Return value

Type | Description
--- | ---
array | attribute list

### listGetConfigOptionByID( String $ID, ) : n/a

#### Description

Returns the configuration option with the given ID.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$ID | String | ID |

#### Return value

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

### listGetParams( ) : n/a

#### Description

Sets some internal parameters.

#### Return value

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

### listPrintButtons( boolean $createOnly, ) : n/a

#### Description

Prints the create and delete buttons.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$createOnly | boolean | true if only the create button should be displayed |

#### Return value

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

### listPrintConfigurationPage( ) : n/a

#### Description

Prints the list configuration page.

#### Return value

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

### listPrintFooter( ) : n/a

#### Description

Prints the HTML footer.

#### Return value

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

### listPrintHeader( ) : n/a

#### Description

Prints the HTML header.

#### Return value

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

### listPrintRedirectMessages( ) : n/a

#### Description

Prints messages when another page (e.g. delete/upload) redirects to the list view.

#### Return value

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

### listPrintTableBody( array $info, ) : n/a

#### Description

Prints the entry list

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$info | array | entries |

#### Return value

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

### listPrintTableCellContent( array $entry, string $attribute, ) : n/a

#### Description

Prints the content of a cell in the account list for a given LDAP entry and attribute.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$entry | array | LDAP attributes |
$attribute | string | attribute name |

#### Return value

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

### listPrintTableHeader( ) : n/a

#### Description

Prints the attribute and filter row at the account table head

#### Return value

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

### listPrintToolLinks( array $account, String $id, ) : n/a

#### Description

Prints the tool image links (e.g. edit and delete) for each account.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$account | array | LDAP attributes |
$id | String | account ID |

#### Return value

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

### listReadOptionsFromCookie( ) : n/a

#### Description

Reads the list options from the cookie value.

#### Return value

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

### listRefreshData( ) : n/a

#### Description

Rereads the entries from LDAP.

#### Return value

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

### listShowOUSelection( ) : \htmlGroup

#### Description

Prints a combobox with possible sub-DNs.

#### Return value

Type | Description
--- | ---
\htmlGroup | OU selection (may be empty)

### showPDFPage( String $id, ) : n/a

#### Description

Shows the page where the user may select the PDF options.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$id | String | account ID |

#### Return value

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

### showPage( ) : n/a

#### Description

Prints the HTML code to display the list view.

#### Return value

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

#### Properties

$attrArray, $configOptions, $descArray, $entries, $filters, $labels, $maxPageEntries, $page, $possibleSuffixes, $refresh, $sortColumn, $sortDirection, $sortMapping, $suffix, $tabindex, $type,

### protected $attrArray = array()

list of LDAP attributes

### private $configOptions =

configuration options

### protected $descArray = array()

list of attribute descriptions

### protected $entries =

LDAP entries

### protected $filters = array()

list of filters (attribute name => filter input)

### protected $labels =

list of account specific labels

### protected $maxPageEntries = 30

maximum count of entries per page

### protected $page = 1

current page number

### protected $possibleSuffixes =

list of possible LDAP suffixes(organizational units)

### protected $refresh = true

refresh page switch

### protected $sortColumn =

sort column name

### protected $sortDirection = 1

sort direction: 1 for ascending, -1 for descending

### protected $sortMapping =

sort mapping for entries array(original index => sorted index)

### protected $suffix =

LDAP suffix

### protected $tabindex = 1

tabindex for GUI elements

### protected $type =

Account type

#### Constants

### LIST_SIZE_OPTION_NAME = "L_SIZE"

ID for list size config option

### VIRTUAL_ATTRIBUTE_PREFIX = 'lam_virtual_'

prefix for virtual (non-LDAP) attributes

### lamListTool

# Properties

Extends
Implements
author
Roland Gruber
package
lists
Abstract
No
Final
No

#### Description

Represents a tool which can be included in the account lists.

#### Methods

__construct, getImage, getLinkTarget, getName,

### __construct( String $name, String $image, String $target, ) : \lamListTool

#### Description

Constructor

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$name | String | tool name |
$image | String | image file |
$target | String | target page |

#### Return value

Type | Description
--- | ---
\lamListTool | tool object

### getImage( ) : String

#### Description

Returns the name of the tool image.
The image is returned without path (e.g. mytool.png). All images must reside in the graphics folder.

#### Return value

Type | Description
--- | ---
String | image name

### getLinkTarget( ) : String

#### Description

Returns the PHP file (relative to 'templates/lists') which will be the target for this tool.
The target page will be opened with two GET parameters: DN and type (e.g. user)

#### Return value

Type | Description
--- | ---
String | page file (e.g. &#039;mytool.php&#039;)

### getName( ) : String

#### Description

Returns the tool name.
This is used for the tool tip.

#### Return value

Type | Description
--- | ---
String | name

#### Properties

$image, $name, $target,

### private $image =

tool image

### private $name =

tool name

### private $target =

link target

### lamListOption

# Properties

Extends
Implements
author
Roland Gruber
package
lists
Abstract
Yes
Final
No

#### Description

Represents a list configuration option.

#### Methods

__construct, fillFromPostData, getID, getMetaHTML, getValue, setValue,

### __construct( String $ID, ) : \lamConfigOption

#### Description

Creates a new config option.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$ID | String | unique ID |

#### Return value

Type | Description
--- | ---
\lamConfigOption | config option

### fillFromPostData( ) : array

#### Description

Fills the config option from POST data.

#### Return value

Type | Description
--- | ---
array | list of StatusMessages (array(&lt;type&gt;, &lt;head line&gt;, &lt;body&gt;))

### getID( ) : String

#### Description

Returns the option ID.

#### Return value

Type | Description
--- | ---
String | ID

### getMetaHTML( ) : \htmlTable

#### Description

Returns the meta HTML data to display this option.

#### Return value

Type | Description
--- | ---
\htmlTable | meta HTML

### getValue( ) : String

#### Description

Returns the option value. The value must not contain "=" and ";".

#### Return value

Type | Description
--- | ---
String | value

### setValue( String $value, ) : n/a

#### Description

Sets the config option value. The value must not contain "=" and ";".

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$value | String |  |

#### Return value

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

#### Properties

$ID, $value,

### private $ID =

unique ID

### private $value =

option value

### lamBooleanListOption

# Properties

Extends
Implements
author
Roland Gruber
package
lists
Abstract
No
Final
No

#### Description

Boolean option for list configuration.

#### Methods

__construct, fillFromPostData, getMetaHTML, isSelected,

### __construct( String $name, String $ID, ) : \lamBooleanListOption

#### Description

Creates a new boolean option.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$name | String | name to show on config page |
$ID | String | unique ID |

#### Return value

Type | Description
--- | ---
\lamBooleanListOption | config option

### fillFromPostData( ) : array

#### Description

Fills the config option from POST data.

#### Return value

Type | Description
--- | ---
array | list of StatusMessages (array(&lt;type&gt;, &lt;head line&gt;, &lt;body&gt;))

### getMetaHTML( ) : \htmlTable

#### Description

Returns the meta HTML data to display this option.

#### Return value

Type | Description
--- | ---
\htmlTable | meta HTML

### isSelected( ) : boolean

#### Description

Returns if this option is selected.

#### Return value

Type | Description
--- | ---
boolean | true, if selected

#### Properties

$name,

### private $name =

option name

### lamSelectListOption

# Properties

Extends
Implements
author
Roland Gruber
package
lists
Abstract
No
Final
No

#### Description

Boolean option for list configuration.

#### Methods

__construct, fillFromPostData, getMetaHTML, setHelpID,

### __construct( String $name, array $options, String $ID, ) : \lamBooleanListOption

#### Description

Creates a new selection list option.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$name | String | name to show on config page |
$options | array | list of possible values |
$ID | String | unique ID |

#### Return value

Type | Description
--- | ---
\lamBooleanListOption | config option

### fillFromPostData( ) : array

#### Description

Fills the config option from POST data.

#### Return value

Type | Description
--- | ---
array | list of StatusMessages (array(&lt;type&gt;, &lt;head line&gt;, &lt;body&gt;))

### getMetaHTML( ) : \htmlTable

#### Description

Returns the meta HTML data to display this option.

#### Return value

Type | Description
--- | ---
\htmlTable | meta HTML

### setHelpID( \Strign $id, ) : n/a

#### Description

Sets the help ID.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$id | \Strign | help ID |

#### Return value

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

#### Properties

$helpID, $name, $options,

### private $helpID =

help ID

### private $name =

option name

### private $options =

possible select options
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).