_
__autoload
a_array_rand
add_hook
app_error_handler
app_name
app_version
arrayLower
array_stripslashes
array_to_query_string
auto_lang
binSIDtoText
blowfish_decrypt
blowfish_encrypt
check_config
clear_hooks
cmd_control_pane
debug_dump
debug_dump_backtrace
debug_log
debug_sysmsg
del_cached_item
dn_escape
dn_unescape
draw_chooser_link
draw_formatted_dn
draw_jpeg_photo
error
expand_dn_with_base
full_str_pad
get_cached_item
get_custom_file
get_enc_type
get_href
get_icon
get_next_number
get_rdn
get_request
htmlid
isAjaxEnabled
isCompress
is_dn_string
is_mail_string
is_url_string
ldap_error_msg
littleEndian
masort
obfuscate_password_display
password_check
password_generate
password_hash
password_types
pla_compare_dns
pla_explode_dn
pla_reverse_dn
pla_verbose_error
pretty_print_dn
random_junk
random_salt
rdn_explode
remove_hook
return_ldap_hash
run_hook
server_select_list
set_cached_item
set_cookie
sortAttrs
sort_array_by_priority
stopwatch
support_oid_to_text
syslog_debug
syslog_err
syslog_msg
syslog_notice
syslog_warning
system_message
utime
APPCONFIG
CONFDIR
CSSDIR
CSSDIR
DEBUGTMP
DEBUGTMPSUB
DEBUG_ENABLED
DOCDIR
E_STRICT
HOOKSDIR
HTDOCDIR
IMGDIR
IMGDIR
JSDIR
LANGDIR
LIBDIR
LIBDIR
QUERYDIR
REQUIRED_PHP_VERSION
TMPLDIR
_($msg)
__autoload($className)
a_array_rand(array $input, integer $num_req) : string
arrayArray of values
integerNumber of values in returned array
stringThe padded stringadd_hook(\hook_name $hook_name, \hook_function $hook_function, \priority $priority, \rollback_function $rollback_function)
\hook_nameName of the hook.
\hook_functionName of the php function called upon hook trigger.
\priorityNumeric priority. Lowest means procedure will be executed before.
\rollback_functionName of the php rollback function called upon failure.
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 |
|---|
intThe PHP error number that occurred (ie, E_ERROR, E_WARNING, E_PARSE, etc).
stringThe PHP error string provided (ie, "Warning index "foo" is undefined)
stringThe file in which the PHP error ocurred.
intThe line number on which the PHP error ocurred
app_name()
app_version() : string
The version is read from the file named VERSION.
stringThe current version as read from the VERSION file.arrayLower(array $array)
| returns | array Array with values converted to lowercase. |
|---|
arrayThe array to convert the values to lowercase.
array_stripslashes(Array $array)
ArrayThe 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.
arrayThe 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
stringThe string created from the array.auto_lang($lang)
binSIDtoText($binsid)
blowfish_decrypt(string $encdata, string $secret) : string
| author | lem9 (taken from the phpMyAdmin source) |
|---|
stringEncrypted data
stringThe secret
stringOriginal datablowfish_encrypt(string $data, string $secret) : string
| author | lem9 (taken from the phpMyAdmin source) |
|---|
stringOriginal data
stringThe secret
stringThe encrypted resultcheck_config($config_file)
clear_hooks(\hook_name $hook_name)
\hook_nameName of hook to clear.
cmd_control_pane($type) : array
arraydebug_dump(string | array $variable, boolean $die, $onlydebugaddr)
stringarrayVariable to dump
booleanWhether to stop execution or not.
debug_dump_backtrace(boolean $msg, $die)
booleanWhether 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 |
|---|
stringMessage to send to syslog
intLog bit number for this message.
debug_sysmsg($msg)
del_cached_item($index, $item, $subitem)
dn_escape($dn)
dn_unescape($dn)
draw_chooser_link(string $form, boolean $element, $include_choose_text, $rdn)
stringThe 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);
objectThe Server to get the image from.
stringThe DN of the entry that contains the jpeg attribute you want to draw.
stringThe name of the attribute containing the jpeg data (usually 'jpegPhoto').
intIndex of the attribute to draw
booleanIf 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.
arraySpecifies optional image and CSS style attributes for the table tag. Supported keys are fixed_width, fixed_height, img_opts.
error($msg, $type, $redirect, $fatal, $backtrace)
full_str_pad(string $input, integer $pad_length, string $pad_string, integer $pad_type) : string
stringInput string
integerLength of the result
stringThe filling string
integerPadding mode
stringThe padded stringget_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).
\Returnsthe cached attributed requested, or null if there is nothing cached..get_custom_file(int $index, string $filename, $path) : string
intThe ID of the server
stringThe requested filename
stringThe 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.
stringHashed password
stringget_href(string $type, $extra_info) : string
This is a convenience function for fetching project HREFs (like bugs)
stringOne of "open_bugs", "add_bug", "donate", or "add_rfe" (rfe = request for enhancement)
stringThe 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.
stringThe DN of the entry whose icon you wish to fetch.
stringget_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.
stringBase to start the search from
stringAttribute to query
booleanIncrement the result (for pool searches)
stringLDAP filter to use (for pool searches)
intget_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()).
stringThe DN whose RDN to return.
booleanIf true, include attributes in the RDN string. See http://php.net/ldap_explode_dn for details
stringThe RDNget_request($attr, $type, $die, $default) : \The
\Theform GET/REQUEST/SESSION/POST variable value or its defaulthtmlid(string $sid, $dn) : string
stringThe DN to pretty-print.
stringisAjaxEnabled()
isCompress()
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)
stringThe attribute to examine for "DNness"
booleanis_mail_string(string $str) : boolean
stringThe string to analyze.
booleanReturns true if the specified string looks like an email address or false otherwise.is_url_string(string $str) : boolean
stringThe string to analyze.
booleanReturns true if the specified string looks like a web URL or false otherwise.ldap_error_msg($msg, $errnum)
littleEndian($hex)
masort(array $data, string $sortby, boolean $rev) : array
arrayMulti demension array passed by reference
stringComma delimited string of sort keys.
booleanWhether to reverse sort.
arraySorted multi demension array.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;
stringPassword encoding type
booleanpassword_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".
StringThe hash.
StringThe password in clear text to test.
BooleanTrue if the clear password matches the hash, and false otherwise.password_generate()
password_hash(string $password_clear, string $enc_type) : string
stringThe password to hash in clear text.
stringStandard LDAP encryption type which must be one of crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear.
stringThe hashed password.password_types()
| todo | Dynamically work this list out so we only present hashes that we can encrypt |
|---|
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
stringThe first of two DNs to compare
stringThe second of two DNs to compare
intpla_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
)
stringThe DN to explode.
int(optional) Whether to include attribute names (see http://php.net/ldap_explode_dn for details)
arrayAn array of RDN parts of this format:pla_reverse_dn(string $dn) : string
| see | \global\pla_compare_dns |
|---|---|
| see | \global\pla_explode_dns |
stringThe DN to reverse
stringThe 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."
)
stringThe hex error number (ie, "0x42") of the LDAP error of interest.
arrayAn 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.
stringThe DN to pretty-print.
stringrandom_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.
intThe length of the salt string to generate.
stringThe generated salt string.rdn_explode($rdn)
remove_hook(\hook_name $hook_name, \priority $hook_function, \hook_function $priority, \rollback_function $rollback_function)
\hook_nameName of the hook.
\priorityNumeric priority. If set, all procedures of that priority will be removed.
\hook_functionName of the procedure function. If set, all procedures that call this function will be removed.
\rollback_functionName 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
stringThe base DN to use.
stringLDAP Query filter.
stringLDAP attribute to use as key.
arrayAttributes to use as values.
booleanSpecify 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
arrayArray of values keyed by $key.run_hook(\hook_name $hook_name, \args $args) : true
\hook_nameName of hook to run.
\argsArray 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' ]
trueif all procedures returned true, false otherwise.server_select_list($selected, $logged_on, $name, $isVisible, $js)
set_cached_item($index, $item, $subitem, $data)
Returns true on success of false on failure.
sortAttrs($a, $b)
sort_array_by_priority(\a $a, \b $b) : \-1
Standard `cmp-like' function.
\aFirst element to compare.
\bSecond element to compare.
\-1if priority of first element is smaller than second element priority. 1 otherwise.stopwatch()
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.
)
stringThe OID number (ie, "1.3.6.1.4.1.4203.1.5.1") of the OID of interest.
arrayAn associative array contianing the OID title and description like so:syslog_debug(\log_string $log_string) : true
\log_stringLog message to send to syslog.
trueon success or if debug log is not activated.syslog_err(\log_string $log_string) : true
\log_stringLog message to send to syslog.
trueon success.syslog_msg(\emergency $emergency, \log_string $log_string)
\emergencySyslog emergency.
\log_stringString to log.
syslog_notice(\log_string $log_string) : true
\log_stringLog message to send to syslog.
trueon success.syslog_warning(\log_string $log_string) : true
\log_stringLog message to send to syslog.
trueon success.utime() : double
doubleThe current time in seconds since the beginning of the UNIX epoch (Midnight Jan. 1, 1970)APPCONFIG
CONFDIR
CSSDIR
CSSDIR
DEBUGTMP
DEBUGTMPSUB
DEBUG_ENABLED
DOCDIR
E_STRICT
HOOKSDIR
HTDOCDIR
IMGDIR
IMGDIR
JSDIR
LANGDIR
LIBDIR
LIBDIR
QUERYDIR
REQUIRED_PHP_VERSION
TMPLDIR
This abstract class provides variables and methods for LDAP datastores for use by PLA.
« More »build_tree($server, $dn, $buildtree)
copy_dn($serverSRC, $serverDST, $dnSRC, $dnDST, $remove)
display_pla_parse_error($request)
getMustAttrs($oclasses)
get_line_end_format() : String
String'win', 'unix', or 'mac' based on the user's browser..get_user_agent_string() : string | false
stringfalseThe user agent string as reported by the browser.is_browser($type)
pla_rdelete($server, $dn)
r_copy_dn($serverSRC, $serverDST, $snapshottree, $dnSRC, $dnDST, $remove)
APPCONFIG
LIBDIR
A simple class for representing AttributeTypes used only by the ObjectClass class.
« More »app_session_start() : boolean
| see | \global\common.php |
|---|---|
| see | \global\APP_SESSION_ID |
booleanReturns true if the session was started the first time