### Functions

## Returns the version number of this LAM installation.

    LAMVersion() : string

Format: ..
Major/minor version are always numbers, patch level may contain letters for inofficial releases only (e.g. 0.5.alpha1).

### Returns

`string`version number

## This function prints a short status message.

    StatusMessage(string $MessageTyp, string $MessageHeadline, string $MessageText, array $MessageVariables, boolean $returnOutput) : String

It can be used to print INFO, WARN and ERROR messages at the moment.

The headline and text may be formated with special tags:
{bold}, {endbold}: All text between these tags is printed bold.
{color=#123456}, {endcolor}: All text between these tags is printed in the given color.
{link=http://nodomain.org}, {endlink}: A link with the given target is created. The link text is the text between the tags.

### Parameters

#### $MessageTyp

`string`

The type of the message to be printed. It must be one of the following types: 'INFO', 'WARN' or 'ERROR'.
Every other type will lead to an error message indicating an invalid message type.

#### $MessageHeadline

`string`

The headline of the status message.
It may be formatted with special color/link/bold tags.

#### $MessageText

`string`

The text of the status message.
It may be formatted with special color/link/bold tags. This parameter is optional.

#### $MessageVariables

`array`

The variables that are used to replace the spacers (%s) in the submitted text. This parameter is optional.

#### $returnOutput

`boolean`

if set to true this function will return the generated HTML code instead of printing it directly (default: false)

### Returns

`String`HTML code if $returnOutput is set to true, otherwise null

## _()

    _($msg)

### Parameters

#### $msg

## Loads class definition

    __autoload($className)

### Parameters

#### $className

## Fetches the raw schema array for the subschemaSubentry of the server.

    _get_raw_schema(\$schema_to_fetch $schema_to_fetch, \$dn $dn) : \an

Note, this function has grown many hairs to accomodate more LDAP servers. It is needfully complicated as it now supports many popular LDAP servers that don't necessarily expose their schema "the right way".

### Parameters

#### $schema_to_fetch

`\$schema_to_fetch`

- A string indicating which type of schema to fetch. Five valid values: 'objectclasses', 'attributetypes', 'ldapsyntaxes', 'matchingruleuse', or 'matchingrules'. Case insensitive.

#### $dn

`\$dn`

(optional) This paremeter is the DN of the entry whose schema you would like to fetch. Entries have the option of specifying their own subschemaSubentry that points to the DN of the system schema entry which applies to this attribute. If unspecified, this will try to retrieve the schema from the RootDSE subschemaSubentry. Failing that, we use some commonly known schema DNs. Default value is the Root DSE DN (zero-length string)

### Returns

`\an`array of strings of this form: Array ( [0] => "( 1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' DESC 'Pool ... [1] => "( 1.3.6.1.4.1.7165.2.2.3 NAME 'sambaAccount' DESC 'Sa ... etc.

## Helper for _get_raw_schema() which fetches the DN of the schema object in an LDAP server based on a DN.

    _get_schema_dn(string $dn, bool $debug) : string

Entries should set the subSchemaSubEntry attribute pointing to the DN of the server schema. You can specify the DN whose subSchemaSubEntry you wish to retrieve of specify an empty string to fetch the subScehamSubEntry from the Root DSE.

### Parameters

#### $dn

`string`

The DN (may be null) which houses the subschemaSubEntry attribute which this function can use to determine the schema entry's DN.

#### $debug

`bool`

Switch to true to see some nice and copious output. :)

### Returns

`string`The DN of the entry which houses this LDAP server's schema.

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

    a_array_rand(array $input, integer $num_req) : string

### Parameters

#### $input

`array`

Array of values

#### $num_req

`integer`

Number of values in returned array

### Returns

`string`The padded string

## For each attribute that has multiple names, this function adds unique entries to the attrs array for those names.

    add_aliases_to_attrs($attrs)

Ie, attributeType has name 'gn' and 'givenName'. This function will create a unique entry for 'gn' and 'givenName'.

### Parameters

#### $attrs

## Adds a procedure to a hook for later execution.

    add_hook(\hook_name $hook_name, \hook_function $hook_function, \priority $priority, \rollback_function $rollback_function)

### Parameters

#### $hook_name

`\hook_name`

Name of the hook.

#### $hook_function

`\hook_function`

Name of the php function called upon hook trigger.

#### $priority

`\priority`

Numeric priority. Lowest means procedure will be executed before.

#### $rollback_function

`\rollback_function`

Name of the php rollback function called upon failure.

## Adds inherited values to each attributeType specified by the SUP directive.

    add_sup_to_attrs($attrs, $attrs_oid)

Supports infinite levels of inheritance. Bug 856832: require a second paramter that has all attributes indexed by OID

### Parameters

#### $attrs

#### $attrs_oid

## Custom error handling function.

    app_error_handler(int $errno, string $errstr, string $file, int $lineno)

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.

see | \global\set_error_handler

### Parameters

#### $errno

`int`

The PHP error number that occurred (ie, E_ERROR, E_WARNING, E_PARSE, etc).

#### $errstr

`string`

The PHP error string provided (ie, "Warning index "foo" is undefined)

#### $file

`string`

The file in which the PHP error ocurred.

#### $lineno

`int`

The line number on which the PHP error ocurred

## Returns the application name.

    app_name()

## The only function which should be called by a user

    app_session_start() : boolean

see | \global\common.php
see | \global\APP_SESSION_ID

### Returns

`boolean`Returns true if the session was started the first time

## Returns the application version currently running.

    app_version() : string

The version is read from the file named VERSION.

### Returns

`string`The current version as read from the VERSION file.

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

    arrayLower(array $array)

returns | array Array with values converted to lowercase.

### Parameters

#### $array

`array`

The array to convert the values to lowercase.

## This function will return all values from $array without values of $values.

    array_delete(array $values, array $array) : array

### Parameters

#### $values

`array`

list of values which should be removed

#### $array

`array`

list of original values

### Returns

`array`list of remaining values

## array_fill()

    array_fill($start_index, $num, $value)

### Parameters

#### $start_index

#### $num

#### $value

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

    array_stripslashes(Array $array)

### Parameters

#### $array

`Array`

The array to strip slashes from, typically one of $_GET, $_POST, or $_COOKIE.

## Converts an array to a query-string with the option to exclude certain variables from the returned query string.

    array_to_query_string(array $array, array $exclude_vars) : 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.

### Parameters

#### $array

`array`

The associate array to convert whose form is such that the keys are the names of the variables and the values are said variables' values like this: `Array ( [server_id] = 0, [dn] = "dc=example,dc=com", [attr] = "sn" )` This will produce a string like this: "server_id=0&dn=dc=example,dc=com&attr=sn"

#### $exclude_vars

`array`

(optional) An array of variables to exclude in the resulting string

### Returns

`string`The string created from the array.

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

    auto_lang($lang)

### Parameters

#### $lang

## bcpowmod()

    bcpowmod($x, $y, $modulus, $scale)

### Parameters

#### $x

#### $y

#### $modulus

#### $scale

## binSIDtoText()

    binSIDtoText($binsid)

### Parameters

#### $binsid

## Decryption using blowfish algorithm

    blowfish_decrypt(string $encdata, string $secret) : string

author | lem9 (taken from the phpMyAdmin source)

### Parameters

#### $encdata

`string`

Encrypted data

#### $secret

`string`

The secret

### Returns

`string`Original data

## Encryption using blowfish algorithm

    blowfish_encrypt(string $data, string $secret) : string

author | lem9 (taken from the phpMyAdmin source)

### Parameters

#### $data

`string`

Original data

#### $secret

`string`

The secret

### Returns

`string`The encrypted result

## Replace {bold} and {endbold} with <b> and </b> HTML-Tags.

    boldText(string $text) : string

access | private

### Parameters

#### $text

`string`

The text that is used to search for {bold} and {endbold} tags.

### Returns

`string`The submitted text with {bold} and {endbold} replaced with the appropriate HTML tages and

## This function builds the LDAP accounts for the file upload.

    buildUploadAccounts(string $scope, array $data, array $ids, array $selectedModules) : mixed

If there are problems status messages will be printed automatically.

### Parameters

#### $scope

`string`

account type

#### $data

`array`

array containing one account in each element

#### $ids

`array`

array( => )

#### $selectedModules

`array`

selected account modules

### Returns

`mixed`array including accounts or false if there were errors

## build_tree()

    build_tree($server, $dn, $buildtree)

### Parameters

#### $server

#### $dn

#### $buildtree

## Returns true if the schema for $schema_type has been cached and is availble.

    cached_schema_available($schema_type)

$schema_type may be one of (lowercase) the following: objectclasses attributetypes ldapsyntaxes matchingrules matchingruleuse Note that _get_raw_schema() takes a similar parameter.

### Parameters

#### $schema_type

## Checks whether a specific flag in the rights string is set.

    checkChmod(\$right $right, \$target $target, \$chmod $chmod) : \true,

### Parameters

#### $right

`\$right`

read,write or execute

#### $target

`\$target`

owner,group or other

#### $chmod

`\$chmod`

the chmod rights

### Returns

`\true,`if the chmod $right for $target were set

## Checks if the client's IP address is on the list of allowed IPs.

    checkClientIP()

The script is stopped if the host is not valid.

## Checks if the configuration options are valid

    checkConfigOptions(array $scopes, array $options) : array

### Parameters

#### $scopes

`array`

hash array (module name => array(account types))

#### $options

`array`

hash array containing all options (name => array(...))

### Returns

`array`list of error messages

## Checks if it is allowed to delete LDAP entries of the given type.

    checkIfDeleteEntriesIsAllowed(String $scope) : boolean

### Parameters

#### $scope

`String`

account type (e.g. 'user')

### Returns

`boolean`true, if entries may be deleted

## Checks if it is allowed to create new LDAP entries of the given type.

    checkIfNewEntriesAreAllowed(String $scope) : boolean

This also checks if general write access is enabled.

### Parameters

#### $scope

`String`

account type (e.g. 'user')

### Returns

`boolean`true, if new entries are allowed

## Checks if passwords may be changed.

    checkIfPasswordChangeIsAllowed() : boolean

### Returns

`boolean`true, if allowed

## Checks if the given tool is active.

    checkIfToolIsActive(String $tool)

Otherwise, an error message is logged and the execution is stopped (die()).

### Parameters

#### $tool

`String`

tool class name (e.g. toolFileUpload)

## Checks if write access to LDAP is allowed.

    checkIfWriteAccessIsAllowed() : boolean

### Returns

`boolean`true, if allowed

## Checks user input and saves the entered settings.

    checkInput() : array

### Returns

`array`list of errors

## Checks user input and saves the entered settings.

    checkInput() : array

### Returns

`array`list of errors

## Checks user input and saves the entered settings.

    checkInput() : array

### Returns

`array`list of errors

## Checks user input and saves the entered settings.

    checkInput() : array

### Returns

`array`list of errors

## Checks if the password fulfills the password policies.

    checkPasswordStrength(string $password) : mixed

### Parameters

#### $password

`string`

password

### Returns

`mixed`true if ok, string with error message if not valid

## Checks if the profile options are valid

    checkProfileOptions(string $scope, array $options) : array

### Parameters

#### $scope

`string`

account type (user, group, host)

#### $options

`array`

hash array containing all options (name => array(...))

### Returns

`array`list of error messages

## Checks if the object classes and attributes for this module are available.

    checkSchemaForModule(String $name, String $type) : String

### Parameters

#### $name

`String`

module name

#### $type

`String`

type (user, group, ...)

### Returns

`String`error message or null

## Checks if all input values are correct and returns the LDAP commands which should be executed.

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

### Parameters

#### $scope

`string`

account type

#### $fields

`string`

input fields (array( => array(, , ...)))

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

### Returns

`array`messages and LDAP commands (array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array()))

## Checks if the self service settings are valid

    checkSelfServiceSettings(string $scope, array $options, \selfServiceProfile $profile) : array

### Parameters

#### $scope

`string`

account type

#### $options

`array`

hash array containing all options (name => array(...))

#### $profile

`\selfServiceProfile`

profile

### Returns

`array`list of error messages

## Makes sure that the config file is properly setup.

    check_config($config_file)

### Parameters

#### $config_file

## Checks if the given IP is valid.

    check_ip(String $ip, boolean $subnet)

### Parameters

#### $ip

`String`

IP address

#### $subnet

`boolean`

IP must be a subnet

## Checks if there are conflicts between modules

    check_module_conflicts(array $selected, array $deps) : boolean

### Parameters

#### $selected

`array`

selected module names

#### $deps

`array`

module dependencies

### Returns

`boolean`false if no conflict was found, otherwise an array of array(selected module, conflicting module) if conflicts were found

## Checks if there are missing dependencies between modules.

    check_module_depends(array $selected, array $deps) : mixed

### Parameters

#### $selected

`array`

selected module names

#### $deps

`array`

module dependencies

### Returns

`mixed`false if no misssing dependency was found, otherwise an array of array(selected module, depending module) if missing dependencies were found

## Cleans the result of an LDAP search.

    cleanLDAPResult(array $entries)

This will remove all 'count' entries and also all numeric array keys.

### Parameters

#### $entries

`array`

LDAP entries in format $entries[entry number][attribute name][attribute values]

## Removes all procedures from a hook.

    clear_hooks(\hook_name $hook_name)

### Parameters

#### $hook_name

`\hook_name`

Name of hook to clear.

## Commands available in the control_panel of the page

    cmd_control_pane($type) : array

### Parameters

#### $type

### Returns

`array`

## Replace {color=#[HEX-Value]} or {color=[HEX-Value]} and {endcolor} with <font color="#[HEX-Value]"> and </font> HTML-Tags.

    colorText(string $text) : string

access | private

### Parameters

#### $text

`string`

The text that is used to search for {color} and {endcolor} tags.

### Returns

`string`Input string with HTML-formatted color tags

## Helper function to sort DNs.

    compareDN(string $a, string $b) : integer

### Parameters

#### $a

`string`

first argument to compare

#### $b

`string`

second argument to compare

### Returns

`integer`0 if equal, 1 if $a is greater, -1 if $b is greater

## Displays the module selection boxes and checks if dependencies are fulfilled.

    config_showAccountModules(string $scope, string $title, \htmlTable $container)

### Parameters

#### $scope

`string`

account type

#### $title

`string`

title for module selection (e.g. "User modules")

#### $container

`\htmlTable`

meta HTML container

## Checks if the given directory contains files.

    containsFiles(String $dir)

This is used to check if config files need to be migrated.

### Parameters

#### $dir

`String`

directory path

## Converts a HEX string to a binary value

    convertHex2bin(string $value) : \binary

### Parameters

#### $value

`string`

HEX string

### Returns

`\binary`result binary

## Copies account profiles to other server profiles.

    copyAccountProfiles(array $accountProfiles, String $scope, array $dests) : boolean

### Parameters

#### $accountProfiles

`array`

account profile names

#### $scope

`String`

account scope

#### $dests

`array`

destinations

### Returns

`boolean`operation succeeded

## Saves an hash array (attribute => value) to an account profile

    copyConfigTemplates(array $profiles)

### Parameters

#### $profiles

`array`

server profiles

## Copies PDF profiles to other server profiles.

    copyPdfProfiles(array $pdfProfiles, String $scope, array $dests) : boolean

### Parameters

#### $pdfProfiles

`array`

PDF profile names

#### $scope

`String`

account scope

#### $dests

`array`

destinations

### Returns

`boolean`operation succeeded

## copy_dn()

    copy_dn($serverSRC, $serverDST, $dnSRC, $dnDST, $remove)

### Parameters

#### $serverSRC

#### $serverDST

#### $dnSRC

#### $dnDST

#### $remove

## This function creates the PDF output of one or more accounts.

    createModulePDF(array $accounts, string $pdf_structure, \$returnAsString $returnAsString) : String

### Parameters

#### $accounts

`array`

A numbered array containing all accounts the PDF page should be created for. The entries of the array must be AccountContainer objects.

#### $pdf_structure

`string`

The filename of the structure definition that should be used to create the PDF page. If not submitted the 'default.user' structure definition for the appropriate account type.

#### $returnAsString

`\$returnAsString`

returns the PDF output as String value instead of writing it to a file

### Returns

`String`PDF file name

## Generate a random value.

    crypt_random(\optional $min, \optional $max) : Integer

On 32-bit machines, the largest distance that can exist between $min and $max is 2**31. If $min and $max are farther apart than that then the last ($max - range) numbers.

Depending on how this is being used, it may be worth while to write a replacement. For example, a PHP-based web app that stores its data in an SQL database can collect more entropy than this function can.

access | public

### Parameters

#### $min

`\optional`

Integer $min

#### $max

`\optional`

Integer $max

### Returns

`Integer`

## This function dumps the $variable for debugging purposes

    debug_dump(string | array $variable, boolean $die, $onlydebugaddr)

### Parameters

#### $variable

`string` `array`

Variable to dump

#### $die

`boolean`

Whether to stop execution or not.

#### $onlydebugaddr

## This function generates a backtrace

    debug_dump_backtrace(boolean $msg, $die)

### Parameters

#### $msg

`boolean`

Whether to stop execution or not.

#### $die

## Debug Logging

    debug_log(string $msg, int $level, $indent)

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

see | \global\syslog.php

### Parameters

#### $msg

`string`

Message to send to syslog

#### $level

`int`

Log bit number for this message.

#### $indent

## Send a debug as a sys message

    debug_sysmsg($msg)

### Parameters

#### $msg

## Deletes an account profile

    delAccountProfile(string $file, string $scope) : boolean

### Parameters

#### $file

`string`

name of profile (Without . extension)

#### $scope

`string`

account type

### Returns

`boolean`true if profile was deleted

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

    del_cached_item($index, $item, $subitem)

### Parameters

#### $index

#### $item

#### $subitem

## Deletes the given server profile.

    deleteConfigProfile(String $name) : String

### Parameters

#### $name

`String`

profile name

### Returns

`String`null if success or error message if failed

## Deletes a DN and all child entries.

    deleteDN(string $dn) : array

### Parameters

#### $dn

`string`

DN to delete

### Returns

`array`error messages

## Deletes XML file with PDF structure definitions.

    deletePDFStructureDefinition(string $scope, string $definition) : boolean

### Parameters

#### $scope

`string`

account type

#### $definition

`string`

Name of definition to delete

### Returns

`boolean`True if file was deleted or false if a problem occured.

## Simple function to deobfuscate strings.

    deobfuscateText(String $text)

### Parameters

#### $text

`String`

text to deobfuscate

## Print help site for a specific help number.

    displayHelp(array $helpEntry, array $helpVariables)

### Parameters

#### $helpEntry

`array`

The help entry that is to be displayed.

#### $helpVariables

`array`

The help variables that are used to replace the spacer in the help text.

## Displays the login window.

    display_LoginPage(object $config_object)

### Parameters

#### $config_object

`object`

current active configuration

## Displays the main page of the OU editor

    display_main(String $message, String $error)

### Parameters

#### $message

`String`

info message

#### $error

`String`

error message

## display_pla_parse_error()

    display_pla_parse_error($request)

### Parameters

#### $request

## Parse a DN and escape any special characters

    dn_escape($dn)

### Parameters

#### $dn

## Parse a DN and unescape any special characters

    dn_unescape($dn)

### Parameters

#### $dn

## This function executes one post upload action.

    doUploadPostActions(string $scope, array $data, array $ids, array $failed, array $selectedModules, array $accounts) : array

### Parameters

#### $scope

`string`

account type

#### $data

`array`

array containing one account in each element

#### $ids

`array`

array( => )

#### $failed

`array`

list of accounts which were not created successfully

#### $selectedModules

`array`

list of selected account modules

#### $accounts

`array`

list of LDAP entries

### Returns

`array`current status
array (
'status' => 'finished' | 'inProgress'
'module' =>
'progress' => 0..100
'errors' => array ()
)

## Runs any actions that need to be done before an LDAP entry is created.

    doUploadPreActions(String $scope, array $selectedModules, array $attributes) : array

### Parameters

#### $scope

`String`

account type

#### $selectedModules

`array`

list of selected account modules

#### $attributes

`array`

LDAP attributes of this entry (attributes are provided as reference, handle modifications of $attributes with care)

### Returns

`array`array which contains status messages. Each entry is an array containing the status message parameters.

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

    draw_chooser_link(string $form, boolean $element, $include_choose_text, $rdn)

### Parameters

#### $form

`string`

The name of the form element to which this chooser dialog will publish the user's choice. The form element must be a member of a form with the "name" or "id" attribute set in the form tag, and the element must also define "name" or "id" for JavaScript to uniquely identify it. Example $form_element values may include "creation_form.container" or "edit_form.member_uid". See /templates/modification/default.php for example usage.

#### $element

`boolean`

(optional) If true, the function draws the localized text "choose" to the right of the button.

#### $include_choose_text

#### $rdn

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

    draw_formatted_dn($server, $entry)

### Parameters

#### $server

#### $entry

## Draw the jpegPhoto image(s) for an entry wrapped in HTML.

    draw_jpeg_photo(object $server, string $dn, string $attr_name, int $index, boolean $draw_delete_buttons, array $options)

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

### Parameters

#### $server

`object`

The Server to get the image from.

#### $dn

`string`

The DN of the entry that contains the jpeg attribute you want to draw.

#### $attr_name

`string`

The name of the attribute containing the jpeg data (usually 'jpegPhoto').

#### $index

`int`

Index of the attribute to draw

#### $draw_delete_buttons

`boolean`

If true, draws a button beneath the image titled 'Delete' allowing the user to delete the jpeg attribute by calling JavaScript function deleteAttribute() provided in the default modification template.

#### $options

`array`

Specifies optional image and CSS style attributes for the table tag. Supported keys are fixed_width, fixed_height, img_opts.

## Print HTML footer of the help page.

    echoHTMLFoot()

## Print HTML header of the help page.

    echoHTMLHead()

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

    error($msg, $type, $redirect, $fatal, $backtrace)

### Parameters

#### $msg

#### $type

#### $redirect

#### $fatal

#### $backtrace

## Escapes any special characters in an LDAP DN.

    escapeDN(String $dn) : String

### Parameters

#### $dn

`String`

DN

### Returns

`String`escaped DN

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

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

### Parameters

#### $base

`string`

The baseDN to be added if the DN is relative

#### $sub_dn

`string`

The DN to be made absolute

### Returns

`string` `null`Returns null if both base is null and sub_dn is null or empty

## Extracts the DN suffix from a given DN.

    extractDNSuffix(String $dn) : String

E.g. ou=people,dc=test,dc=com will result in dc=test,dc=com.

### Parameters

#### $dn

`String`

DN

### Returns

`String`DN suffix

## Extracts the RDN attribute name from a given DN.

    extractRDNAttribute(String $dn) : String

### Parameters

#### $dn

`String`

DN

### Returns

`String`RDN attribute name

## Extracts the RDN attribute value from a given DN.

    extractRDNValue(String $dn) : String

### Parameters

#### $dn

`String`

DN

### Returns

`String`RDN attribute value

## Formats an LDAP time string (e.g.

    formatLDAPTimestamp(String $time) : String

from createTimestamp).

### Parameters

#### $time

`String`

LDAP time value

### Returns

`String`formated time

## String padding

    full_str_pad(string $input, integer $pad_length, string $pad_string, integer $pad_type) : string

### Parameters

#### $input

`string`

Input string

#### $pad_length

`integer`

Length of the result

#### $pad_string

`string`

The filling string

#### $pad_type

`integer`

Padding mode

### Returns

`string`The padded string

## Generates a random password with 12 digits.

    generateRandomPassword() : String

### Returns

`String`password

## Calculates a password salt of the given legth.

    generateSalt(int $len) : String

### Parameters

#### $len

`int`

salt length

### Returns

`String`the salt string

## Transforms a DN into a more user friendly format.

    getAbstractDN(String $dn) : String

E.g. "dc=company,dc=de" is transformed to "company > de".

### Parameters

#### $dn

`String`

DN

### Returns

`String`transformed DN

## Returns an array of string with all available profiles for the given account type

    getAccountProfiles(string $scope, string $profile) : array

### Parameters

#### $scope

`string`

account type

#### $profile

`string`

server profile name

### Returns

`array`profile names

## This function returns an array with all aviliable logo images.

    getAvailableLogos() : array

### Returns

`array`list of logo files

## Returns an array with all available user module names

    getAvailableModules(string $scope, boolean $mustSupportAdminInterface) : array

### Parameters

#### $scope

`string`

account type (user, group, host)

#### $mustSupportAdminInterface

`boolean`

module must support LAM admin interface (default: false)

### Returns

`array`list of possible modules

## Returns a list of available PDF entries.

    getAvailablePDFFields(string $scope) : array

### Parameters

#### $scope

`string`

account type (user, group, host)

### Returns

`array`PDF entries (field ID => field label)

## Returns the number of child entries of a DN.

    getChildCount(string $dn) : \interger

### Parameters

#### $dn

`string`

DN of parent

### Returns

`\interger`number of childs

## Returns a hash array (module name => elements) of all module options for the configuration page.

    getConfigOptions(array $scopes) : array

### Parameters

#### $scopes

`array`

hash array (module name => array(account types))

### Returns

`array`configuration options

## Returns an array of string with all available configuration profiles (without .conf)

    getConfigProfiles() : array

### Returns

`array`profile names

## Returns the default attribute list for an account type.

    getDefaultListAttributes(string $type) : string

It is used as default value for the configuration editor.

### Parameters

#### $type

`string`

account type

### Returns

`string`attribute list

## Returns a help entry from an account module.

    getHelp(string $module, string $helpID, string $scope) : array

### Parameters

#### $module

`string`

module name

#### $helpID

`string`

help identifier

#### $scope

`string`

account type

### Returns

`array`help entry

## Returns the parameters for a StatusMessage of the last LDAP search.

    getLastLDAPError() : array

### Returns

`array`parameters for StatusMessage or null if all was ok

## Returns a list of attributes which have a translated description.

    getListAttributeDescriptions(string $type) : array

This is used for the head row in the list view.

### Parameters

#### $type

`string`

account type

### Returns

`array`list of descriptions

## Returns the class name for the list object.

    getListClassName(string $type) : string

### Parameters

#### $type

`string`

account type

### Returns

`string`class name

## Returns the alias name of a module

    getModuleAlias(string $name, string $scope) : string

### Parameters

#### $name

`string`

the module name

#### $scope

`string`

the account type ("user", "group", "host")

### Returns

`string`alias name

## Returns a hash array (module name => dependencies) of all module dependencies

    getModulesDependencies(string $scope) : array

"dependencies" contains an array with two sub arrays: depends, conflicts
The elements of "depends" are either module names or an array of module names (OR-case).
The elements of conflicts are module names.

### Parameters

#### $scope

`string`

the account type (user, group, host)

### Returns

`array`dependencies

## getMustAttrs()

    getMustAttrs($oclasses)

### Parameters

#### $oclasses

## This function will return all available PDF structure definitions for the submitted account scope.

    getPDFStructureDefinitions(string $scope, string $profile) : array

### Parameters

#### $scope

`string`

The account scope the PDF structure definitions should be returned.

#### $profile

`string`

server profile name

### Returns

`array`$scope All available PDF structure definitions for the submitted account scope. Each entry is a string being the filename that may be passed to the createModulePDF() function as second argument.

## Returns the elements for the profile page.

    getProfileOptions(string $scope) : array

### Parameters

#### $scope

`string`

account type (user, group, host)

### Returns

`array`profile elements

## Returns a list of LDAP attributes which can be used to form the RDN.

    getRDNAttributes(string $scope, array $selectedModules) : array

The list is already sorted by the priority given by the nodules.

### Parameters

#### $scope

`string`

account type (user, group, host)

#### $selectedModules

`array`

return only RDN attributes of these modules

### Returns

`array`list of LDAP attributes

## Returns the names of all attributes which are managed by the given object class and its parents.

    getRecursiveAttributesFromObjectClass(\ObjectClass $oClass) : array

### Parameters

#### $oClass

`\ObjectClass`

object class

### Returns

`array`list of attribute names

## Returns true if the module is a base module

    getRequiredExtensions() : array

### Returns

`array`required extensions

## Creates a section headline.

    getSectionHeadline(string $line) : string

### Parameters

#### $line

`string`

section name

### Returns

`string`XML code for headline

## Returns the field settings for the self service.

    getSelfServiceFieldSettings(string $scope) : array

### Parameters

#### $scope

`string`

account type

### Returns

`array`settings

## Returns meta HTML code for each self service field.

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

### Parameters

#### $scope

`string`

account type

#### $fields

`array`

input fields (array( => array(, , ...)))

#### $attributes

`array`

LDAP attributes (attribute names in lower case)

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

### Returns

`array`meta HTML code (array( => htmlTableRow))

## Returns a list of all available self service profiles (without .conf)

    getSelfServiceProfiles() : array

### Returns

`array`profile names (array( => array(, , ...)))

## Returns a list of possible search attributes for the self service.

    getSelfServiceSearchAttributes(string $scope) : array

### Parameters

#### $scope

`string`

account type

### Returns

`array`attributes

## Returns a hash array (module name => elements) of all module options for the configuration page.

    getSelfServiceSettings(string $scope, \selfServiceProfile $profile) : array

### Parameters

#### $scope

`string`

account type

#### $profile

`\selfServiceProfile`

currently edited profile

### Returns

`array`configuration options

## Returns the list of supported hash types (e.g.

    getSupportedHashTypes() : array

SSHA).

### Returns

`array`hash types

## Returns the tools which are available for LAM.

    getTools() : array

### Returns

`array`list of LAMtool classes

## Returns the alias name of an account type.

    getTypeAlias(string $type) : string

### Parameters

#### $type

`string`

type name

### Returns

`string`type alias

## Returns the description of an account type.

    getTypeDescription(string $type) : string

### Parameters

#### $type

`string`

type name

### Returns

`string`type description

## Returns a list of available account types.

    getTypes() : array

### Returns

`array`list of types

## Returns an array containing all input columns for the file upload.

    getUploadColumns(string $scope, array $selectedModules) : array

Syntax:
array(
string: name, // fixed non-translated name which is used as column name (should be of format: _)
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
)

### Parameters

#### $scope

`string`

account type

#### $selectedModules

`array`

selected account modules

### Returns

`array`column list

## Returns the cached array of LDAP resources.

    get_cached_item($index, $item, $subitem) : \Returns

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

### Parameters

#### $index

#### $item

#### $subitem

### Returns

`\Returns`the cached attributed requested, or null if there is nothing cached..

## Returns the cached array of schemaitem objects for the specified $schema_type.

    get_cached_schema($schema_type)

For list of valid $schema_type values, see above schema_cache_available(). 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).

Returns an array of SchemaItem objects on success or false on failure.

### Parameters

#### $schema_type

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

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

### Parameters

#### $index

`int`

The ID of the server

#### $filename

`string`

The requested filename

#### $path

### Returns

`string`The customized filename, if exists, or the standard one

## Detects password encryption type

    get_enc_type(string $user_password) : string

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.

### Parameters

#### $user_password

`string`

Hashed password

### Returns

`string`

## Fetches the URL for the specified item.

    get_href(string $type, $extra_info) : string

This is a convenience function for fetching project HREFs (like bugs)

### Parameters

#### $type

`string`

One of "open_bugs", "add_bug", "donate", or "add_rfe" (rfe = request for enhancement)

#### $extra_info

### Returns

`string`The URL to the requested item.

## Given a DN and server ID, this function reads the DN's objectClasses and determines which icon best represents the entry.

    get_icon(string $server_id, $dn, $object_classes) : string

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.

### Parameters

#### $server_id

`string`

The DN of the entry whose icon you wish to fetch.

#### $dn

#### $object_classes

### Returns

`string`

## Returns the LDAP filter used by the account lists

    get_ldap_filter(string $scope) : string

### Parameters

#### $scope

`string`

the account type ("user", "group", "host")

### Returns

`string`LDAP filter

## Helper function for fetching the line end format.

    get_line_end_format() : String

### Returns

`String`'win', 'unix', or 'mac' based on the user's browser..

## For LDAP servers with auto_number enabled, this function will get the next available number using the host's preferred mechanism (pool or search).

    get_next_number(string $base, string $attr, boolean $increment, string $filter, $startmin) : int

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.

### Parameters

#### $base

`string`

Base to start the search from

#### $attr

`string`

Attribute to query

#### $increment

`boolean`

Increment the result (for pool searches)

#### $filter

`string`

LDAP filter to use (for pool searches)

#### $startmin

### Returns

`int`

## Checks if a given value matches the selected regular expression.

    get_preg(string $argument, string $regexp) : boolean

### Parameters

#### $argument

`string`

value to check

#### $regexp

`string`

pattern name

### Returns

`boolean`true if matches, otherwise false

## Given a DN string, this returns the 'RDN' portion of the string.

    get_rdn(string $dn, boolean $include_attrs, $decode) : 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()).

### Parameters

#### $dn

`string`

The DN whose RDN to return.

#### $include_attrs

`boolean`

If true, include attributes in the RDN string. See http://php.net/ldap_explode_dn for details

#### $decode

### Returns

`string`The RDN

## Return the result of a form variable, with optional default

    get_request($attr, $type, $die, $default) : \The

### Parameters

#### $attr

#### $type

#### $die

#### $default

### Returns

`\The`form GET/REQUEST/SESSION/POST variable value or its default

## Gets a single AttributeType object specified by name.

    get_schema_attribute($attr_name, string $dn, $use_cache) : \AttributeType

see | \global\AttributeType
see | \global\get_schema_attributes

### Parameters

#### $attr_name

#### $dn

`string`

(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).

#### $use_cache

### Returns

`\AttributeType`The specified AttributeType object or false on error.

## Gets an associative array of AttributeType objects for the specified server.

    get_schema_attributes(string $dn, $use_cache) : array

Each array entry's key is the name of the attributeType in lower-case and the value is an AttributeType object.

### Parameters

#### $dn

`string`

(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).

#### $use_cache

### Returns

`array`An array of AttributeType objects.

## Returns an array of MatchingRule objects for the specified server.

    get_schema_matching_rules($dn, $use_cache)

The key of each entry is the OID of the matching rule.

### Parameters

#### $dn

#### $use_cache

## Gets a single ObjectClass object specified by name.

    get_schema_objectclass(string $oclass_name, string $dn, $use_cache) : \ObjectClass

see | \global\ObjectClass
see | \global\get_schema_objectclasses

### Parameters

#### $oclass_name

`string`

The name of the objectClass to fetch.

#### $dn

`string`

(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).

#### $use_cache

### Returns

`\ObjectClass`The specified ObjectClass object or false on error.

## Gets an associative array of ObjectClass objects for the specified server.

    get_schema_objectclasses(string $dn, $use_cache) : array

Each array entry's key is the name of the objectClass in lower-case and the value is an ObjectClass object.

see | \global\ObjectClass
see | \global\get_schema_objectclass

### Parameters

#### $dn

`string`

(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).

#### $use_cache

### Returns

`array`An array of ObjectClass objects.

## Returns an array of Syntax objects that this LDAP server uses mapped to their descriptions.

    get_schema_syntaxes($dn, $use_cache)

The key of each entry is the OID of the Syntax.

### Parameters

#### $dn

#### $use_cache

## Gets the USER_AGENT string from the $_SERVER array, all in lower case in an E_NOTICE safe manner.

    get_user_agent_string() : string | false

### Returns

`string` `false`The user agent string as reported by the browser.

## This function will return the days from 1.1.1970 until now.

    getdays() : \number

### Returns

`\number`of days

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

    htmlid(string $sid, $dn) : string

### Parameters

#### $sid

`string`

The DN to pretty-print.

#### $dn

### Returns

`string`

## Checks if a string exists in an array, ignoring case.

    in_array_ignore_case(String $needle, array $haystack)

### Parameters

#### $needle

`String`

search string

#### $haystack

`array`

array

## Checks if the given account type is hidden.

    isAccountTypeHidden(String $type) : boolean

### Parameters

#### $type

`String`

account type (e.g. user)

### Returns

`boolean`is hidden

## Is PLA configured for AJAX display

    isAjaxEnabled()

## Is compression enabled for output

    isCompress()

## Returns if this is a LAM Pro installation.

    isLAMProVersion() : boolean

### Returns

`boolean`LAM Pro installation

## Checks if the given text is obfuscated.

    isObfuscatedText(String $text) : boolean

### Parameters

#### $text

`String`

text to check

### Returns

`boolean`obfuscated or not

## Checks if a service profile is writable.

    isSelfServiceProfileWritable(string $name, string $scope) : boolean

### Parameters

#### $name

`string`

profile name

#### $scope

`string`

account type

### Returns

`boolean`true if file is writable

## Returns true if the module is a base module

    is_base_module(string $name, string $scope) : boolean

### Parameters

#### $name

`string`

the module name

#### $scope

`string`

the account type ("user", "group", "host")

### Returns

`boolean`true if base module

## Determine the OS for the browser

    is_browser($type)

### Parameters

#### $type

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

    is_dn_string(string $str) : boolean

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)

### Parameters

#### $str

`string`

The attribute to examine for "DNness"

### Returns

`boolean`

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

    is_mail_string(string $str) : boolean

### Parameters

#### $str

`string`

The string to analyze.

### Returns

`boolean`Returns true if the specified string looks like an email address or false otherwise.

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

    is_url_string(string $str) : boolean

### Parameters

#### $str

`string`

The string to analyze.

### Returns

`boolean`Returns true if the specified string looks like a web URL or false otherwise.

## Helper function to sort descriptive options in parseHTML().

    lamCompareDescriptiveOptions(array $a, array $b) : integer

It compares the second entries of two arrays.

### Parameters

#### $a

`array`

first array

#### $b

`array`

second array

### Returns

`integer`compare result

## Runs all tests for a given server.

    lamRunLamdaemonTestSuite(String $serverName, String $serverTitle, boolean $testQuota, \htmlTable $container)

### Parameters

#### $serverName

`String`

server ID

#### $serverTitle

`String`

server name

#### $testQuota

`boolean`

true, if Quotas should be checked

#### $container

`\htmlTable`

container for HTML output

## Connects to the given SSH server.

    lamTestConnectSSH(String $server) : object

### Parameters

#### $server

`String`

server name (e.g. localhost or localhost,1234)

### Returns

`object`handle

## Runs a test case of lamdaemon.

    lamTestLamdaemon(string $command, boolean $stopTest, \connection $handle, string $testText, \htmlTable $container) : boolean

### Parameters

#### $command

`string`

test command

#### $stopTest

`boolean`

specifies if test should be run

#### $handle

`\connection`

SSH connection

#### $testText

`string`

describing text

#### $container

`\htmlTable`

container for HTML output

### Returns

`boolean`true, if errors occured

## Sends commands to lamdaemon script.

    lamdaemon(array $command, string $server) : array

### Parameters

#### $command

`array`

command to execute

#### $server

`string`

remote server

### Returns

`array`Output of lamdaemon

## Returns the given DN.

    ldapGetDN(String $dn, array $attributes, \handle $handle) : array

### Parameters

#### $dn

`String`

DN

#### $attributes

`array`

list of attributes to fetch

#### $handle

`\handle`

LDAP handle (optional for admin interface pages)

### Returns

`array`attributes or null if not found

## Print an LDAP error message

    ldap_error_msg($msg, $errnum)

### Parameters

#### $msg

#### $errnum

## Replace {link=[Link-Target]} and {endlink} with <a href="[Link-Target]" target="_blank"> and </a> HTML-Tags.

    linkText(string $text) : string

access | private

### Parameters

#### $text

`string`

The text that is used to search for {link} and {endlink} tags.

### Returns

`string`Input string with HTML-formatted link tags

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

    littleEndian($hex)

### Parameters

#### $hex

## Generates the LM hash of a password.

    lmPassword(string $password) : string

### Parameters

#### $password

`string`

password original password

### Returns

`string`password hash

## Loads an profile of the given account type

    loadAccountProfile(string $profile, string $scope) : array

### Parameters

#### $profile

`string`

name of the profile (without . extension)

#### $scope

`string`

account type

### Returns

`array`hash array (attribute => value)

## This function is used to get pdf structure from xml file.

    loadPDFStructureDefinitions(string $scope, string $pdf_structure) : array

Used in createModulePDF.

### Parameters

#### $scope

`string`

The account scope for wich the PDF structure should be returned.

#### $pdf_structure

`string`

Structure name of selected scope wich should be returned.

### Returns

`array`PDF structure

## Loads all settings of a self service profile.

    loadSelfServiceProfile(string $name, string $scope) : \selfServiceProfile

### Parameters

#### $name

`string`

profile name

#### $scope

`string`

account type

### Returns

`\selfServiceProfile`true if file was readable

## Puts a new message in the log file.

    logNewMessage(string $level, string $message)

### Parameters

#### $level

`string`

log level (LOG_DEBUG, LOG_NOTICE, LOG_WARNING, LOG_ERR)

#### $message

`string`

log message

## Logs off the user and displays the login page.

    logoffAndBackToLoginPage()

## Sort a multi dimensional array.

    masort(array $data, string $sortby, boolean $rev) : array

### Parameters

#### $data

`array`

Multi demension array passed by reference

#### $sortby

`string`

Comma delimited string of sort keys.

#### $rev

`boolean`

Whether to reverse sort.

### Returns

`array`Sorted multi demension array.

## Prints a back button to the page where the user enters a file to upload.

    massPrintBackButton(String $scope, array $selectedModules, \htmlTable $container)

### Parameters

#### $scope

`String`

account type (e.g. user)

#### $selectedModules

`array`

selected modules for upload

#### $container

`\htmlTable`

table container

## Prints a meta refresh page

    metaRefresh(string $page)

### Parameters

#### $page

`string`

the URL of the target page

## mhash()

    mhash($hash_id, $password_clear)

### Parameters

#### $hash_id

#### $password_clear

## mhash_keygen_s2k()

    mhash_keygen_s2k($hash_id, $password_clear, $salt, $bytes)

### Parameters

#### $hash_id

#### $password_clear

#### $salt

#### $bytes

## Generates the NT hash of a password.

    ntPassword(string $password) : string

### Parameters

#### $password

`string`

password original password

### Returns

`string`password hash

## Simple function to obfuscate strings.

    obfuscateText(String $text)

### Parameters

#### $text

`String`

text to obfuscate

## Fetches whether the user has configured phpLDAPadmin to obfuscate passwords with "*********" when displaying them.

    obfuscate_password_display(string $enc) : boolean

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;

### Parameters

#### $enc

`string`

Password encoding type

### Returns

`boolean`

## openssl_hash()

    openssl_hash($openssl_hash_id, $password_clear)

### Parameters

#### $openssl_hash_id

#### $password_clear

## Takes a list of meta-HTML elements and prints the equivalent HTML output.

    parseHtml(string $module, mixed $input, array $values, boolean $restricted, integer $tabindex, string $scope) : array

The modules are not allowed to display HTML code directly but return meta HTML code. This allows to have a common design for all module pages.

### Parameters

#### $module

`string`

Name of account module

#### $input

`mixed`

htmlElement or array of htmlElement elements

#### $values

`array`

List of values which override the defaults in $input (name => value)

#### $restricted

`boolean`

If true then no buttons will be displayed

#### $tabindex

`integer`

Start value of tabulator index for input fields

#### $scope

`string`

Account type

### Returns

`array`List of input field names and their type (name => type)

## Use the three replace functions on the submitted Text.

    parseMessageString(string $MessageString) : string

access | private

### Parameters

#### $MessageString

`string`

The text that is used to search for replaceable strings.

### Returns

`string`The processed text.

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

    password_check(String $cryptedpassword, String $plainpassword, $attribute) : Boolean

This is handy to verify a user's password when all that is given is the hash and a "guess".

### Parameters

#### $cryptedpassword

`String`

The hash.

#### $plainpassword

`String`

The password in clear text to test.

#### $attribute

### Returns

`Boolean`True if the clear password matches the hash, and false otherwise.

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

    password_generate()

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

    password_hash(string $password_clear, string $enc_type) : string

### Parameters

#### $password_clear

`string`

The password to hash in clear text.

#### $enc_type

`string`

Standard LDAP encryption type which must be one of crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.

### Returns

`string`The hashed password.

## Return the list of available password types

    password_types()

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

## php_compat_array_fill()

    php_compat_array_fill($start_index, $num, $value)

### Parameters

#### $start_index

#### $num

#### $value

## php_compat_bcpowmod()

    php_compat_bcpowmod($x, $y, $modulus, $scale)

### Parameters

#### $x

#### $y

#### $modulus

#### $scale

## php_compat_str_split()

    php_compat_str_split($string, $split_length)

### Parameters

#### $string

#### $split_length

## Compares 2 DNs.

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

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

### Parameters

#### $dn1

`string`

The first of two DNs to compare

#### $dn2

`string`

The second of two DNs to compare

### Returns

`int`

## Explode a DN into an array of its RDN parts.

    pla_explode_dn(string $dn, int $with_attributes) : array

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
     )

### Parameters

#### $dn

`string`

The DN to explode.

#### $with_attributes

`int`

(optional) Whether to include attribute names (see http://php.net/ldap_explode_dn for details)

### Returns

`array`An array of RDN parts of this format:

## pla_rdelete()

    pla_rdelete($server, $dn)

### Parameters

#### $server

#### $dn

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

    pla_reverse_dn(string $dn) : string

see | \global\pla_compare_dns
see | \global\pla_explode_dns

### Parameters

#### $dn

`string`

The DN to reverse

### Returns

`string`The reversed DN

## Given an LDAP error number, returns a verbose description of the error.

    pla_verbose_error(string $key) : array

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

### Parameters

#### $key

`string`

The hex error number (ie, "0x42") of the LDAP error of interest.

### Returns

`array`An associative array contianing the error title and description like so:

## Returns an HTML-beautified version of a DN.

    pretty_print_dn(string $dn) : string

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.

### Parameters

#### $dn

`string`

The DN to pretty-print.

### Returns

`string`

## Prints a LAM help link.

    printHelpLink(array $entry, String $number, String $module, String $scope)

### Parameters

#### $entry

`array`

help entry

#### $number

`String`

help number

#### $module

`String`

module name

#### $scope

`String`

account scope

## Processes width, height and alignment attributes.

    processAttributes(string $attrs, array $return) : array

### Parameters

#### $attrs

`string`

attributes

#### $return

`array`

XML code

### Returns

`array`XML code

## Formats the XML code.

    processFormatTags(string $line, string $style) : array

### Parameters

#### $line

`string`

XML code of PDF entry

#### $style

`string`

style commands

### Returns

`array`XML code

## Creates the XML code for an PDF entry.

    processLine(string $line, boolean $first_td, String $fontName) : array

### Parameters

#### $line

`string`

XML code of PDF entry

#### $first_td

`boolean`

True if this is the first column

#### $fontName

`String`

font name

### Returns

`array`XML codes

## Marks an password hash as disabled and returns the new hash string

    pwd_disable(string $hash) : string

### Parameters

#### $hash

`string`

hash value to disable

### Returns

`string`disabled hash value

## Marks an password hash as enabled and returns the new hash string

    pwd_enable(string $hash) : string

### Parameters

#### $hash

`string`

hash value to enable

### Returns

`string`enabled password hash

## Returns the hash value of a plain text password.

    pwd_hash(string $password, boolean $enabled, string $hashType) : string

see | \global\getSupportedHashTypes()

### Parameters

#### $password

`string`

the password string

#### $enabled

`boolean`

marks the hash as enabled/disabled (e.g. by prefixing "!")

#### $hashType

`string`

password hash type (CRYPT, CRYPT-SHA512, SHA, SSHA, MD5, SMD5, PLAIN)

### Returns

`string`the password hash

## Checks if a password hash is enabled/disabled

    pwd_is_enabled(string $hash) : boolean

### Parameters

#### $hash

`string`

password hash to check

### Returns

`boolean`true if the password is marked as enabled

## Checks if a Unix password can be locked.

    pwd_is_lockable(String $password) : boolean

This checks if the password is not plain text but e.g. contains {SSHA}.

### Parameters

#### $password

`String`

password value

### Returns

`boolean`can be locked

## r_copy_dn()

    r_copy_dn($serverSRC, $serverDST, $snapshottree, $dnSRC, $dnDST, $remove)

### Parameters

#### $serverSRC

#### $serverDST

#### $snapshottree

#### $dnSRC

#### $dnDST

#### $remove

## This is for Opera.

    random_junk()

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

## Used to generate a random salt for crypt-style passwords.

    random_salt(int $length) : string

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.

### Parameters

#### $length

`int`

The length of the salt string to generate.

### Returns

`string`The generated salt string.

## Split an RDN into its attributes

    rdn_explode($rdn)

### Parameters

#### $rdn

## Copy a file or recursively copy a directory

    recursiveCopy(string $src, string $dst, array $profiles, string $fileFilter, boolean $overwrite)

### Parameters

#### $src

`string`

- source path to file or directory

#### $dst

`string`

- destination path to file or directory

#### $profiles

`array`

- server profiles (used to avoid copying of newly created folders)

#### $fileFilter

`string`

copy only files that start with the given filter

#### $overwrite

`boolean`

overwrite existing files

## Delete a file or recursively delete a directory

    recursiveDelete(string $src, array $profiles)

### Parameters

#### $src

`string`

- path to file or directory

#### $profiles

`array`

- server profiles (used to avoid copying of newly created folders)

## Removes a procedure from a hook, based on a filter.

    remove_hook(\hook_name $hook_name, \priority $hook_function, \hook_function $priority, \rollback_function $rollback_function)

### Parameters

#### $hook_name

`\hook_name`

Name of the hook.

#### $hook_function

`\priority`

Numeric priority. If set, all procedures of that priority will be removed.

#### $priority

`\hook_function`

Name of the procedure function. If set, all procedures that call this function will be removed.

#### $rollback_function

`\rollback_function`

Name of the php rollback function called upon failure. If set, all procedures that call this function as a rollback will be removed.

## Query LDAP and return a hash.

    return_ldap_hash(string $base, string $filter, string $key, array $attrs, boolean $sort) : array

### Parameters

#### $base

`string`

The base DN to use.

#### $filter

`string`

LDAP Query filter.

#### $key

`string`

LDAP attribute to use as key.

#### $attrs

`array`

Attributes to use as values.

#### $sort

`boolean`

Specify false to not sort results by DN or true to have the returned array sorted by DN (uses ksort) or an array of attribute names to sort by attribute values

### Returns

`array`Array of values keyed by $key.

## Runs procedures attached to a hook.

    run_hook(\hook_name $hook_name, \args $args) : true

### Parameters

#### $hook_name

`\hook_name`

Name of hook to run.

#### $args

`\args`

Array of optional arguments set by phpldapadmin. It is normally in a form known by call_user_func_array() :

    [ 'server_id' => 0, 'dn' => 'uid=epoussa,ou=tech,o=corp,o=fr' ]

### Returns

`true`if all procedures returned true, false otherwise.

## Saves an hash array (attribute => value) to an account profile

    saveAccountProfile(array $attributes, string $profile, string $scope) : boolean

file is created, if needed

### Parameters

#### $attributes

`array`

hash array (attribute => value)

#### $profile

`string`

name of the account profile (without . extension)

#### $scope

`string`

account type

### Returns

`boolean`true, if saving succeeded

## Saves PDF structure definitions to XML file in format: <name>.<scope>.xml

    savePDFStructureDefinitions(string $scope, string $definition) : string

### Parameters

#### $scope

`string`

account type

#### $definition

`string`

Name of definition

### Returns

`string`"no perms" if access denied or "ok".

## Saves a self service profile.

    saveSelfServiceProfile(string $name, string $scope, \selfServiceProfile $profile) : boolean

File is created, if needed

### Parameters

#### $name

`string`

name of the account profile

#### $scope

`string`

account type

#### $profile

`\selfServiceProfile`

self service profile

### Returns

`boolean`true, if saving succeeded

## Runs an LDAP search.

    searchLDAP(String $suffix, String $filter, array $attributes) : array

### Parameters

#### $suffix

`String`

LDAP suffix

#### $filter

`String`

filter

#### $attributes

`array`

list of attributes to return

### Returns

`array`list of found entries

## This will search the given LDAP suffix for all entries which have the given attribute.

    searchLDAPByAttribute(String $name, String $value, String $objectClass, array $attributes, array $scopes) : array

### Parameters

#### $name

`String`

attribute name (may be null)

#### $value

`String`

attribute value

#### $objectClass

`String`

object class (may be null)

#### $attributes

`array`

list of attributes to return

#### $scopes

`array`

account types

### Returns

`array`list of found entries

## This will search the given LDAP suffix for all entries which match the given filter.

    searchLDAPByFilter(String $filter, array $attributes, array $scopes, boolean $attrsOnly) : array

### Parameters

#### $filter

`String`

#### $attributes

`array`

list of attributes to return

#### $scopes

`array`

account types

#### $attrsOnly

`boolean`

get only attributes but no values (default: false)

### Returns

`array`list of found entries

## Returns an array with all Samba 3 domain entries under the given suffix

    search_domains(\handle $server, String $suffix) : array

### Parameters

#### $server

`\handle`

LDAP handle (if null then $_SESSION['ldap']->server() is used)

#### $suffix

`String`

LDAP suffix to search (if null then $_SESSION['config']->get_Suffix('smbDomain') is used)

### Returns

`array`list of samba3domain objects

## Searches LDAP for a specific user name (uid attribute) and returns its DN entry

    search_username(string $name) : string

### Parameters

#### $name

`string`

user name

### Returns

`string`DN

## Sends the password mail.

    sendPasswordMail(String $pwd, array $user, String $recipient) : array

### Parameters

#### $pwd

`String`

new password

#### $user

`array`

LDAP attributes of user

#### $recipient

`String`

recipient address (optional, $user['mail'][0] used by default)

### Returns

`array`list of arrays that can be used to create status messages

## Server html select list

    server_select_list($selected, $logged_on, $name, $isVisible, $js)

### Parameters

#### $selected

#### $logged_on

#### $name

#### $isVisible

#### $js

## Caches the specified $item for the specified $index.

    set_cached_item($index, $item, $subitem, $data)

Returns true on success of false on failure.

### Parameters

#### $index

#### $item

#### $subitem

#### $data

## Caches the specified $schema_type.

    set_cached_schema($schema_type, $schema_items)

$schema_items should be an array of SchemaItem instances (ie, an array of ObjectClass, AttributeType, LDAPSyntax, MatchingRuleUse, or MatchingRule objects.

Returns true on success of false on failure.

### Parameters

#### $schema_type

#### $schema_items

## Utility wrapper for setting cookies, which takes into consideration application configuration values.

    set_cookie(string $name, string $val, int $expire, string $dir) : boolean

On success, true is returned. On failure, false is returned.

### Parameters

#### $name

`string`

The name of the cookie to set.

#### $val

`string`

The value of the cookie to set.

#### $expire

`int`

(optional) The duration in seconds of this cookie. If unspecified, $cookie_time is used from config.php

#### $dir

`string`

(optional) The directory value of this cookie (see php.net/setcookie)

### Returns

`boolean`

## Sets the schema entry for the server_id to be "unavailable" so that we realize that we tried to get the schema but could not, so quit trying next time to fetch it from the server.

    set_schema_cache_unavailable()

## Sets language settings for automatic translation

    setlanguage()

## Displays the acount type specific main page of the upload.

    showMainPage(string $scope, array $selectedModules)

### Parameters

#### $scope

`string`

account type

#### $selectedModules

`array`

list of selected account modules

## Takes a list of Samba flags and creates the corresponding flag string.

    smbflag(array $input) : string

### Parameters

#### $input

`array`

is an array of Samba flags (e.g. X or D)

### Returns

`string`Samba flag string

## Attribute sorting

    sortAttrs($a, $b)

### Parameters

#### $a

#### $b

## Compares two arrays by numerically comparing their 'prority' value.

    sort_array_by_priority(\a $a, \b $b) : \-1

Standard `cmp-like' function.

### Parameters

#### $a

`\a`

First element to compare.

#### $b

`\b`

Second element to compare.

### Returns

`\-1`if priority of first element is smaller than second element priority. 1 otherwise.

## Starts a session and checks the environment.

    startSecureSession(boolean $redirectToLogin) : boolean

The script is stopped if one of the checks fail (timeout redirection may be overriden).

### Parameters

#### $redirectToLogin

`boolean`

redirect user to login page

### Returns

`boolean`true if all ok, false if session expired

## stopwatch()

    stopwatch()

## str_split()

    str_split($string, $split_length)

### Parameters

#### $string

#### $split_length

## Given an LDAP OID number, returns a verbose description of the OID.

    support_oid_to_text(string $key) : array

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

### Parameters

#### $key

`string`

The OID number (ie, "1.3.6.1.4.1.4203.1.5.1") of the OID of interest.

### Returns

`array`An associative array contianing the OID title and description like so:

## Issue a debug message via syslog, only if $log_level is set to 'debug' from the config file.

    syslog_debug(\log_string $log_string) : true

### Parameters

#### $log_string

`\log_string`

Log message to send to syslog.

### Returns

`true`on success or if debug log is not activated.

## Issue an error message via syslog.

    syslog_err(\log_string $log_string) : true

### Parameters

#### $log_string

`\log_string`

Log message to send to syslog.

### Returns

`true`on success.

## Verify that syslog logging is activated in the config via the debug->syslog variable and does a call to the syslog() function is it is true.

    syslog_msg(\emergency $emergency, \log_string $log_string)

### Parameters

#### $emergency

`\emergency`

Syslog emergency.

#### $log_string

`\log_string`

String to log.

## Issue a notice message via syslog.

    syslog_notice(\log_string $log_string) : true

### Parameters

#### $log_string

`\log_string`

Log message to send to syslog.

### Returns

`true`on success.

## Issue a warning message via syslog.

    syslog_warning(\log_string $log_string) : true

### Parameters

#### $log_string

`\log_string`

Log message to send to syslog.

### Returns

`true`on success.

## Record a system message.

    system_message($msg, $redirect)

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

### Parameters

#### $msg

#### $redirect

## Recursively checks the permissions in a directory.

    testPermissionRecursive(String $dir) : array

### Parameters

#### $dir

`String`

directory

### Returns

`array`list of files/directories with wrong permission

## check the write/read permission for the upgrade

    testPermissions() : array

### Returns

`array`- permission messages

## Translates a given field ID (e.g.

    translateFieldIDToName(String $id, String $scope)

inetOrgPerson_givenName) to its descriptive name.

### Parameters

#### $id

`String`

field ID

#### $scope

`String`

account type

## Saves an hash array (attribute => value) to an account profile

    upgradeConfigToServerProfileFolders(array $profiles)

### Parameters

#### $profiles

`array`

server profiles

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

    utime() : double

### Returns

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

### Classes and interfaces

# LAMTool¶

Represents a tool.

« More »

# passwordService¶

This interface needs to be implemented by all account modules which manage passwords.

« More »

# AJAXTree¶

This class implements an AJAX based tree.

« More »

# Attribute¶

Represents an attribute of a template.

« More »

# AttributeFactory¶

AttributeFactory Class

« More »

# AttributeType¶

Represents an LDAP AttributeType

« More »

# AttributeType¶

Represents an LDAP AttributeType

« More »

# BinaryAttribute¶

Represents an attribute whose values are binary

« More »

# Config¶

The config class contains all our configuration settings for a session.

« More »

# Crypt_AES¶

Pure-PHP implementation of AES.

« More »

# Crypt_DES¶

Pure-PHP implementation of DES.

« More »

# Crypt_Hash¶

Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.

« More »

# Crypt_RC4¶

Pure-PHP implementation of RC4.

« More »

# Crypt_RSA¶

Pure-PHP PKCS#1 compliant implementation of RSA.

« More »

# Crypt_Rijndael¶

Pure-PHP implementation of Rijndael.

« More »

# Crypt_TripleDES¶

Pure-PHP implementation of Triple DES.

« More »

# DS¶

This abstract class provides the basic variables and methods.

« More »

# Datastore¶

The list of database sources

« More »

# DateAttribute¶

Represents an attribute whose values are dates

« More »

# DnAttribute¶

Represents an attribute whose values are DNs

« More »

# Export¶

Export Class

« More »

# ExportCSV¶

Export entries to CSV

« More »

# ExportDSML¶

Export entries to DSML v.1

« More »

# ExportLDIF¶

Export from LDAP using an LDIF format

« More »

# ExportVCARD¶

Export entries to VCARD v2.1

« More »

# Exporter¶

Exporter Class

« More »

# FPDF¶

« More »

# GidAttribute¶

Represents a 'gidNumber' attribute

« More »

# HTMLTree¶

This class implements a straight HTML tree - no AJAX rendering is used.

« More »

# Horde_Cipher_blowfish¶

« More »

# Import¶

Import Class

« More »

# ImportLDIF¶

Import entries from LDIF

« More »

# Importer¶

Importer Class

« More »

# JpegAttribute¶

Represents an attribute whose values are jpeg pictures

« More »

# LAMCfgMain¶

This class manages config.cfg.

« More »

# LAMConfig¶

This class manages .conf files.

« More »

# LAMSubTool¶

Represents a subtool.

« More »

# Ldap¶

Ldap manages connection to LDAP and includes several helper functions.

« More »

# MassRender¶

TemplateRender class

« More »

# MatchingRule¶

Represents an LDAP MatchingRule

« More »

# MatchingRule¶

Represents an LDAP MatchingRule

« More »

# MatchingRuleUse¶

Represents an LDAP schema matchingRuleUse entry

« More »

# MatchingRuleUse¶

Represents an LDAP schema matchingRuleUse entry

« More »

# Math_BigInteger¶

Pure-PHP arbitrary precision integer arithmetic library.

« More »

# MultiLineAttribute¶

Represents a attribute whose values are multiline text

« More »

# Net_SFTP¶

Pure-PHP implementations of SFTP.

« More »

# Net_SSH1¶

Pure-PHP implementation of SSHv1.

« More »

# Net_SSH2¶

Pure-PHP implementation of SSHv2.

« More »

# ObjectClass¶

Represents an LDAP objectClass

« More »

# ObjectClass¶

Represents an LDAP objectClass

« More »

# ObjectClassAttribute¶

A simple class for representing AttributeTypes used only by the ObjectClass class.

« More »

# ObjectClassAttribute¶

Represents an 'objectClass' attribute

« More »

# ObjectClass_ObjectClassAttribute¶

A simple class for representing AttributeTypes used only by the ObjectClass class.

« More »

# PageRender¶

PageRender class

« More »

# PasswordAttribute¶

Represents an attribute whose values are passwords

« More »

# Queries¶

Query Class

« More »

# Query¶

Query Class

« More »

# QueryRender¶

QueryRender class

« More »

# RandomPasswordAttribute¶

Represents an attribute whose values are random passwords

« More »

# SambaPasswordAttribute¶

Represents an attribute whose values are SAMBA passwords

« More »

# SchemaItem¶

Generic parent class for all schema items.

« More »

# SchemaItem¶

Generic parent class for all schema items.

« More »

# SelectionAttribute¶

Represents an attribute whose values are in a predefined list

« More »

# ShadowAttribute¶

Represents a shadow date attribute

« More »

# Syntax¶

Represents an LDAP Syntax

« More »

# Syntax¶

Represents an LDAP Syntax

« More »

# Template¶

Template Class

« More »

# TemplateRender¶

TemplateRender class

« More »

# Templates¶

Templates Class

« More »

# Tree¶

Abstract class which represents the LDAP tree view ; the draw() method must be implemented by subclasses

« More »

# TreeItem¶

Represents an item in the tree.

« More »

# UFPDF¶

Main UFPDF class for creating Unicode PDF documents

« More »

# Visitor¶

Abstract Visitor class

« More »

# account¶

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

« More »

# accountContainer¶

This class includes all modules and attributes of an account.

« More »

# asteriskAccount¶

Manages the Asterisk extension of user accounts.

« More »

# asteriskExt¶

The account type for Asterisk extensions.

« More »

# asteriskExtension¶

Manages Asterisk extensions.

« More »

# asteriskVoicemail¶

Manages the Asterisk extension of user accounts.

« More »

# authorizedServiceObject¶

Provides Authorized Service for accounts.

« More »

# baseModule¶

Parent class of all account modules.

« More »

# baseType¶

This is the parent class of all account types.

« More »

# block¶

This class draws a block.

« More »

# ddns¶

Manages DDNS entries.

« More »

# dhcp¶

The account type for DHCP

« More »

# dhcp_settings¶

Manages DHCP entries.

« More »

# eduPerson¶

Manages the eduPerson extension for user accounts.

« More »

# fixed_ip¶

Manages fixed IP addresses.

« More »

# freeRadius¶

Manages FreeRadius accounts.

« More »

# generalInformation¶

Shows general information like the creation time of an account.

« More »

# group¶

The account type for group accounts (e.g.

« More »

# host¶

The account type for host accounts (e.g.

« More »

# hostObject¶

Manages the hosts to which a user may login.

« More »

# htmlAccordion¶

Creates a list of content elements in accordion style.

« More »

# htmlAccountPageButton¶

Prints a button for the account pages.

« More »

# htmlButton¶

Simple button.

« More »

# htmlDiv¶

Creates a simple DIV element.

« More »

# htmlElement¶

Represents a HTML element.

« More »

# htmlEqualHeight¶

Sets all given elements to the same height.

« More »

# htmlEqualWidth¶

Sets all given elements to the same width.

« More »

# htmlFieldset¶

Generates a fieldset.

« More »

# htmlGroup¶

Groups multiple htmlElements.

« More »

# htmlHelpLink¶

Renders a help link.

« More »

# htmlHiddenInput¶

Generates a hidden input field.

« More »

# htmlHorizontalLine¶

Prints a horizontal line.

« More »

# htmlImage¶

Prints the HTML code for an image.

« More »

# htmlInputCheckbox¶

Prints the HTML code for a checkbox.

« More »

# htmlInputField¶

A standard input field.

« More »

# htmlInputFileUpload¶

Prints the HTML code for a file upload field.

« More »

# htmlInputTextarea¶

Prints the HTML code for a textarea.

« More »

# htmlJavaScript¶

Creates a JavaScript element.

« More »

# htmlLink¶

Generates a link.

« More »

# htmlOutputText¶

Prints the text and escapes contained HTML code by default.

« More »

# htmlRadio¶

Represents a radio selection.

« More »

# htmlSelect¶

Represents a select box.

« More »

# htmlSortableList¶

Creates a list of elements that can be sorted by the user via drag'n'drop.

« More »

# htmlSpacer¶

Adds an empty space with given width and height.

« More »

# htmlStatusMessage¶

Prints a status message (e.g.

« More »

# htmlSubTitle¶

Generates a subtitle line.

« More »

# htmlTable¶

Structures elements using a table.

« More »

# htmlTableExtendedInputCheckbox¶

Checkbox with descriptive label and help link.

« More »

# htmlTableExtendedInputField¶

An extended input field that combines label, input field and help.

« More »

# htmlTableExtendedInputFileUpload¶

File upload with descriptive label and help link.

« More »

# htmlTableExtendedInputTextarea¶

Text area with label and help link.

« More »

# htmlTableExtendedRadio¶

Radio list with descriptive label and help link.

« More »

# htmlTableExtendedSelect¶

Select with label and help link.

« More »

# htmlTableRow¶

A row inside a htmlTable.

« More »

# htmlTitle¶

Generates a title line.

« More »

# ieee802device¶

Provides MAC addresses for hosts.

« More »

# imapAccess¶

Manages mailboxes on an IMAP server.

« More »

# inetLocalMailRecipient¶

Provides mail routing for users.

« More »

# inetOrgPerson¶

This module manages LDAP attributes of the object class inetOrgPerson (e.g.

« More »

# kolabUser¶

Manages Kolab user accounts.

« More »

# lamAjax¶

Manages all AJAX requests.

« More »

# lamAsteriskExtList¶

Generates the list view.

« More »

# lamBooleanListOption¶

Boolean option for list configuration.

« More »

# lamDHCPList¶

Generates the list view.

« More »

# lamGroupList¶

Generates the list view.

« More »

# lamHostList¶

Generates the list view.

« More »

# lamList¶

Generates the list view.

« More »

# lamListOption¶

Represents a list configuration option.

« More »

# lamListTool¶

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

« More »

# lamMailAliasList¶

Generates the list view.

« More »

# lamNetgroupList¶

Generates the list view.

« More »

# lamPDF¶

Creates a LAM information page in PDF format.

« More »

# lamSelectListOption¶

Boolean option for list configuration.

« More »

# lamSmbDomainList¶

Generates the list view.

« More »

# lamUserList¶

Generates the list view.

« More »

# ldapPublicKey¶

Manages SSH public keys.

« More »

# ldap_pla¶

This abstract class provides variables and methods for LDAP datastores for use by PLA.

« More »

# mailAlias¶

The account type for mail aliases.

« More »

# moduleCache¶

Caches module objects.

« More »

# myldap¶

This abstract class provides the basic variables and methods for LDAP datastores

« More »

# netgroup¶

The account type for NIS netgroups.

« More »

# nisMailAlias¶

Provides NIS mail alias management.

« More »

# nisnetgroup¶

Manages entries based on the object class nisNetgroup.

« More »

# page¶

This class controls the final output to the browser.

« More »

# posixAccount¶

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

« More »

# posixGroup¶

Manages the object class "posixGroup" for groups.

« More »

# puppetClient¶

Manages Puppet configuration options.

« More »

# quota¶

Manages quotas for users and groups.

« More »

# range¶

Manages DHCP ranges for DHCP server.

« More »

# samba3domain¶

Represents a Samba 3 domain entry

« More »

# sambaDomain¶

Manages Samba 3 domain entries.

« More »

# sambaGroupMapping¶

Manages the object class "sambaGroupMapping" for groups.

« More »

# sambaMungedDial¶

Manages terminal server settings for Samba 3.

« More »

# sambaSamAccount¶

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

« More »

# selfServiceProfile¶

Includes all settings of a self service profile.

« More »

# shadowAccount¶

Manages the object class "shadowAccount" for users.

« More »

# smbDomain¶

The account type for Samba domains.

« More »

# smbHash¶

Calculates NT and LM hashes.

« More »

# smbHash¶

Calculates NT and LM hashes.

« More »

# systemQuotas¶

Manages user quotas with the object class systemQuotas.

« More »

# toolFileUpload¶

File upload

« More »

# toolOUEditor¶

OU editor

« More »

# toolPDFEditor¶

PDF editor

« More »

# toolProfileEditor¶

Profile editor

« More »

# toolSchemaBrowser¶

Schema browser

« More »

# toolServerInformation¶

Server information

« More »

# toolTests¶

Tests page

« More »

# user¶

The account type for user accounts (e.g.

« More »

# windowsGroup¶

Manages Windows AD (e.g.

« More »

# windowsHost¶

Manages Windows AD (e.g.

« More »

# windowsUser¶

Manages Windows AD (e.g.

« More »

# xml2array¶

XML Parser

« More »

# xmlParser¶

Simple XML parser.

« More »

# xmlTemplate¶

XML Template Class

« More »

# xmlTemplates¶

XML Templates Class

« More »

### Constants

## $value

    $value

## $value

    $value

## APPCONFIG

    APPCONFIG

## We will perform some sanity checking here, since this file is normally loaded first when users first access the application.

    APPCONFIG

## CONFDIR

    CONFDIR

## CRYPT_AES_MODE

    CRYPT_AES_MODE

## Encrypt / decrypt using the Code Book Chaining mode.

    CRYPT_AES_MODE_CBC

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29

## Encrypt / decrypt using the Cipher Feedback mode.

    CRYPT_AES_MODE_CFB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29

## Encrypt / decrypt using the Counter mode.

    CRYPT_AES_MODE_CTR

Set to -1 since that's what Crypt/Random.php uses to index the CTR mode.

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29

## Encrypt / decrypt using the Electronic Code Book mode.

    CRYPT_AES_MODE_ECB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29

## Toggles the internal implementation

    CRYPT_AES_MODE_INTERNAL

## Toggles the mcrypt implementation

    CRYPT_AES_MODE_MCRYPT

## Encrypt / decrypt using the Cipher Feedback mode.

    CRYPT_AES_MODE_OFB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29

## Contains array_reverse($keys[CRYPT_DES_ENCRYPT])

    CRYPT_DES_DECRYPT

## Contains array_reverse($keys[CRYPT_DES_DECRYPT])

    CRYPT_DES_ENCRYPT

## CRYPT_DES_MODE

    CRYPT_DES_MODE

## CRYPT_DES_MODE

    CRYPT_DES_MODE

## Encrypt / decrypt using inner chaining

    CRYPT_DES_MODE_3CBC

Inner chaining is used by SSH-1 and is generally considered to be less secure then outer chaining (CRYPT_DES_MODE_CBC3).

## Encrypt / decrypt using the Code Book Chaining mode.

    CRYPT_DES_MODE_CBC

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29

## Encrypt / decrypt using outer chaining

    CRYPT_DES_MODE_CBC3

Outer chaining is used by SSH-2 and when the mode is set to CRYPT_DES_MODE_CBC.

## Encrypt / decrypt using the Cipher Feedback mode.

    CRYPT_DES_MODE_CFB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29

## Encrypt / decrypt using the Counter mode.

    CRYPT_DES_MODE_CTR

Set to -1 since that's what Crypt/Random.php uses to index the CTR mode.

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29

## Encrypt / decrypt using the Electronic Code Book mode.

    CRYPT_DES_MODE_ECB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29

## Toggles the internal implementation

    CRYPT_DES_MODE_INTERNAL

## Toggles the mcrypt implementation

    CRYPT_DES_MODE_MCRYPT

## Encrypt / decrypt using the Cipher Feedback mode.

    CRYPT_DES_MODE_OFB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29

## CRYPT_HASH_MODE

    CRYPT_HASH_MODE

## Toggles the hash() implementation, which works on PHP 5.1.2+.

    CRYPT_HASH_MODE_HASH

## Toggles the internal implementation

    CRYPT_HASH_MODE_INTERNAL

## Toggles the mhash() implementation, which has been deprecated on PHP 5.3.0+.

    CRYPT_HASH_MODE_MHASH

## CRYPT_RC4_DECRYPT

    CRYPT_RC4_DECRYPT

## CRYPT_RC4_ENCRYPT

    CRYPT_RC4_ENCRYPT

## CRYPT_RC4_MODE

    CRYPT_RC4_MODE

## Toggles the internal implementation

    CRYPT_RC4_MODE_INTERNAL

## Toggles the mcrypt implementation

    CRYPT_RC4_MODE_MCRYPT

## Encrypt / decrypt using the Code Book Chaining mode.

    CRYPT_RIJNDAEL_MODE_CBC

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29

## Encrypt / decrypt using the Cipher Feedback mode.

    CRYPT_RIJNDAEL_MODE_CFB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29

## Encrypt / decrypt using the Counter mode.

    CRYPT_RIJNDAEL_MODE_CTR

Set to -1 since that's what Crypt/Random.php uses to index the CTR mode.

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29

## Encrypt / decrypt using the Electronic Code Book mode.

    CRYPT_RIJNDAEL_MODE_ECB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29

## Toggles the internal implementation

    CRYPT_RIJNDAEL_MODE_INTERNAL

## Toggles the mcrypt implementation

    CRYPT_RIJNDAEL_MODE_MCRYPT

## Encrypt / decrypt using the Cipher Feedback mode.

    CRYPT_RIJNDAEL_MODE_OFB

link | http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29

## ASN1 Integer

    CRYPT_RSA_ASN1_INTEGER

## ASN1 Sequence (with the constucted bit set)

    CRYPT_RSA_ASN1_SEQUENCE

## CRYPT_RSA_COMMENT

    CRYPT_RSA_COMMENT

## Use {@link http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding Optimal Asymmetric Encryption Padding} (OAEP) for encryption / decryption.

    CRYPT_RSA_ENCRYPTION_OAEP

Uses sha1 by default.

see | \global\Crypt_RSA::setHash()
see | \global\Crypt_RSA::setMGFHash()

## Use PKCS#1 padding.

    CRYPT_RSA_ENCRYPTION_PKCS1

Although CRYPT_RSA_ENCRYPTION_OAEP offers more security, including PKCS#1 padding is necessary for purposes of backwards compatability with protocols (like SSH-1) written before OAEP's introduction.

## CRYPT_RSA_EXPONENT

    CRYPT_RSA_EXPONENT

## CRYPT_RSA_MODE

    CRYPT_RSA_MODE

## To use the pure-PHP implementation

    CRYPT_RSA_MODE_INTERNAL

## To use the OpenSSL library

    CRYPT_RSA_MODE_OPENSSL

(if enabled; otherwise, the internal implementation will be used)

## PKCS#1 formatted private key

    CRYPT_RSA_PRIVATE_FORMAT_PKCS1

Used by OpenSSH

## PuTTY formatted private key

    CRYPT_RSA_PRIVATE_FORMAT_PUTTY

## XML formatted private key

    CRYPT_RSA_PRIVATE_FORMAT_XML

## OpenSSH formatted public key

    CRYPT_RSA_PUBLIC_FORMAT_OPENSSH

Place in $HOME/.ssh/authorized_keys

## PKCS#1 formatted public key

    CRYPT_RSA_PUBLIC_FORMAT_PKCS1

## Raw public key

    CRYPT_RSA_PUBLIC_FORMAT_RAW

An array containing two Math_BigInteger objects.

The exponent can be indexed with any of the following:

0, e, exponent, publicExponent

The modulus can be indexed with any of the following:

1, n, modulo, modulus

## XML formatted public key

    CRYPT_RSA_PUBLIC_FORMAT_XML

## Use the PKCS#1 scheme by default.

    CRYPT_RSA_SIGNATURE_PKCS1

Although CRYPT_RSA_SIGNATURE_PSS offers more security, including PKCS#1 signing is necessary for purposes of backwards compatability with protocols (like SSH-2) written before PSS's introduction.

## Use the Probabilistic Signature Scheme for signing

    CRYPT_RSA_SIGNATURE_PSS

Uses sha1 by default.

see | \global\Crypt_RSA::setSaltLength()
see | \global\Crypt_RSA::setMGFHash()

## CRYPT_RSA_SMALLEST_PRIME

    CRYPT_RSA_SMALLEST_PRIME

## CSSDIR

    CSSDIR

## CSSDIR

    CSSDIR

## DEBUGTMP

    DEBUGTMP

## DEBUGTMPSUB

    DEBUGTMPSUB

## DEBUG_ENABLED

    DEBUG_ENABLED

## DOCDIR

    DOCDIR

## E_STRICT

    E_STRICT

## FPDF_FONTPATH

    FPDF_FONTPATH

## FPDF_VERSION

    FPDF_VERSION

## HOOKSDIR

    HOOKSDIR

## HTDOCDIR

    HTDOCDIR

## IMGDIR

    IMGDIR

## IMGDIR

    IMGDIR

## JSDIR

    JSDIR

## PDF line width

    LAMPDF_LINEWIDTH

## LANGDIR

    LANGDIR

## LIBDIR

    LIBDIR

## LIBDIR

    LIBDIR

## LIBDIR

    LIBDIR

## MATH_BIGINTEGER_BARRETT

    MATH_BIGINTEGER_BARRETT

see | \global\Math_BigInteger::_barrett()

## MATH_BIGINTEGER_CLASSIC

    MATH_BIGINTEGER_CLASSIC

see | \global\Math_BigInteger::_remainder()

## $cache[MATH_BIGINTEGER_DATA] contains the cached data.

    MATH_BIGINTEGER_DATA

## Karatsuba Cutoff

    MATH_BIGINTEGER_KARATSUBA_CUTOFF

At what point do we switch between Karatsuba multiplication and schoolbook long multiplication?

access | private

## The largest digit that may be used in addition / subtraction

    MATH_BIGINTEGER_MAX_DIGIT52

(we do pow(2, 52) instead of using 4503599627370496, directly, because some PHP installations will truncate 4503599627370496)

access | private

## MATH_BIGINTEGER_MODE

    MATH_BIGINTEGER_MODE

## To use the BCMath library

    MATH_BIGINTEGER_MODE_BCMATH

(if enabled; otherwise, the internal implementation will be used)

## To use the GMP library

    MATH_BIGINTEGER_MODE_GMP

(if present; otherwise, either the BCMath or the internal implementation will be used)

## To use the pure-PHP implementation

    MATH_BIGINTEGER_MODE_INTERNAL

## MATH_BIGINTEGER_MONTGOMERY

    MATH_BIGINTEGER_MONTGOMERY

see | \global\Math_BigInteger::_montgomery()
see | \global\Math_BigInteger::_prepMontgomery()

## MATH_BIGINTEGER_NONE

    MATH_BIGINTEGER_NONE

see | \global\Math_BigInteger::__clone()

## MATH_BIGINTEGER_POWEROF2

    MATH_BIGINTEGER_POWEROF2

see | \global\Math_BigInteger::_mod2()

## $result[MATH_BIGINTEGER_SIGN] contains the sign.

    MATH_BIGINTEGER_SIGN

## $result[MATH_BIGINTEGER_VALUE] contains the value.

    MATH_BIGINTEGER_VALUE

## Cache constants

    MATH_BIGINTEGER_VARIABLE

$cache[MATH_BIGINTEGER_VARIABLE] tells us whether or not the cached data is still valid.

## MHASH_MD5

    MHASH_MD5

## MHASH_RIPEMD160

    MHASH_RIPEMD160

## MHASH_SHA1

    MHASH_SHA1

## SFTP channel constant

    NET_SFTP_CHANNEL

Net_SSH2::exec() uses 0 and Net_SSH2::read() / Net_SSH2::write() use 1.

see | \global\Net_SSH2::_send_channel_packet()
see | \global\Net_SSH2::_get_channel_packet()
access | private

## Reads data from a local file.

    NET_SFTP_LOCAL_FILE

## Returns the message content

    NET_SFTP_LOG_COMPLEX

## Returns the message numbers

    NET_SFTP_LOG_SIMPLE

## Reads data from a string.

    NET_SFTP_STRING

## password authentication

    NET_SSH1_AUTH_PASSWORD

This is the only method that is supported by this library.

## NET_SSH1_AUTH_RHOSTS

    NET_SSH1_AUTH_RHOSTS

## NET_SSH1_AUTH_RHOSTS_RSA

    NET_SSH1_AUTH_RHOSTS_RSA

## pure RSA authentication

    NET_SSH1_AUTH_RSA

## Triple-DES in CBC mode

    NET_SSH1_CIPHER_3DES

All implementations are required to support this

## Blowfish

    NET_SSH1_CIPHER_BLOWFISH

Not supported nor is it defined in the official SSH1 specs. OpenSSH, however, defines it (see cipher.h) and uses it (see cipher.c)

## TRI's Simple Stream encryption CBC

    NET_SSH1_CIPHER_BROKEN_TSS

Not supported nor is it defined in the official SSH1 specs. OpenSSH, however, does define it (see cipher.h), although it doesn't use it (see cipher.c)

## DES in CBC mode

    NET_SSH1_CIPHER_DES

## IDEA in CFB mode

    NET_SSH1_CIPHER_IDEA

Not supported.

## No encryption

    NET_SSH1_CIPHER_NONE

Not supported.

## Returns the message content

    NET_SSH1_LOG_COMPLEX

## Returns the message numbers

    NET_SSH1_LOG_SIMPLE

## NET_SSH1_MASK_CONSTRUCTOR

    NET_SSH1_MASK_CONSTRUCTOR

## NET_SSH1_MASK_LOGIN

    NET_SSH1_MASK_LOGIN

## NET_SSH1_MASK_SHELL

    NET_SSH1_MASK_SHELL

## Returns when a string matching the regular expression $expect is found

    NET_SSH1_READ_REGEX

## Returns when a string matching $expect exactly is found

    NET_SSH1_READ_SIMPLE

## The Response Data

    NET_SSH1_RESPONSE_DATA

see | \global\Net_SSH1::_get_binary_packet()
access | private

## The Response Type

    NET_SSH1_RESPONSE_TYPE

see | \global\Net_SSH1::_get_binary_packet()
access | private

## NET_SSH1_TTY_OP_END

    NET_SSH1_TTY_OP_END

## NET_SSH2_CHANNEL_EXEC

    NET_SSH2_CHANNEL_EXEC

## NET_SSH2_CHANNEL_SHELL

    NET_SSH2_CHANNEL_SHELL

## Returns the message content

    NET_SSH2_LOG_COMPLEX

## Returns the message numbers

    NET_SSH2_LOG_SIMPLE

## NET_SSH2_MASK_CONSTRUCTOR

    NET_SSH2_MASK_CONSTRUCTOR

## NET_SSH2_MASK_LOGIN

    NET_SSH2_MASK_LOGIN

## NET_SSH2_MASK_SHELL

    NET_SSH2_MASK_SHELL

## Returns when a string matching the regular expression $expect is found

    NET_SSH2_READ_REGEX

## Returns when a string matching $expect exactly is found

    NET_SSH2_READ_SIMPLE

## QUERYDIR

    QUERYDIR

## The minimum version of PHP required to run phpLDAPadmin.

    REQUIRED_PHP_VERSION

## File header

    SAMBA_MUNGEDDIAL_FILEHEADER

## File header for old format.

    SAMBA_MUNGEDDIAL_FILEHEADER_OLD

## SCHEMA_SESSION_CACHE_ENABLED

    SCHEMA_SESSION_CACHE_ENABLED

## TMPLDIR

    TMPLDIR

## UFPDF_VERSION

    UFPDF_VERSION