# LDAP Account Manager

# templates/3rdParty/pla/lib/functions.php

# Properties

author
package

## Description

A collection of common generic functions used throughout the application.

## Functions

### __autoload( $className, ) : n/a

#### Description

Loads class definition

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$className | n/a |  |

#### Return value

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

### array_stripslashes( $array, ) : n/a

#### Description

Strips all slashes from the specified array in place (pass by ref).

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$array | n/a |  |

#### Return value

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

### _( $msg, ) : n/a

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  |

#### Return value

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

### app_error_handler( $errno, $errstr, $file, $lineno, ) : n/a

#### Description

Custom error handling function.
When a PHP error occurs, PHP will call this function rather than printing the typical PHP error string. This provides the application the ability to format an error message so that it looks better. Optionally, it can present a link so that a user can search/submit bugs. This function is not to be called directly. It is exclusively for the use of PHP internally. If this function is called by PHP from within a context where error handling has been disabled (ie, from within a function called with "@" prepended), then this function does nothing.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$errno | n/a |  |
$errstr | n/a |  |
$file | n/a |  |
$lineno | n/a |  |

#### Return value

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

#### Tags

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

### app_name( ) : n/a

#### Description

Returns the application name.

#### Return value

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

### app_version( ) : string

#### Description

Returns the application version currently running. The version is read from the file named VERSION.

#### Return value

Type | Description
--- | ---
string | The current version as read from the VERSION file.

### auto_lang( $lang, ) : n/a

#### Description

This function will convert the browser two character language into the default 5 character language, where the country portion should NOT be assumed to be upper case characters of the first two characters.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$lang | n/a |  |

#### Return value

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

### check_config( $config_file, ) : n/a

#### Description

Makes sure that the config file is properly setup.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$config_file | n/a |  |

#### Return value

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

### cmd_control_pane( $type, ) : array

#### Description

Commands available in the control_panel of the page

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$type | n/a |  |

#### Return value

Type | Description
--- | ---
array |

### debug_dump( $variable, $die = false, $onlydebugaddr = false, ) : n/a

#### Description

This function dumps the $variable for debugging purposes

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$variable | n/a |  |
$die | n/a |  | false
$onlydebugaddr | n/a |  | false

#### Return value

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

### debug_dump_backtrace( $msg = 'Calling BackTrace', $die = false, ) : n/a

#### Description

This function generates a backtrace

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  | 'Calling BackTrace'
$die | n/a |  | false

#### Return value

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

### debug_sysmsg( $msg, ) : n/a

#### Description

Send a debug as a sys message

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  |

#### Return value

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

### debug_log( $msg, $level, $indent, ) : n/a

#### Description

Debug Logging
The global debug level is turned on in your configuration file by setting: `$config->custom->debug['level'] = 255;` together with atleast one output direction (currently file and syslog are supported). `$config->custom->debug['file'] = '/tmp/app_debug.log'; $config->custom->debug['syslog'] = true;` The debug level is turned into binary, then if the message levels bit is on the message will be sent to the debug log. (Thus setting your debug level to 255, all bits on, will results in all messages being printed.) The message level bits are defined here. 0( 1) = Entry/Return results from function calls. 1( 2) = Configuration Processing 2( 4) = Template Processing 3( 8) = Schema Processing 4( 16) = LDAP Server Communication 5( 32) = Tree Processing 7( 64) = Other non generic messages 8(128) = Page Processing 9(256) = Hooks Processing

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  |
$level | n/a |  |
$indent | n/a |  |

#### Return value

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

#### Tags

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

### error( $msg, $type = 'note', $redirect = null, $fatal = false, $backtrace = false, ) : n/a

#### Description

Display an error message in the system message panel of the page.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  |
$type | n/a |  | 'note'
$redirect | n/a |  | null
$fatal | n/a |  | false
$backtrace | n/a |  | false

#### Return value

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

### get_request( $attr, $type = 'POST', $die = false, $default = null, ) : \The

#### Description

Return the result of a form variable, with optional default

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$attr | n/a |  |
$type | n/a |  | 'POST'
$die | n/a |  | false
$default | n/a |  | null

#### Return value

Type | Description
--- | ---
\The | form GET/REQUEST/SESSION/POST variable value or its default

### system_message( $msg, $redirect = null, ) : n/a

#### Description

Record a system message.
This function can be used as an alternative to generate a system message, if page hasnt yet been defined.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  |
$redirect | n/a |  | null

#### Return value

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

### blowfish_encrypt( $data, $secret = null, ) : string

#### Description

Encryption using blowfish algorithm

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$data | n/a |  |
$secret | n/a |  | null

#### Return value

Type | Description
--- | ---
string | The encrypted result

#### Tags

Name | Description
--- | ---
author | lem9 (taken from the phpMyAdmin source)

### blowfish_decrypt( $encdata, $secret = null, ) : string

#### Description

Decryption using blowfish algorithm

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$encdata | n/a |  |
$secret | n/a |  | null

#### Return value

Type | Description
--- | ---
string | Original data

#### Tags

Name | Description
--- | ---
author | lem9 (taken from the phpMyAdmin source)

### full_str_pad( $input, $pad_length, $pad_string = '', $pad_type = 0, ) : string

#### Description

String padding

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$input | n/a |  |
$pad_length | n/a |  |
$pad_string | n/a |  | ''
$pad_type | n/a |  | 0

#### Return value

Type | Description
--- | ---
string | The padded string

### get_cached_item( $index, $item, $subitem = 'null', ) : \Returns

#### Description

Returns the cached array of LDAP resources.
Note that internally, this function utilizes a two-layer cache, one in memory using a static variable for multiple calls within the same page load, and one in a session for multiple calls within the same user session (spanning multiple page loads).

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$index | n/a |  |
$item | n/a |  |
$subitem | n/a |  | 'null'

#### Return value

Type | Description
--- | ---
\Returns | the cached attributed requested, or null if there is nothing cached..

### set_cached_item( $index, $item, $subitem = 'null', $data, ) : n/a

#### Description

Caches the specified $item for the specified $index.
Returns true on success of false on failure.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$index | n/a |  |
$item | n/a |  |
$subitem | n/a |  | 'null'
$data | n/a |  |

#### Return value

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

### del_cached_item( $index, $item, $subitem = 'null', ) : n/a

#### Description

Deletes the cache for a specified $item for the specified $index

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$index | n/a |  |
$item | n/a |  |
$subitem | n/a |  | 'null'

#### Return value

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

### set_cookie( $name, $val, $expire = null, $dir = null, ) : boolean

#### Description

Utility wrapper for setting cookies, which takes into consideration application configuration values. On success, true is returned. On failure, false is returned.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$name | n/a |  |
$val | n/a |  |
$expire | n/a |  | null
$dir | n/a |  | null

#### Return value

Type | Description
--- | ---
boolean |

### get_custom_file( $index, $filename, $path, ) : string

#### Description

Get a customized file for a server We don't need any caching, because it's done by PHP

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$index | n/a |  |
$filename | n/a |  |
$path | n/a |  |

#### Return value

Type | Description
--- | ---
string | The customized filename, if exists, or the standard one

### masort( $data, $sortby, $rev = 0, ) : array

#### Description

Sort a multi dimensional array.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$data | n/a |  |
$sortby | n/a |  |
$rev | n/a |  | 0

#### Return value

Type | Description
--- | ---
array | Sorted multi demension array.

### isCompress( ) : n/a

#### Description

Is compression enabled for output

#### Return value

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

### obfuscate_password_display( $enc = null, ) : boolean

#### Description

Fetches whether the user has configured phpLDAPadmin to obfuscate passwords with "*********" when displaying them.
This is configured in config.php thus: `$config->custom->appearance['obfuscate_password_display'] = true;` Or if it is OK to show encrypted passwords but not clear text passwords `$config->custom->appearance['show_clear_password'] = false;`

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$enc | n/a |  | null

#### Return value

Type | Description
--- | ---
boolean |

### pretty_print_dn( $dn, ) : string

#### Description

Returns an HTML-beautified version of a DN.
Internally, this function makes use of pla_explode_dn() to break the the DN into its components. It then glues them back together with "pretty" HTML. The returned HTML is NOT to be used as a real DN, but simply displayed.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  |

#### Return value

Type | Description
--- | ---
string |

### is_dn_string( $str, ) : boolean

#### Description

Given a string, this function returns true if the string has the format of a DN (ie, looks like "cn=Foo,dc=example,dc=com"). Returns false otherwise.
The purpose of this function is so that developers can examine a string and know if it looks like a DN, and draw a hyperlink as needed. (See unit_test.php for test cases)

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$str | n/a |  |

#### Return value

Type | Description
--- | ---
boolean |

### is_mail_string( $str, ) : boolean

#### Description

Get whether a string looks like an email address (user@example.com).

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$str | n/a |  |

#### Return value

Type | Description
--- | ---
boolean | Returns true if the specified string looks like an email address or false otherwise.

### is_url_string( $str, ) : boolean

#### Description

Get whether a string looks like a web URL (http://www.example.com/)

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$str | n/a |  |

#### Return value

Type | Description
--- | ---
boolean | Returns true if the specified string looks like a web URL or false otherwise.

### pla_compare_dns( $dn1, $dn2, ) : int

#### Description

Compares 2 DNs. If they are equivelant, returns 0, otherwise, returns their sorting order (similar to strcmp()): Returns < 0 if dn1 is less than dn2.
Returns > 0 if dn1 is greater than dn2. The comparison is performed starting with the top-most element of the DN. Thus, the following list: `ou=people,dc=example,dc=com cn=Admin,ou=People,dc=example,dc=com cn=Joe,ou=people,dc=example,dc=com dc=example,dc=com cn=Fred,ou=people,dc=example,dc=org cn=Dave,ou=people,dc=example,dc=org` Will be sorted thus using usort( $list, "pla_compare_dns" ): `dc=com dc=example,dc=com ou=people,dc=example,dc=com cn=Admin,ou=People,dc=example,dc=com cn=Joe,ou=people,dc=example,dc=com cn=Dave,ou=people,dc=example,dc=org cn=Fred,ou=people,dc=example,dc=org`

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn1 | n/a |  |
$dn2 | n/a |  |

#### Return value

Type | Description
--- | ---
int |

### get_next_number( $base, $attr, $increment = false, $filter = false, $startmin = null, ) : int

#### Description

For LDAP servers with auto_number enabled, this function will get the next available number using the host's preferred mechanism (pool or search).
This is configured in config.php by server: `$servers->setValue('auto_number','enable',true|false);` The available mechanisms are: pool: The pool mechanism uses a user-configured entry in the LDAP server to store the last used "number". This mechanism simply fetches and increments and returns that value. search: The search mechanism will search the LDAP server that has the attribute set. It will then find the smallest value and "fills in the gaps" by incrementing the smallest attribute until an unused value is found. NOTE: Both mechanisms do NOT prevent race conditions or toe-stomping, so care must be taken when actually creating the entry to check that the number returned here has not been used in the mean time. Note that the two different mechanisms may (will!) return different values as they use different algorithms to arrive at their result. Do not be alarmed if (when!) this is the case. See config.php.example for more notes on the two mechanisms.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$base | n/a |  |
$attr | n/a |  |
$increment | n/a |  | false
$filter | n/a |  | false
$startmin | n/a |  | null

#### Return value

Type | Description
--- | ---
int |

### get_icon( $server_id, $dn, $object_classes = array(), ) : string

#### Description

Given a DN and server ID, this function reads the DN's objectClasses and determines which icon best represents the entry. The results of this query are cached in a session variable so it is not run every time the tree browser changes, just when exposing new DNs that were not displayed previously. That means we can afford a little bit of inefficiency here in favor of coolness. :)
This function returns a string like "country.png". All icon files are assumed to be contained in the /images/ directory of phpLDAPadmin. Developers are encouraged to add new icons to the images directory and modify this function as needed to suit their types of LDAP entries. If the modifications are general to an LDAP audience, the phpLDAPadmin team will gladly accept them as a patch.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$server_id | n/a |  |
$dn | n/a |  |
$object_classes | n/a |  | array()

#### Return value

Type | Description
--- | ---
string |

### expand_dn_with_base( $base, $sub_dn, ) : string|null

#### Description

Appends a servers base to a "sub" dn or returns the base.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$base | n/a |  |
$sub_dn | n/a |  |

#### Return value

Type | Description
--- | ---
string|null | Returns null if both base is null and sub_dn is null or empty

### random_salt( $length, ) : string

#### Description

Used to generate a random salt for crypt-style passwords. Salt strings are used to make pre-built hash cracking dictionaries difficult to use as the hash algorithm uses not only the user's password but also a randomly generated string. The string is stored as the first N characters of the hash for reference of hashing algorithms later.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$length | n/a |  |

#### Return value

Type | Description
--- | ---
string | The generated salt string.

### get_rdn( $dn, $include_attrs = 0, $decode = false, ) : string

#### Description

Given a DN string, this returns the 'RDN' portion of the string.
For example. given 'cn=Manager,dc=example,dc=com', this function returns 'cn=Manager' (it is really the exact opposite of ds_ldap::getContainer()).

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  |
$include_attrs | n/a |  | 0
$decode | n/a |  | false

#### Return value

Type | Description
--- | ---
string | The RDN

### rdn_explode( $rdn, ) : n/a

#### Description

Split an RDN into its attributes

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$rdn | n/a |  |

#### Return value

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

### pla_verbose_error( $key, ) : array

#### Description

Given an LDAP error number, returns a verbose description of the error.
This function parses ldap_error_codes.txt and looks up the specified ldap error number, and returns the verbose message defined in that file. `Array ( [title] => "Invalid Credentials" [description] => "An invalid username and/or password was supplied to the LDAP server." )`

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$key | n/a |  |

#### Return value

Type | Description
--- | ---
array | An associative array contianing the error title and description like so:

### support_oid_to_text( $key, ) : array

#### Description

Given an LDAP OID number, returns a verbose description of the OID.
This function parses ldap_supported_oids.txt and looks up the specified OID, and returns the verbose message defined in that file. `Array ( [title] => All Operational Attribute [ref] => RFC 3673 [desc] => An LDAP extension which clients may use to request the return of all operational attributes. )`

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$key | n/a |  |

#### Return value

Type | Description
--- | ---
array | An associative array contianing the OID title and description like so:

### ldap_error_msg( $msg, $errnum, ) : n/a

#### Description

Print an LDAP error message

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$msg | n/a |  |
$errnum | n/a |  |

#### Return value

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

### draw_jpeg_photo( $server, $dn, $attr_name = 'jpegphoto', $index, $draw_delete_buttons = false, $options = array(), ) : n/a

#### Description

Draw the jpegPhoto image(s) for an entry wrapped in HTML. Many options are available to specify how the images are to be displayed.
Usage Examples: `draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',"jpegPhoto",0,true,array('img_opts'=>"border: 1px; width: 150px")); draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',null,1);`

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$server | n/a |  |
$dn | n/a |  |
$attr_name | n/a |  | 'jpegphoto'
$index | n/a |  |
$draw_delete_buttons | n/a |  | false
$options | n/a |  | array()

#### Return value

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

### password_types( ) : n/a

#### Description

Return the list of available password types

#### Return value

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

#### Tags

Name | Description
--- | ---
todo | Dynamically work this list out so we only present hashes that we can encrypt

### pla_password_hash( $password_clear, $enc_type, ) : string

#### Description

Hashes a password and returns the hash based on the specified enc_type.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$password_clear | n/a |  |
$enc_type | n/a |  |

#### Return value

Type | Description
--- | ---
string | The hashed password.

### password_check( $cryptedpassword, $plainpassword, $attribute = 'userpassword', ) : Boolean

#### Description

Given a clear-text password and a hash, this function determines if the clear-text password is the password that was used to generate the hash. This is handy to verify a user's password when all that is given is the hash and a "guess".

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$cryptedpassword | n/a |  |
$plainpassword | n/a |  |
$attribute | n/a |  | 'userpassword'

#### Return value

Type | Description
--- | ---
Boolean | True if the clear password matches the hash, and false otherwise.

### get_enc_type( $user_password, ) : string

#### Description

Detects password encryption type
Returns crypto string listed in braces. If it is 'crypt' password, returns crypto detected in password hash. Function should detect md5crypt, blowfish and extended DES crypt. If function fails to detect encryption type, it returns NULL.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$user_password | n/a |  |

#### Return value

Type | Description
--- | ---
string |

### draw_chooser_link( $form, $element, $include_choose_text = true, $rdn = 'none', ) : n/a

#### Description

Draws an HTML browse button which, when clicked, pops up a DN chooser dialog.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$form | n/a |  |
$element | n/a |  |
$include_choose_text | n/a |  | true
$rdn | n/a |  | 'none'

#### Return value

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

### pla_explode_dn( $dn, $with_attributes = 0, ) : array

#### Description

Explode a DN into an array of its RDN parts.
NOTE: When a multivalue RDN is passed to ldap_explode_dn, the results returns with 'value + value'; `Array ( [0] => uid=ppratt [1] => ou=People [2] => dc=example [3] => dc=com )`

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  |
$with_attributes | n/a |  | 0

#### Return value

Type | Description
--- | ---
array | An array of RDN parts of this format:

### dn_escape( $dn, ) : n/a

#### Description

Parse a DN and escape any special characters

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  |

#### Return value

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

### dn_unescape( $dn, ) : n/a

#### Description

Parse a DN and unescape any special characters

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  |

#### Return value

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

### convertHexStringToCharCallback( array $hex, ) : String

#### Description

Converts a hex encoded string like \12 to the corresponding character.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$hex | array | preg_replace_callback: matching hex string array |

#### Return value

Type | Description
--- | ---
String | character

### get_href( $type, $extra_info = '', ) : string

#### Description

Fetches the URL for the specified item. This is a convenience function for fetching project HREFs (like bugs)

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$type | n/a |  |
$extra_info | n/a |  | ''

#### Return value

Type | Description
--- | ---
string | The URL to the requested item.

### utime( ) : double

#### Description

Returns the current time as a double (including micro-seconds).

#### Return value

Type | Description
--- | ---
double | The current time in seconds since the beginning of the UNIX epoch (Midnight Jan. 1, 1970)

### array_to_query_string( $array, $exclude_vars = array(), ) : string

#### Description

Converts an array to a query-string with the option to exclude certain variables from the returned query string. This is convenient if callers want to convert the current GET query string or POST array into a string and replace certain variables with their own.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$array | n/a |  |
$exclude_vars | n/a |  | array()

#### Return value

Type | Description
--- | ---
string | The string created from the array.

### pla_reverse_dn( $dn, ) : string

#### Description

Reverses a DN such that the top-level RDN is first and the bottom-level RDN is last For example: `cn=Brigham,ou=People,dc=example,dc=com` Becomes: `dc=com,dc=example,ou=People,cn=Brigham` This makes it possible to sort lists of DNs such that they are grouped by container.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$dn | n/a |  |

#### Return value

Type | Description
--- | ---
string | The reversed DN

#### Tags

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

### sortAttrs( $a, $b, ) : n/a

#### Description

Attribute sorting

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$a | n/a |  |
$b | n/a |  |

#### Return value

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

### arrayLower( array $array, ) : n/a

#### Description

Reads an array and returns the array values back in lower case

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$array | array | The array to convert the values to lowercase. |

#### Return value

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

#### Tags

Name | Description
--- | ---
returns | array Array with values converted to lowercase.

### draw_formatted_dn( $server, $entry, ) : n/a

#### Description

Gets a DN string using the user-configured tree_display_format string to format it.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$server | n/a |  |
$entry | n/a |  |

#### Return value

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

### server_select_list( $selected = null, $logged_on = false, $name = 'index', $isVisible = true, $js = null, ) : n/a

#### Description

Server html select list

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$selected | n/a |  | null
$logged_on | n/a |  | false
$name | n/a |  | 'index'
$isVisible | n/a |  | true
$js | n/a |  | null

#### Return value

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

### littleEndian( $hex, ) : n/a

#### Description

Converts a little-endian hex-number to one, that 'hexdec' can convert

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$hex | n/a |  |

#### Return value

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

### binSIDtoText( $binsid, ) : n/a

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$binsid | n/a |  |

#### Return value

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

### return_ldap_hash( $base, $filter, $key, $attrs, $sort = true, ) : array

#### Description

Query LDAP and return a hash.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$base | n/a |  |
$filter | n/a |  |
$key | n/a |  |
$attrs | n/a |  |
$sort | n/a |  | true

#### Return value

Type | Description
--- | ---
array | Array of values keyed by $key.

### password_generate( ) : n/a

#### Description

This function returns a string automatically generated based on the criteria defined in the array $criteria in config.php

#### Return value

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

### a_array_rand( $input, $num_req, ) : string

#### Description

This function returns an array of $num_req values randomly picked from the $input array

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$input | n/a |  |
$num_req | n/a |  |

#### Return value

Type | Description
--- | ---
string | The padded string

### random_junk( ) : n/a

#### Description

This is for Opera. By putting "random junk" in the query string, it thinks that it does not have a cached version of the page, and will thus fetch the page rather than display the cached version

#### Return value

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

### htmlid( $sid, $dn, ) : string

#### Description

Returns a HTML id that can be used in the URL after the #.

#### Arguments

Name | Type | Description | Default
--- | --- | --- | ---
$sid | n/a |  |
$dn | n/a |  |

#### Return value

Type | Description
--- | ---
string |

### isAjaxEnabled( ) : n/a

#### Description

Is PLA configured for AJAX display

#### Return value

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

## Constants

### HTDOCDIR = sprintf('%s/', realpath(LIBDIR . '../htdocs/'))

### LANGDIR = sprintf('%s/', realpath(LIBDIR . '../locale/'))

### CONFDIR = sprintf('%s/', realpath(LIBDIR . '../config'))

### QUERYDIR = sprintf('%s/', realpath(LIBDIR . '../queries/'))

### TMPLDIR = sprintf('%s/', realpath(LIBDIR . '../templates/'))

### DOCDIR = sprintf('%s/', realpath(LIBDIR . '../doc/'))

### HOOKSDIR = sprintf('%s/', realpath(LIBDIR . '../hooks/'))

### JSDIR = 'js/'

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).