LAMVersion() : string
Format:
Major/minor version are always numbers, patch level may contain letters for inofficial releases only (e.g. 0.5.alpha1).
string
version numberStatusMessage(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.
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.
string
The headline of the status message.
It may be formatted with special color/link/bold tags.
string
The text of the status message.
It may be formatted with special color/link/bold tags. This parameter is optional.
array
The variables that are used to replace the spacers (%s) in the submitted text. This parameter is optional.
boolean
if set to true this function will return the generated HTML code instead of printing it directly (default: false)
String
HTML code if $returnOutput is set to true, otherwise null_($msg)
__autoload($className)
_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".
\$schema_to_fetch
\$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)
\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._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.
string
The DN (may be null) which houses the subschemaSubEntry attribute which this function can use to determine the schema entry's DN.
bool
Switch to true to see some nice and copious output. :)
string
The DN of the entry which houses this LDAP server's schema.a_array_rand(array $input, integer $num_req) : string
array
Array of values
integer
Number of values in returned array
string
The padded stringadd_aliases_to_attrs($attrs)
Ie, attributeType has name 'gn' and 'givenName'. This function will create a unique entry for 'gn' and 'givenName'.
add_hook(\hook_name $hook_name, \hook_function $hook_function, \priority $priority, \rollback_function $rollback_function)
\hook_name
Name of the hook.
\hook_function
Name of the php function called upon hook trigger.
\priority
Numeric priority. Lowest means procedure will be executed before.
\rollback_function
Name of the php rollback function called upon failure.
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
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 |
---|
int
The PHP error number that occurred (ie, E_ERROR, E_WARNING, E_PARSE, etc).
string
The PHP error string provided (ie, "Warning index "foo" is undefined)
string
The file in which the PHP error ocurred.
int
The line number on which the PHP error ocurred
app_name()
app_session_start() : boolean
see | \global\common.php |
---|---|
see | \global\APP_SESSION_ID |
boolean
Returns true if the session was started the first timeapp_version() : string
The version is read from the file named VERSION.
string
The current version as read from the VERSION file.arrayLower(array $array)
returns | array Array with values converted to lowercase. |
---|
array
The array to convert the values to lowercase.
array_delete(array $values, array $array) : array
array
list of values which should be removed
array
list of original values
array
list of remaining valuesarray_fill($start_index, $num, $value)
array_stripslashes(Array $array)
Array
The array to strip slashes from, typically one of $_GET, $_POST, or $_COOKIE.
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.
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"
array
(optional) An array of variables to exclude in the resulting string
string
The string created from the array.auto_lang($lang)
bcpowmod($x, $y, $modulus, $scale)
binSIDtoText($binsid)
blowfish_decrypt(string $encdata, string $secret) : string
author | lem9 (taken from the phpMyAdmin source) |
---|
string
Encrypted data
string
The secret
string
Original datablowfish_encrypt(string $data, string $secret) : string
author | lem9 (taken from the phpMyAdmin source) |
---|
string
Original data
string
The secret
string
The encrypted resultboldText(string $text) : string
access | private |
---|
string
The text that is used to search for {bold} and {endbold} tags.
string
The submitted text with {bold} and {endbold} replaced with the appropriate HTML tages and buildUploadAccounts(string $scope, array $data, array $ids, array $selectedModules) : mixed
If there are problems status messages will be printed automatically.
string
account type
array
array containing one account in each element
array
array(
array
selected account modules
mixed
array including accounts or false if there were errorsbuild_tree($server, $dn, $buildtree)
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.
checkChmod(\$right $right, \$target $target, \$chmod $chmod) : \true,
\$right
read,write or execute
\$target
owner,group or other
\$chmod
the chmod rights
\true,
if the chmod $right for $target were setcheckClientIP()
The script is stopped if the host is not valid.
checkConfigOptions(array $scopes, array $options) : array
array
hash array (module name => array(account types))
array
hash array containing all options (name => array(...))
array
list of error messagescheckIfDeleteEntriesIsAllowed(String $scope) : boolean
String
account type (e.g. 'user')
boolean
true, if entries may be deletedcheckIfNewEntriesAreAllowed(String $scope) : boolean
This also checks if general write access is enabled.
String
account type (e.g. 'user')
boolean
true, if new entries are allowedcheckIfPasswordChangeIsAllowed() : boolean
boolean
true, if allowedcheckIfToolIsActive(String $tool)
Otherwise, an error message is logged and the execution is stopped (die()).
String
tool class name (e.g. toolFileUpload)
checkIfWriteAccessIsAllowed() : boolean
boolean
true, if allowedcheckInput() : array
array
list of errorscheckInput() : array
array
list of errorscheckInput() : array
array
list of errorscheckInput() : array
array
list of errorscheckPasswordStrength(string $password) : mixed
string
password
mixed
true if ok, string with error message if not validcheckProfileOptions(string $scope, array $options) : array
string
account type (user, group, host)
array
hash array containing all options (name => array(...))
array
list of error messagescheckSchemaForModule(String $name, String $type) : String
String
module name
String
type (user, group, ...)
String
error message or nullcheckSelfServiceOptions(string $scope, string $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields) : array
string
account type
string
input fields (array(
array
LDAP attributes
boolean
indicates that the user is only allowed to change his password and no LDAP content is readable
array
list of read-only fields
array
messages and LDAP commands (array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array()))checkSelfServiceSettings(string $scope, array $options, \selfServiceProfile $profile) : array
string
account type
array
hash array containing all options (name => array(...))
array
list of error messagescheck_config($config_file)
check_ip(String $ip, boolean $subnet)
String
IP address
boolean
IP must be a subnet
check_module_conflicts(array $selected, array $deps) : boolean
array
selected module names
array
module dependencies
boolean
false if no conflict was found, otherwise an array of array(selected module, conflicting module) if conflicts were foundcheck_module_depends(array $selected, array $deps) : mixed
array
selected module names
array
module dependencies
mixed
false if no misssing dependency was found, otherwise an array of array(selected module, depending module) if missing dependencies were foundcleanLDAPResult(array $entries)
This will remove all 'count' entries and also all numeric array keys.
array
LDAP entries in format $entries[entry number][attribute name][attribute values]
clear_hooks(\hook_name $hook_name)
\hook_name
Name of hook to clear.
cmd_control_pane($type) : array
array
colorText(string $text) : string
access | private |
---|
string
The text that is used to search for {color} and {endcolor} tags.
string
Input string with HTML-formatted color tagscompareDN(string $a, string $b) : integer
string
first argument to compare
string
second argument to compare
integer
0 if equal, 1 if $a is greater, -1 if $b is greaterconfig_showAccountModules(string $scope, string $title, \htmlTable $container)
string
account type
string
title for module selection (e.g. "User modules")
containsFiles(String $dir)
This is used to check if config files need to be migrated.
String
directory path
convertHex2bin(string $value) : \binary
string
HEX string
\binary
result binarycopyAccountProfiles(array $accountProfiles, String $scope, array $dests) : boolean
array
account profile names
String
account scope
array
destinations
boolean
operation succeededcopyConfigTemplates(array $profiles)
array
server profiles
copyPdfProfiles(array $pdfProfiles, String $scope, array $dests) : boolean
array
PDF profile names
String
account scope
array
destinations
boolean
operation succeededcopy_dn($serverSRC, $serverDST, $dnSRC, $dnDST, $remove)
createModulePDF(array $accounts, string $pdf_structure, \$returnAsString $returnAsString) : String
array
A numbered array containing all accounts the PDF page should be created for. The entries of the array must be AccountContainer objects.
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
returns the PDF output as String value instead of writing it to a file
String
PDF file namecrypt_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 |
---|
\optional
Integer $min
\optional
Integer $max
Integer
debug_dump(string | array $variable, boolean $die, $onlydebugaddr)
string
array
Variable to dump
boolean
Whether to stop execution or not.
debug_dump_backtrace(boolean $msg, $die)
boolean
Whether to stop execution or not.
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 |
---|
string
Message to send to syslog
int
Log bit number for this message.
debug_sysmsg($msg)
delAccountProfile(string $file, string $scope) : boolean
string
name of profile (Without .
string
account type
boolean
true if profile was deleteddel_cached_item($index, $item, $subitem)
deleteConfigProfile(String $name) : String
String
profile name
String
null if success or error message if faileddeleteDN(string $dn) : array
string
DN to delete
array
error messagesdeletePDFStructureDefinition(string $scope, string $definition) : boolean
string
account type
string
Name of definition to delete
boolean
True if file was deleted or false if a problem occured.deobfuscateText(String $text)
String
text to deobfuscate
displayHelp(array $helpEntry, array $helpVariables)
array
The help entry that is to be displayed.
array
The help variables that are used to replace the spacer in the help text.
display_LoginPage(object $config_object)
object
current active configuration
display_main(String $message, String $error)
String
info message
String
error message
display_pla_parse_error($request)
dn_escape($dn)
dn_unescape($dn)
doUploadPostActions(string $scope, array $data, array $ids, array $failed, array $selectedModules, array $accounts) : array
string
account type
array
array containing one account in each element
array
array(
array
list of accounts which were not created successfully
array
list of selected account modules
array
list of LDAP entries
array
current status doUploadPreActions(String $scope, array $selectedModules, array $attributes) : array
String
account type
array
list of selected account modules
array
LDAP attributes of this entry (attributes are provided as reference, handle modifications of $attributes with care)
array
array which contains status messages. Each entry is an array containing the status message parameters.draw_chooser_link(string $form, boolean $element, $include_choose_text, $rdn)
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.
boolean
(optional) If true, the function draws the localized text "choose" to the right of the button.
draw_formatted_dn($server, $entry)
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);
object
The Server to get the image from.
string
The DN of the entry that contains the jpeg attribute you want to draw.
string
The name of the attribute containing the jpeg data (usually 'jpegPhoto').
int
Index of the attribute to draw
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.
array
Specifies optional image and CSS style attributes for the table tag. Supported keys are fixed_width, fixed_height, img_opts.
echoHTMLFoot()
echoHTMLHead()
error($msg, $type, $redirect, $fatal, $backtrace)
escapeDN(String $dn) : String
String
DN
String
escaped DNextractDNSuffix(String $dn) : String
E.g. ou=people,dc=test,dc=com will result in dc=test,dc=com.
String
DN
String
DN suffixextractRDNAttribute(String $dn) : String
String
DN
String
RDN attribute nameextractRDNValue(String $dn) : String
String
DN
String
RDN attribute valueformatLDAPTimestamp(String $time) : String
from createTimestamp).
String
LDAP time value
String
formated timefull_str_pad(string $input, integer $pad_length, string $pad_string, integer $pad_type) : string
string
Input string
integer
Length of the result
string
The filling string
integer
Padding mode
string
The padded stringgenerateRandomPassword() : String
String
passwordgenerateSalt(int $len) : String
int
salt length
String
the salt stringgetAbstractDN(String $dn) : String
E.g. "dc=company,dc=de" is transformed to "company > de".
String
DN
String
transformed DNgetAccountProfiles(string $scope, string $profile) : array
string
account type
string
server profile name
array
profile namesgetAvailableLogos() : array
array
list of logo filesgetAvailableModules(string $scope, boolean $mustSupportAdminInterface) : array
string
account type (user, group, host)
boolean
module must support LAM admin interface (default: false)
array
list of possible modulesgetAvailablePDFFields(string $scope) : array
string
account type (user, group, host)
array
PDF entries (field ID => field label)getChildCount(string $dn) : \interger
string
DN of parent
\interger
number of childsgetConfigOptions(array $scopes) : array
array
hash array (module name => array(account types))
array
configuration optionsgetConfigProfiles() : array
array
profile namesgetDefaultListAttributes(string $type) : string
It is used as default value for the configuration editor.
string
account type
string
attribute listgetHelp(string $module, string $helpID, string $scope) : array
string
module name
string
help identifier
string
account type
array
help entrygetLastLDAPError() : array
array
parameters for StatusMessage or null if all was okgetListAttributeDescriptions(string $type) : array
This is used for the head row in the list view.
string
account type
array
list of descriptionsgetListClassName(string $type) : string
string
account type
string
class namegetModuleAlias(string $name, string $scope) : string
string
the module name
string
the account type ("user", "group", "host")
string
alias namegetModulesDependencies(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.
string
the account type (user, group, host)
array
dependenciesgetMustAttrs($oclasses)
getPDFStructureDefinitions(string $scope, string $profile) : array
string
The account scope the PDF structure definitions should be returned.
string
server profile name
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.getProfileOptions(string $scope) : array
string
account type (user, group, host)
array
profile elementsgetRDNAttributes(string $scope, array $selectedModules) : array
The list is already sorted by the priority given by the nodules.
string
account type (user, group, host)
array
return only RDN attributes of these modules
array
list of LDAP attributesgetRecursiveAttributesFromObjectClass(\ObjectClass $oClass) : array
getRequiredExtensions() : array
array
required extensionsgetSectionHeadline(string $line) : string
string
section name
string
XML code for headlinegetSelfServiceFieldSettings(string $scope) : array
string
account type
array
settingsgetSelfServiceOptions(string $scope, array $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields) : array
string
account type
array
input fields (array(
array
LDAP attributes (attribute names in lower case)
boolean
indicates that the user is only allowed to change his password and no LDAP content is readable
array
list of read-only fields
array
meta HTML code (array(getSelfServiceProfiles() : array
array
profile names (array(getSelfServiceSearchAttributes(string $scope) : array
string
account type
array
attributesgetSelfServiceSettings(string $scope, \selfServiceProfile $profile) : array
string
account type
array
configuration optionsgetSupportedHashTypes() : array
SSHA).
array
hash typesgetTools() : array
array
list of LAMtool classesgetTypeAlias(string $type) : string
string
type name
string
type aliasgetTypeDescription(string $type) : string
string
type name
string
type descriptiongetTypes() : array
array
list of typesgetUploadColumns(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
)
string
account type
array
selected account modules
array
column listget_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).
\Returns
the cached attributed requested, or null if there is nothing cached..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.
get_custom_file(int $index, string $filename, $path) : string
int
The ID of the server
string
The requested filename
string
The customized filename, if exists, or the standard oneget_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.
string
Hashed password
string
get_href(string $type, $extra_info) : string
This is a convenience function for fetching project HREFs (like bugs)
string
One of "open_bugs", "add_bug", "donate", or "add_rfe" (rfe = request for enhancement)
string
The URL to the requested item.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.
string
The DN of the entry whose icon you wish to fetch.
string
get_ldap_filter(string $scope) : string
string
the account type ("user", "group", "host")
string
LDAP filterget_line_end_format() : String
String
'win', 'unix', or 'mac' based on the user's browser..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.
string
Base to start the search from
string
Attribute to query
boolean
Increment the result (for pool searches)
string
LDAP filter to use (for pool searches)
int
get_preg(string $argument, string $regexp) : boolean
string
value to check
string
pattern name
boolean
true if matches, otherwise falseget_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()).
string
The DN whose RDN to return.
boolean
If true, include attributes in the RDN string. See http://php.net/ldap_explode_dn for details
string
The RDNget_request($attr, $type, $die, $default) : \The
\The
form GET/REQUEST/SESSION/POST variable value or its defaultget_schema_attribute($attr_name, string $dn, $use_cache) : \AttributeType
see | \global\AttributeType |
---|---|
see | \global\get_schema_attributes |
string
(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).
\AttributeType
The specified AttributeType object or false on error.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.
string
(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).
array
An array of AttributeType objects.get_schema_matching_rules($dn, $use_cache)
The key of each entry is the OID of the matching rule.
get_schema_objectclass(string $oclass_name, string $dn, $use_cache) : \ObjectClass
see | \global\ObjectClass |
---|---|
see | \global\get_schema_objectclasses |
string
The name of the objectClass to fetch.
string
(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).
\ObjectClass
The specified ObjectClass object or false on error.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 |
string
(optional) It is easier to fetch schema if a DN is provided which defines the subschemaSubEntry attribute (all entries should).
array
An array of ObjectClass objects.get_schema_syntaxes($dn, $use_cache)
The key of each entry is the OID of the Syntax.
get_user_agent_string() : string | false
string
false
The user agent string as reported by the browser.getdays() : \number
\number
of dayshtmlid(string $sid, $dn) : string
string
The DN to pretty-print.
string
in_array_ignore_case(String $needle, array $haystack)
String
search string
array
array
isAccountTypeHidden(String $type) : boolean
String
account type (e.g. user)
boolean
is hiddenisAjaxEnabled()
isCompress()
isLAMProVersion() : boolean
boolean
LAM Pro installationisObfuscatedText(String $text) : boolean
String
text to check
boolean
obfuscated or notisSelfServiceProfileWritable(string $name, string $scope) : boolean
string
profile name
string
account type
boolean
true if file is writableis_base_module(string $name, string $scope) : boolean
string
the module name
string
the account type ("user", "group", "host")
boolean
true if base moduleis_browser($type)
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)
string
The attribute to examine for "DNness"
boolean
is_mail_string(string $str) : boolean
string
The string to analyze.
boolean
Returns true if the specified string looks like an email address or false otherwise.is_url_string(string $str) : boolean
string
The string to analyze.
boolean
Returns true if the specified string looks like a web URL or false otherwise.lamCompareDescriptiveOptions(array $a, array $b) : integer
It compares the second entries of two arrays.
array
first array
array
second array
integer
compare resultlamRunLamdaemonTestSuite(String $serverName, String $serverTitle, boolean $testQuota, \htmlTable $container)
String
server ID
String
server name
boolean
true, if Quotas should be checked
lamTestConnectSSH(String $server) : object
String
server name (e.g. localhost or localhost,1234)
object
handlelamTestLamdaemon(string $command, boolean $stopTest, \connection $handle, string $testText, \htmlTable $container) : boolean
string
test command
boolean
specifies if test should be run
\connection
SSH connection
string
describing text
boolean
true, if errors occuredlamdaemon(array $command, string $server) : array
array
command to execute
string
remote server
array
Output of lamdaemonldapGetDN(String $dn, array $attributes, \handle $handle) : array
String
DN
array
list of attributes to fetch
\handle
LDAP handle (optional for admin interface pages)
array
attributes or null if not foundldap_error_msg($msg, $errnum)
linkText(string $text) : string
access | private |
---|
string
The text that is used to search for {link} and {endlink} tags.
string
Input string with HTML-formatted link tagslittleEndian($hex)
lmPassword(string $password) : string
string
password original password
string
password hashloadAccountProfile(string $profile, string $scope) : array
string
name of the profile (without .
string
account type
array
hash array (attribute => value)loadPDFStructureDefinitions(string $scope, string $pdf_structure) : array
Used in createModulePDF.
string
The account scope for wich the PDF structure should be returned.
string
Structure name of selected scope wich should be returned.
array
PDF structureloadSelfServiceProfile(string $name, string $scope) : \selfServiceProfile
string
profile name
string
account type
\selfServiceProfile
true if file was readablelogNewMessage(string $level, string $message)
string
log level (LOG_DEBUG, LOG_NOTICE, LOG_WARNING, LOG_ERR)
string
log message
logoffAndBackToLoginPage()
masort(array $data, string $sortby, boolean $rev) : array
array
Multi demension array passed by reference
string
Comma delimited string of sort keys.
boolean
Whether to reverse sort.
array
Sorted multi demension array.massPrintBackButton(String $scope, array $selectedModules, \htmlTable $container)
String
account type (e.g. user)
array
selected modules for upload
mhash($hash_id, $password_clear)
mhash_keygen_s2k($hash_id, $password_clear, $salt, $bytes)
ntPassword(string $password) : string
string
password original password
string
password hashobfuscateText(String $text)
String
text to obfuscate
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;
string
Password encoding type
boolean
openssl_hash($openssl_hash_id, $password_clear)
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.
string
Name of account module
mixed
htmlElement or array of htmlElement elements
array
List of values which override the defaults in $input (name => value)
boolean
If true then no buttons will be displayed
integer
Start value of tabulator index for input fields
string
Account type
array
List of input field names and their type (name => type)parseMessageString(string $MessageString) : string
access | private |
---|
string
The text that is used to search for replaceable strings.
string
The processed text.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".
String
The hash.
String
The password in clear text to test.
Boolean
True if the clear password matches the hash, and false otherwise.password_generate()
password_hash(string $password_clear, string $enc_type) : string
string
The password to hash in clear text.
string
Standard LDAP encryption type which must be one of crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
string
The hashed password.password_types()
todo | Dynamically work this list out so we only present hashes that we can encrypt |
---|
php_compat_array_fill($start_index, $num, $value)
php_compat_bcpowmod($x, $y, $modulus, $scale)
php_compat_str_split($string, $split_length)
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
string
The first of two DNs to compare
string
The second of two DNs to compare
int
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
)
string
The DN to explode.
int
(optional) Whether to include attribute names (see http://php.net/ldap_explode_dn for details)
array
An array of RDN parts of this format:pla_rdelete($server, $dn)
pla_reverse_dn(string $dn) : string
see | \global\pla_compare_dns |
---|---|
see | \global\pla_explode_dns |
string
The DN to reverse
string
The reversed DNpla_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."
)
string
The hex error number (ie, "0x42") of the LDAP error of interest.
array
An associative array contianing the error title and description like so: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.
string
The DN to pretty-print.
string
printHelpLink(array $entry, String $number, String $module, String $scope)
array
help entry
String
help number
String
module name
String
account scope
processAttributes(string $attrs, array $return) : array
string
attributes
array
XML code
array
XML codeprocessFormatTags(string $line, string $style) : array
string
XML code of PDF entry
string
style commands
array
XML codeprocessLine(string $line, boolean $first_td, String $fontName) : array
string
XML code of PDF entry
boolean
True if this is the first column
String
font name
array
XML codespwd_disable(string $hash) : string
string
hash value to disable
string
disabled hash valuepwd_enable(string $hash) : string
string
hash value to enable
string
enabled password hashpwd_hash(string $password, boolean $enabled, string $hashType) : string
see | \global\getSupportedHashTypes() |
---|
string
the password string
boolean
marks the hash as enabled/disabled (e.g. by prefixing "!")
string
password hash type (CRYPT, CRYPT-SHA512, SHA, SSHA, MD5, SMD5, PLAIN)
string
the password hashpwd_is_enabled(string $hash) : boolean
string
password hash to check
boolean
true if the password is marked as enabledpwd_is_lockable(String $password) : boolean
This checks if the password is not plain text but e.g. contains {SSHA}.
String
password value
boolean
can be lockedr_copy_dn($serverSRC, $serverDST, $snapshottree, $dnSRC, $dnDST, $remove)
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
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.
int
The length of the salt string to generate.
string
The generated salt string.rdn_explode($rdn)
recursiveCopy(string $src, string $dst, array $profiles, string $fileFilter, boolean $overwrite)
string
string
array
string
copy only files that start with the given filter
boolean
overwrite existing files
recursiveDelete(string $src, array $profiles)
string
array
remove_hook(\hook_name $hook_name, \priority $hook_function, \hook_function $priority, \rollback_function $rollback_function)
\hook_name
Name of the hook.
\priority
Numeric priority. If set, all procedures of that priority will be removed.
\hook_function
Name of the procedure function. If set, all procedures that call this function will be removed.
\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.
return_ldap_hash(string $base, string $filter, string $key, array $attrs, boolean $sort) : array
string
The base DN to use.
string
LDAP Query filter.
string
LDAP attribute to use as key.
array
Attributes to use as values.
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
array
Array of values keyed by $key.run_hook(\hook_name $hook_name, \args $args) : true
\hook_name
Name of hook to run.
\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' ]
true
if all procedures returned true, false otherwise.saveAccountProfile(array $attributes, string $profile, string $scope) : boolean
file is created, if needed
array
hash array (attribute => value)
string
name of the account profile (without .
string
account type
boolean
true, if saving succeededsavePDFStructureDefinitions(string $scope, string $definition) : string
string
account type
string
Name of definition
string
"no perms" if access denied or "ok".saveSelfServiceProfile(string $name, string $scope, \selfServiceProfile $profile) : boolean
File is created, if needed
string
name of the account profile
string
account type
boolean
true, if saving succeededsearchLDAP(String $suffix, String $filter, array $attributes) : array
String
LDAP suffix
String
filter
array
list of attributes to return
array
list of found entriessearchLDAPByAttribute(String $name, String $value, String $objectClass, array $attributes, array $scopes) : array
String
attribute name (may be null)
String
attribute value
String
object class (may be null)
array
list of attributes to return
array
account types
array
list of found entriessearchLDAPByFilter(String $filter, array $attributes, array $scopes, boolean $attrsOnly) : array
String
array
list of attributes to return
array
account types
boolean
get only attributes but no values (default: false)
array
list of found entriessearch_domains(\handle $server, String $suffix) : array
\handle
LDAP handle (if null then $_SESSION['ldap']->server() is used)
String
LDAP suffix to search (if null then $_SESSION['config']->get_Suffix('smbDomain') is used)
array
list of samba3domain objectssearch_username(string $name) : string
string
user name
string
DNsendPasswordMail(String $pwd, array $user, String $recipient) : array
String
new password
array
LDAP attributes of user
String
recipient address (optional, $user['mail'][0] used by default)
array
list of arrays that can be used to create status messagesserver_select_list($selected, $logged_on, $name, $isVisible, $js)
set_cached_item($index, $item, $subitem, $data)
Returns true on success of false on failure.
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.
set_schema_cache_unavailable()
setlanguage()
showMainPage(string $scope, array $selectedModules)
string
account type
array
list of selected account modules
smbflag(array $input) : string
array
is an array of Samba flags (e.g. X or D)
string
Samba flag stringsortAttrs($a, $b)
sort_array_by_priority(\a $a, \b $b) : \-1
Standard `cmp-like' function.
\a
First element to compare.
\b
Second element to compare.
\-1
if priority of first element is smaller than second element priority. 1 otherwise.startSecureSession(boolean $redirectToLogin) : boolean
The script is stopped if one of the checks fail (timeout redirection may be overriden).
boolean
redirect user to login page
boolean
true if all ok, false if session expiredstopwatch()
str_split($string, $split_length)
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.
)
string
The OID number (ie, "1.3.6.1.4.1.4203.1.5.1") of the OID of interest.
array
An associative array contianing the OID title and description like so:syslog_debug(\log_string $log_string) : true
\log_string
Log message to send to syslog.
true
on success or if debug log is not activated.syslog_err(\log_string $log_string) : true
\log_string
Log message to send to syslog.
true
on success.syslog_msg(\emergency $emergency, \log_string $log_string)
\emergency
Syslog emergency.
\log_string
String to log.
syslog_notice(\log_string $log_string) : true
\log_string
Log message to send to syslog.
true
on success.syslog_warning(\log_string $log_string) : true
\log_string
Log message to send to syslog.
true
on success.testPermissionRecursive(String $dir) : array
String
directory
array
list of files/directories with wrong permissiontestPermissions() : array
array
- permission messagestranslateFieldIDToName(String $id, String $scope)
inetOrgPerson_givenName) to its descriptive name.
String
field ID
String
account type
upgradeConfigToServerProfileFolders(array $profiles)
array
server profiles
utime() : double
double
The current time in seconds since the beginning of the UNIX epoch (Midnight Jan. 1, 1970)This interface needs to be implemented by all account modules which manage passwords.
« More »Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.
« More »A simple class for representing AttributeTypes used only by the ObjectClass class.
« More »A simple class for representing AttributeTypes used only by the ObjectClass class.
« More »Abstract class which represents the LDAP tree view ; the draw() method must be implemented by subclasses
« More »Creates a list of elements that can be sorted by the user via drag'n'drop.
« More »An extended input field that combines label, input field and help.
« More »This abstract class provides variables and methods for LDAP datastores for use by PLA.
« More »$value
$value
APPCONFIG
APPCONFIG
CONFDIR
CRYPT_AES_MODE
CRYPT_AES_MODE_CBC
CRYPT_AES_MODE_CFB
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 |
---|
CRYPT_AES_MODE_ECB
CRYPT_AES_MODE_INTERNAL
CRYPT_AES_MODE_MCRYPT
CRYPT_AES_MODE_OFB
CRYPT_DES_DECRYPT
CRYPT_DES_ENCRYPT
CRYPT_DES_MODE
CRYPT_DES_MODE
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).
CRYPT_DES_MODE_CBC
CRYPT_DES_MODE_CBC3
Outer chaining is used by SSH-2 and when the mode is set to CRYPT_DES_MODE_CBC.
CRYPT_DES_MODE_CFB
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 |
---|
CRYPT_DES_MODE_ECB
CRYPT_DES_MODE_INTERNAL
CRYPT_DES_MODE_MCRYPT
CRYPT_DES_MODE_OFB
CRYPT_HASH_MODE
CRYPT_HASH_MODE_HASH
CRYPT_HASH_MODE_INTERNAL
CRYPT_HASH_MODE_MHASH
CRYPT_RC4_DECRYPT
CRYPT_RC4_ENCRYPT
CRYPT_RC4_MODE
CRYPT_RC4_MODE_INTERNAL
CRYPT_RC4_MODE_MCRYPT
CRYPT_RIJNDAEL_MODE_CBC
CRYPT_RIJNDAEL_MODE_CFB
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 |
---|
CRYPT_RIJNDAEL_MODE_ECB
CRYPT_RIJNDAEL_MODE_INTERNAL
CRYPT_RIJNDAEL_MODE_MCRYPT
CRYPT_RIJNDAEL_MODE_OFB
CRYPT_RSA_ASN1_INTEGER
CRYPT_RSA_ASN1_SEQUENCE
CRYPT_RSA_COMMENT
CRYPT_RSA_ENCRYPTION_OAEP
Uses sha1 by default.
see | \global\Crypt_RSA::setHash() |
---|---|
see | \global\Crypt_RSA::setMGFHash() |
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_MODE
CRYPT_RSA_MODE_INTERNAL
CRYPT_RSA_MODE_OPENSSL
(if enabled; otherwise, the internal implementation will be used)
CRYPT_RSA_PRIVATE_FORMAT_PKCS1
Used by OpenSSH
CRYPT_RSA_PRIVATE_FORMAT_PUTTY
CRYPT_RSA_PRIVATE_FORMAT_XML
CRYPT_RSA_PUBLIC_FORMAT_OPENSSH
Place in $HOME/.ssh/authorized_keys
CRYPT_RSA_PUBLIC_FORMAT_PKCS1
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
CRYPT_RSA_PUBLIC_FORMAT_XML
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.
CRYPT_RSA_SIGNATURE_PSS
Uses sha1 by default.
see | \global\Crypt_RSA::setSaltLength() |
---|---|
see | \global\Crypt_RSA::setMGFHash() |
CRYPT_RSA_SMALLEST_PRIME
CSSDIR
CSSDIR
DEBUGTMP
DEBUGTMPSUB
DEBUG_ENABLED
DOCDIR
E_STRICT
FPDF_FONTPATH
FPDF_VERSION
HOOKSDIR
HTDOCDIR
IMGDIR
IMGDIR
JSDIR
LAMPDF_LINEWIDTH
LANGDIR
LIBDIR
LIBDIR
LIBDIR
MATH_BIGINTEGER_BARRETT
see | \global\Math_BigInteger::_barrett() |
---|
MATH_BIGINTEGER_CLASSIC
see | \global\Math_BigInteger::_remainder() |
---|
MATH_BIGINTEGER_DATA
MATH_BIGINTEGER_KARATSUBA_CUTOFF
At what point do we switch between Karatsuba multiplication and schoolbook long multiplication?
access | private |
---|
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_BCMATH
(if enabled; otherwise, the internal implementation will be used)
MATH_BIGINTEGER_MODE_GMP
(if present; otherwise, either the BCMath or the internal implementation will be used)
MATH_BIGINTEGER_MODE_INTERNAL
MATH_BIGINTEGER_MONTGOMERY
see | \global\Math_BigInteger::_montgomery() |
---|---|
see | \global\Math_BigInteger::_prepMontgomery() |
MATH_BIGINTEGER_NONE
see | \global\Math_BigInteger::__clone() |
---|
MATH_BIGINTEGER_POWEROF2
see | \global\Math_BigInteger::_mod2() |
---|
MATH_BIGINTEGER_SIGN
MATH_BIGINTEGER_VALUE
MATH_BIGINTEGER_VARIABLE
$cache[MATH_BIGINTEGER_VARIABLE] tells us whether or not the cached data is still valid.
MHASH_MD5
MHASH_RIPEMD160
MHASH_SHA1
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 |
NET_SFTP_LOCAL_FILE
NET_SFTP_LOG_COMPLEX
NET_SFTP_LOG_SIMPLE
NET_SFTP_STRING
NET_SSH1_AUTH_PASSWORD
This is the only method that is supported by this library.
NET_SSH1_AUTH_RHOSTS
NET_SSH1_AUTH_RHOSTS_RSA
NET_SSH1_AUTH_RSA
NET_SSH1_CIPHER_3DES
All implementations are required to support this
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)
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)
NET_SSH1_CIPHER_DES
NET_SSH1_CIPHER_IDEA
Not supported.
NET_SSH1_CIPHER_NONE
Not supported.
NET_SSH1_LOG_COMPLEX
NET_SSH1_LOG_SIMPLE
NET_SSH1_MASK_CONSTRUCTOR
NET_SSH1_MASK_LOGIN
NET_SSH1_MASK_SHELL
NET_SSH1_READ_REGEX
NET_SSH1_READ_SIMPLE
NET_SSH1_RESPONSE_DATA
see | \global\Net_SSH1::_get_binary_packet() |
---|---|
access | private |
NET_SSH1_RESPONSE_TYPE
see | \global\Net_SSH1::_get_binary_packet() |
---|---|
access | private |
NET_SSH1_TTY_OP_END
NET_SSH2_CHANNEL_EXEC
NET_SSH2_CHANNEL_SHELL
NET_SSH2_LOG_COMPLEX
NET_SSH2_LOG_SIMPLE
NET_SSH2_MASK_CONSTRUCTOR
NET_SSH2_MASK_LOGIN
NET_SSH2_MASK_SHELL
NET_SSH2_READ_REGEX
NET_SSH2_READ_SIMPLE
QUERYDIR
REQUIRED_PHP_VERSION
SAMBA_MUNGEDDIAL_FILEHEADER
SAMBA_MUNGEDDIAL_FILEHEADER_OLD
SCHEMA_SESSION_CACHE_ENABLED
TMPLDIR
UFPDF_VERSION