$value
$value
LAM |
LAMTool | Represents a tool. |
passwordService | This interface needs to be implemented by all account modules which manage passwords. |
account | Manages the object class "account" for users and hosts. |
accountContainer | This class includes all modules and attributes of an account. |
AJAXTree | This class implements an AJAX based tree. |
alias | The account type for aliases. |
aliasEntry | Manages the alias entry for the object class alias. |
asteriskAccount | Manages the Asterisk extension of user accounts. |
asteriskExt | The account type for Asterisk extensions. |
asteriskExtension | Manages Asterisk extensions. |
asteriskVoicemail | Manages the Asterisk extension of user accounts. |
Attribute | Represents an attribute of a template. |
AttributeFactory | AttributeFactory Class |
AttributeType | Represents an LDAP AttributeType |
AttributeType | Represents an LDAP AttributeType |
authorizedServiceObject | Provides Authorized Service for accounts. |
automount | Manages automount objects. |
automountType | The account type for automount objects. |
baseModule | Parent class of all account modules. |
baseType | This is the parent class of all account types. |
BinaryAttribute | Represents an attribute whose values are binary |
bind | The account type for managing Bind DNS entries. |
bindDLZ | Manages Bind DLZ DNS entries. |
block | This class draws a block. |
Config | The config class contains all our configuration settings for a session. |
courierMailAccount | Courier mail extension for users. |
courierMailAlias | Enable the account for Courier Mail Service Aliases |
Crypt_AES | Pure-PHP implementation of AES. |
Crypt_Base | Base Class for all Crypt_* cipher classes |
Crypt_Blowfish | Pure-PHP implementation of Blowfish. |
Crypt_DES | Pure-PHP implementation of DES. |
Crypt_Hash | Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions. |
Crypt_RC2 | Pure-PHP implementation of RC2. |
Crypt_RC4 | Pure-PHP implementation of RC4. |
Crypt_Rijndael | Pure-PHP implementation of Rijndael. |
Crypt_RSA | Pure-PHP PKCS#1 compliant implementation of RSA. |
Crypt_TripleDES | Pure-PHP implementation of Triple DES. |
Crypt_Twofish | Pure-PHP implementation of Twofish. |
customFields | Manages custom LDAP attributes. |
customFieldsCheckboxEntry | Represents a checkbox. |
customFieldsConstantEntry | Represents a constant field. |
customFieldsConstantEntryTest | Checks the ppolicy expire job. |
customFieldsEntry | Represents a field definition. |
customFieldsFileUploadEntry | Represents a file upload field. |
customFieldsGroup | Groups object classes and attributes for a specific account type. |
customFieldsLdapSearchSelectListEntry | Selection list with values of entries from LDAP search. |
customFieldsPasswordEntry | Represents a password field. |
customFieldsRadioListEntry | Represents a radio button list. |
customFieldsSelectListEntry | Represents a radio button list. |
customFieldsTextAreaEntry | Represents a text area field. |
customFieldsTextEntry | Represents a simple text field. |
customScripts | Runs custom scripts when account are managed. |
Datastore | The list of database sources |
DateAttribute | Represents an attribute whose values are dates |
ddns | Manages DDNS entries. |
device | Manages the device object class for host accounts. |
dhcp | The account type for DHCP |
dhcp_settings | Manages DHCP entries. |
DnAttribute | Represents an attribute whose values are DNs |
DS | This abstract class provides the basic variables and methods. |
eduPerson | Manages the eduPerson extension for user accounts. |
Export | Export Class |
ExportCSV | Export entries to CSV |
ExportDSML | Export entries to DSML v.1 |
Exporter | Exporter Class |
ExportLDIF | Export from LDAP using an LDIF format |
ExportVCARD | Export entries to VCARD v2.1 |
File_ANSI | Pure-PHP ANSI Decoder |
File_ASN1 | Pure-PHP ASN.1 Parser |
File_ASN1_Element | ASN.1 Element |
File_X509 | Pure-PHP X.509 Parser |
fixed_ip | Manages DHCP host entries. |
FPDF | |
freeRadius | Manages FreeRadius accounts. |
FreeRadiusAccountExpirationCleanupJob | Job to delete or move users on account expiration. |
generalInformation | Shows general information like the creation time of an account. |
GidAttribute | Represents a 'gidNumber' attribute |
gon | The account type for group of names. |
group | The account type for group accounts (e.g. Unix and Samba). |
groupOfMembers | Manages group members for the object class groupOfMembers. |
groupOfNames | Manages group members for the object class groupOfNames. |
groupOfNamesUser | Manages memberships for the object class groupOf(Unique)Names. |
groupOfUniqueNames | Manages group members for the object class groupOfUniqueNames. |
heimdalKerberos | Manages Heimdal Kerberos accounts. |
Horde_Cipher_blowfish | |
host | The account type for host accounts (e.g. Samba). |
hostObject | Manages the hosts to which a user may login. |
htmlAccordion | Creates a list of content elements in accordion style. |
htmlAccountPageButton | Prints a button for the account pages. |
htmlButton | Simple button. |
htmlContentLink | Generates a link arround a htmlElement. |
htmlDiv | Creates a simple DIV element. |
htmlElement | Represents a HTML element. |
htmlEqualHeight | Sets all given elements to the same height. |
htmlEqualWidth | Sets all given elements to the same width. |
htmlFieldset | Generates a fieldset. |
htmlGroup | Groups multiple htmlElements. |
htmlHelpLink | Renders a help link. |
htmlHiddenInput | Generates a hidden input field. |
htmlHorizontalLine | Prints a horizontal line. |
htmlImage | Prints the HTML code for an image. |
htmlInputCheckbox | Prints the HTML code for a checkbox. |
htmlInputField | A standard input field. |
htmlInputFileUpload | Prints the HTML code for a file upload field. |
htmlInputTextarea | Prints the HTML code for a textarea. |
htmlJavaScript | Creates a JavaScript element. |
htmlLink | Generates a link. |
htmlOutputText | Prints the text and escapes contained HTML code by default. |
htmlRadio | Represents a radio selection. |
htmlReCAPTCHA | Creates a Google reCAPTCHA element. |
htmlResponsiveCell | Responsive cell inside htmlResponsiveRow with 12 column layout. |
htmlResponsiveInputField | A responsive input field that combines label, input field and help. |
htmlResponsiveRow | Responsive row with 12 column layout. |
htmlScript | Creates a Script element to integrate external JavaScript files. |
htmlSelect | Represents a select box. |
htmlSortableList | Creates a list of elements that can be sorted by the user via drag'n'drop. |
htmlSpacer | Adds an empty space with given width and height. |
htmlStatusMessage | Prints a status message (e.g. error message). |
htmlSubTitle | Generates a subtitle line. This is used to group multiple fields. |
htmlTable | Structures elements using a table. |
htmlTableExtendedInputCheckbox | Checkbox with descriptive label and help link. |
htmlTableExtendedInputField | An extended input field that combines label, input field and help. |
htmlTableExtendedInputFileUpload | File upload with descriptive label and help link. |
htmlTableExtendedInputTextarea | Text area with label and help link. |
htmlTableExtendedRadio | Radio list with descriptive label and help link. |
htmlTableExtendedSelect | Select with label and help link. |
htmlTableRow | A row inside a htmlTable. |
htmlTitle | Generates a title line. This is used for page titles. |
HTMLTree | This class implements a straight HTML tree - no AJAX rendering is used. |
ieee802device | Provides MAC addresses for hosts. |
imapAccess | Manages mailboxes on an IMAP server. |
Import | Import Class |
Importer | Importer Class |
ImportLDIF | Import entries from LDIF |
inetLocalMailRecipient | Provides mail routing for users. |
inetOrgPerson | This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address). |
ipHost | Provides IP addresses for hosts. |
JpegAttribute | Represents an attribute whose values are jpeg pictures |
kolabGroup | Manages Kolab group accounts. |
kolabSharedFolder | Manages Kolab shared folders. |
kolabSharedFolderType | The account type for Kolab shared folders. |
kolabSharedFolderTypeList | Generates the list view. |
kolabUser | Manages Kolab user accounts. |
kopanoAddressList | Manages Kopano address list entries. |
kopanoAddressListType | The account type for Kopano address lists. |
kopanoContact | Manages Kopano contacts. |
kopanoDynamicGroup | Manages Kopano dynamic group entries. |
kopanoDynamicGroupType | The account type for Kopano dynamic groups. |
kopanoGroup | Manages Kopano group entries. |
kopanoServer | Manages Kopano server entries. |
kopanoUser | Manages Kopano users. |
lamAjax | Manages all AJAX requests. |
lamAliasList | Generates the list view. |
lamAsteriskExtList | Generates the list view. |
lamAutomountList | Generates the list view. |
lamBindList | Generates the list view. |
lamBooleanListOption | Boolean option for list configuration. |
LAMCfgMain | This class manages config.cfg. |
LAMConfig | This class manages conf files. |
LAMConfigTest | LAMConfig test case. |
lamDHCPList | Generates the list view. |
LAMException | |
lamGonList | Generates the list view. |
lamGroupList | Generates the list view. |
lamHostList | Generates the list view. |
lamKopanoAddressListTypeList | Generates the list view. |
lamKopanoDynamicGroupTypeList | Generates the list view. |
LAMLanguage | Represents a supported language. |
lamList | Generates the list view. |
lamListOption | Represents a list configuration option. |
lamListTool | Represents a tool which can be included in the account lists. |
lamMailAliasList | Generates the list view. |
lamNetgroupList | Generates the list view. |
lamNisObjectList | Generates the list view. |
lamNsviewList | Generates the list view. |
lamOracleContextList | Generates the list view. |
lamPDF | Creates a LAM information page in PDF format. |
lamPpolicyList | Generates the list view. |
lamPykotaBillingCodeTypeList | Generates the list view. |
lamPykotaPrinterTypeList | Generates the list view. |
lamSelectListOption | Boolean option for list configuration. |
lamSmbDomainList | Generates the list view. |
LAMSubTool | Represents a subtool. |
lamSudoList | Generates the list view. |
lamUserList | Generates the list view. |
lamZarafaAddressListTypeList | Generates the list view. |
lamZarafaDynamicGroupTypeList | Generates the list view. |
Ldap | Ldap manages connection to LDAP and includes several helper functions. |
ldap_pla | This abstract class provides variables and methods for LDAP datastores for use by PLA. |
ldapPublicKey | Manages SSH public keys. |
ListAttributeTest | Checks ListAttribute. |
locking389ds | Shows the locking state for 389ds servers. |
Locking389DSPasswordNotifyJob | Job to notify users about password expiration. |
mailAlias | The account type for mail aliases. |
MassRender | TemplateRender class |
MatchingRule | Represents an LDAP MatchingRule |
MatchingRule | Represents an LDAP MatchingRule |
MatchingRuleUse | Represents an LDAP schema matchingRuleUse entry |
MatchingRuleUse | Represents an LDAP schema matchingRuleUse entry |
Math_BigInteger | Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 numbers. |
mitKerberos | Manages MIT Kerberos accounts. |
mitKerberosStructural | Manages MIT Kerberos accounts. |
moduleCache | Caches module objects. |
MultiLineAttribute | Represents a attribute whose values are multiline text |
myldap | This abstract class provides the basic variables and methods for LDAP datastores |
namedObject | Manages the namedObject object class. |
Net_SCP | Pure-PHP implementations of SCP. |
Net_SFTP | Pure-PHP implementations of SFTP. |
Net_SFTP_Stream | SFTP Stream Wrapper |
Net_SSH1 | Pure-PHP implementation of SSHv1. |
Net_SSH2 | Pure-PHP implementation of SSHv2. |
netgroup | The account type for NIS netgroups. |
nisMailAlias | Provides NIS mail alias management. |
nisMailAliasUser | Provides NIS mail alias management. |
nisnetgroup | Manages entries based on the object class nisNetgroup. |
nisNetGroupHost | Manages memberships in NIS net groups. |
nisNetGroupUser | Manages memberships in NIS net groups. |
nisObject | Manages NIS objects. |
nisObjectType | The account type for NIS objects. |
nsview | Manages the object class "nsview" for LDAP views. |
nsviewType | The account type for LDAP views based on nsview object class. |
ObjectClass | Represents an LDAP objectClass |
ObjectClass | Represents an LDAP objectClass |
ObjectClass_ObjectClassAttribute | A simple class for representing AttributeTypes used only by the ObjectClass class. |
ObjectClassAttribute | A simple class for representing AttributeTypes used only by the ObjectClass class. |
ObjectClassAttribute | Represents an 'objectClass' attribute |
oracleContextType | The account type for Oracle database entries. |
oracleService | Manages Oracle database entries. |
organizationalRole | Manages group members for the object class organizationalRole. |
organizationalRoleUser | Manages memberships for the object class organizationalRole. |
page | This class controls the final output to the browser. |
PageRender | PageRender class |
PasswordAttribute | Represents an attribute whose values are passwords |
passwordSelfReset | Manages password self reset questions and answers. |
posixAccount | Manages the object class "posixAccount" for users and hosts. |
posixGroup | Manages the object class "posixGroup" for groups. |
ppolicy | Manages ppolicy password policies. |
PPolicyPasswordNotifyJob | Job to notify users about password expiration. |
ppolicyType | The account type for ppoliy password policies. |
ppolicyUser | Assigns password policies to users. |
PPolicyUserPasswordNotifyJobTest | Checks the ppolicy expire job. |
puppetClient | Manages Puppet configuration options. |
pykotaBillingCode | Manages PyKota billing codes. |
pykotaBillingCodeType | The account type for PyKota billing codes. |
pykotaGroup | Manages PyKota group accounts. |
pykotaGroupStructural | Manages PyKota group accounts. |
pykotaPrinter | Manages PyKota printers. |
pykotaPrinterType | The account type for PyKota printers. |
pykotaUser | Manages PyKota user accounts. |
pykotaUserStructural | Manages PyKota user accounts. |
QmailAccountExpirationCleanupJob | Job to delete or move users on account expiration. |
qmailGroup | Manages qmail groups. |
qmailUser | Manages qmail users. |
Queries | Query Class |
Query | Query Class |
QueryRender | QueryRender class |
quota | Manages quotas for users and groups. |
RandomPasswordAttribute | Represents an attribute whose values are random passwords |
range | Manages DHCP ranges for DHCP server. |
ReadStructureTest | Reads a sample PDF structure. |
rfc2307bisAutomount | Manages automount objects (RFC2307bis schema). |
rfc2307bisPosixGroup | Manages group members for the object class rfc2307bisPosixGroup. |
samba3domain | Represents a Samba 3 domain entry |
sambaDomain | Manages Samba 3 domain entries. |
sambaGroupMapping | Manages the object class "sambaGroupMapping" for groups. |
sambaMungedDial | Manages terminal server settings for Samba 3. |
SambaPasswordAttribute | Represents an attribute whose values are SAMBA passwords |
sambaSamAccount | Manages the object class "sambaSamAccount" for users and hosts. |
SambaSamAccountTest | Checks the shadow expire job. |
SchemaItem | Generic parent class for all schema items. A schema item is an ObjectClass, an AttributeBype, a MatchingRule, or a Syntax. |
SchemaItem | Generic parent class for all schema items. A schema item is an ObjectClass, an AttributeBype, a MatchingRule, or a Syntax. |
SecurityTest | Checks password checking functions. |
SelectionAttribute | Represents an attribute whose values are in a predefined list |
selfRegistration | Allows users to register accounts via LAM Pro self service. |
selfServiceProfile | Includes all settings of a self service profile. |
shadowAccount | Manages the object class "shadowAccount" for users. |
ShadowAccountExpirationCleanupJob | Job to delete or move users on account expiration. |
ShadowAccountPasswordNotifyJob | Job to notify users about password expiration. |
ShadowAccountPasswordNotifyJobTest | Checks the shadow expire job. |
ShadowAttribute | Represents a shadow date attribute |
smbDomain | The account type for Samba domains. |
smbHash | Calculates NT and LM hashes. |
smbHash | Calculates NT and LM hashes. |
sudo | The account type for sudo roles. |
sudoRole | Manages sudo roles. |
SudoRoleTest | Checks sudo role functions. |
Syntax | Represents an LDAP Syntax |
Syntax | Represents an LDAP Syntax |
System_SSH_Agent | Pure-PHP ssh-agent client identity factory |
System_SSH_Agent_Identity | Pure-PHP ssh-agent client identity object |
systemQuotas | Manages user quotas with the object class systemQuotas. |
Template | Template Class |
TemplateRender | TemplateRender class |
Templates | Templates Class |
Tree | Abstract class which represents the LDAP tree view ; the draw() method must be implemented by subclasses |
TreeItem | Represents an item in the tree. |
UFPDF | Main UFPDF class for creating Unicode PDF documents |
uidObject | Manages entries based on the object class uidObject. |
user | The account type for user accounts (e.g. Unix, Samba and Kolab). |
Visitor | Abstract Visitor class |
WindowsAccountExpirationCleanupJob | Job to delete or move users on account expiration. |
windowsGroup | Manages Windows AD (e.g. Samba 4) groups. |
windowsHost | Manages Windows AD (e.g. Samba 4) hosts. |
WindowsPasswordNotifyJob | Job to notify users about password expiration. |
windowsPosixGroup | Manages Unix groups in Windows LDAP schema. |
windowsUser | Manages Windows AD (e.g. Samba 4) users. |
xml2array | XML Parser |
xmlTemplate | XML Template Class |
xmlTemplates | XML Templates Class |
zarafaAddressList | Manages Zarafa address list entries. |
zarafaAddressListType | The account type for Zarafa address lists. |
zarafaContact | Manages Zarafa contacts. |
zarafaDynamicGroup | Manages Zarafa dynamic group entries. |
zarafaDynamicGroupType | The account type for Zarafa dynamic groups. |
zarafaGroup | Manages Zarafa group entries. |
zarafaServer | Manages Zarafa server entries. |
zarafaUser | Manages Zarafa users. |
CRYPT_RSA_PUBLIC_FORMAT_PKCS8
PKCS#1 formatted public key (encapsulated)
Used by PHP's openssl_public_encrypt() and openssl's rsautl (when -pubin is set)
Has the following header:
-----BEGIN PUBLIC KEY-----
Analogous to ssh-keygen's pkcs8 format (as specified by -m). Although PKCS8 is specific to private keys it's basically creating a DER-encoded wrapper for keys. This just extends that same concept to public keys (much like ssh-keygen)
_get_raw_schema( $schema_to_fetch, $dn = '') : \an
Fetches the raw schema array for the subschemaSubentry of the server. 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
|
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, boolean $debug = false) : string
Helper for _get_raw_schema() which fetches the DN of the schema object in an LDAP server based on a DN. 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 | $dn | The DN (may be null) which houses the subschemaSubEntry attribute which
|
boolean | $debug | Switch to true to see some nice and copious output. :) |
The DN of the entry which houses this LDAP server's schema.
add_aliases_to_attrs( $attrs)
For each attribute that has multiple names, this function adds unique entries to the attrs array for those names. Ie, attributeType has name 'gn' and 'givenName'.
This function will create a unique entry for 'gn' and 'givenName'.
$attrs |
addSecurityTokenToMetaHTML(\htmlTable|\htmlGroup $container)
Adds a hidden input field to the given meta HTML table.
Should be used to add token at the end of table.
\htmlTable|\htmlGroup | $container | table |
app_error_handler( $errno, $errstr, $file, $lineno)
Custom error handling function.
When a PHP error occurs, PHP will call this function rather than printing the typical PHP error string. This provides the application the ability to format an error message so that it looks better. Optionally, it can present a link so that a user can search/submit bugs. This function is not to be called directly. It is exclusively for the use of PHP internally. If this function is called by PHP from within a context where error handling has been disabled (ie, from within a function called with "@" prepended), then this function does nothing.
$errno | ||
$errstr | ||
$file | ||
$lineno |
array_to_query_string( $array, $exclude_vars = array()) : string
Converts an array to a query-string with the option to exclude certain variables from the returned query string. This is convenient if callers want to convert the current GET query string or POST array into a string and replace certain variables with their own.
$array | ||
$exclude_vars |
The string created from the array.
buildUploadAccounts(\LAM\TYPES\ConfiguredType $type, array $data, array $ids, array $selectedModules) : mixed
This function builds the LDAP accounts for the file upload.
If there are problems status messages will be printed automatically.
\LAM\TYPES\ConfiguredType | $type | account type |
array | $data | array containing one account in each element |
array | $ids | array( |
array | $selectedModules | selected account modules |
array including accounts or false if there were errors
cached_schema_available( $schema_type)
Returns true if the schema for $schema_type has been cached and is availble. $schema_type may be one of (lowercase) the following: objectclasses attributetypes ldapsyntaxes matchingrules matchingruleuse Note that _get_raw_schema() takes a similar parameter.
$schema_type |
check_module_conflicts(array $selected, array $deps) : boolean
Checks if there are conflicts between modules
array | $selected | selected module names |
array | $deps | module dependencies |
false if no conflict was found, otherwise an array of array(selected module, conflicting module) if conflicts were found
check_module_depends(array $selected, array $deps) : mixed
Checks if there are missing dependencies between modules.
array | $selected | selected module names |
array | $deps | module dependencies |
false if no misssing dependency was found, otherwise an array of array(selected module, depending module) if missing dependencies were found
checkConfigOptions(array $scopes, array $options) : array
Checks if the configuration options are valid
array | $scopes | hash array (module name => array(account types)) |
array | $options | hash array containing all options (name => array(...)) |
list of error messages
checkIfNewEntriesAreAllowed(String $scope) : boolean
Checks if it is allowed to create new LDAP entries of the given type.
This also checks if general write access is enabled.
String | $scope | account type (e.g. 'user') |
true, if new entries are allowed
checkPasswordStrength(String $password, String $userName, array $otherUserAttrs) : mixed
Checks if the password fulfills the password policies.
String | $password | password |
String | $userName | user name |
array | $otherUserAttrs | user's first/last name |
true if ok, string with error message if not valid
checkSchemaForModule(String $name, String $scope, String $typeId) : String
Checks if the object classes and attributes for this module are available.
String | $name | module name |
String | $scope | type (user, group, ...) |
String | $typeId | type id |
error message or null
checkSelfServiceOptions(string $scope, string $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields) : array
Checks if all input values are correct and returns the LDAP commands which should be executed.
string | $scope | account type |
string | $fields | input fields (array( |
array | $attributes | LDAP attributes |
boolean | $passwordChangeOnly | indicates that the user is only allowed to change his password and no LDAP content is readable |
array | $readOnlyFields | list of read-only fields |
messages and LDAP commands (array('messages' => array(), 'add' => array(), 'del' => array(), 'mod' => array()))
checkSelfServiceSettings(string $scope, array $options, \selfServiceProfile $profile) : array
Checks if the self service settings are valid
string | $scope | account type |
array | $options | hash array containing all options (name => array(...)) |
\selfServiceProfile | $profile | profile |
list of error messages
colorText(string $text) : string
Replace {color=#[HEX-Value]} or {color=[HEX-Value]} and {endcolor} with <font color="#[HEX-Value]"> and </font> HTML-Tags.
string | $text | The text that is used to search for {color} and {endcolor} tags. |
Input string with HTML-formatted color tags
createConfigProfile(String $name, String $password, String $template) : mixed
Creates a new server profile.
String | $name | profile name |
String | $password | profile password |
String | $template | name of template file |
Boolean TRUE if creation was ok, error message if not
createEMailHeaders(String $from, boolean $isHTML, String $replyTo = null, String $cc = null, String $bcc = null) : String
Generates the email header text for the given parameters.
String | $from | FROM address |
boolean | $isHTML | mail is formatted as HTML or plain text |
String | $replyTo | reply-to address (optional) |
String | $cc | CC address |
String | $bcc | BCC address |
header lines
crypt_random_string(integer $length) : string
Generate a random string.
Although microoptimizations are generally discouraged as they impair readability this function is ripe with microoptimizations because this function has the potential of being called a huge number of times. eg. for RSA key generation.
integer | $length |
debug_log( $msg, $level, $indent)
Debug Logging
The global debug level is turned on in your configuration file by setting:
$config->custom->debug['level'] = 255;
together with atleast one output direction (currently file and syslog are supported).
$config->custom->debug['file'] = '/tmp/app_debug.log';
$config->custom->debug['syslog'] = true;
The debug level is turned into binary, then if the message levels bit is on the message will be sent to the debug log. (Thus setting your debug level to 255, all bits on, will results in all messages being printed.)
The message level bits are defined here. 0( 1) = Entry/Return results from function calls. 1( 2) = Configuration Processing 2( 4) = Template Processing 3( 8) = Schema Processing 4( 16) = LDAP Server Communication 5( 32) = Tree Processing 7( 64) = Other non generic messages 8(128) = Page Processing 9(256) = Hooks Processing
$msg | ||
$level | ||
$indent |
doUploadPostActions(\LAM\TYPES\ConfiguredType $type, array $data, array $ids, array $failed, array $selectedModules, array $accounts) : array
This function executes one post upload action.
\LAM\TYPES\ConfiguredType | $type | account type |
array | $data | array containing one account in each element |
array | $ids | array( |
array | $failed | list of accounts which were not created successfully |
array | $selectedModules | list of selected account modules |
array | $accounts | list of LDAP entries |
current status
array (
'status' => 'finished' | 'inProgress'
'module' =>
'progress' => 0..100
'errors' => array (
)
doUploadPreActions(\LAM\TYPES\ConfiguredType $type, array $selectedModules, array $attributes) : array
Runs any actions that need to be done before an LDAP entry is created.
\LAM\TYPES\ConfiguredType | $type | account type |
array | $selectedModules | list of selected account modules |
array | $attributes | LDAP attributes of this entry (attributes are provided as reference, handle modifications of $attributes with care) |
array which contains status messages. Each entry is an array containing the status message parameters.
draw_jpeg_photo( $server, $dn, $attr_name = 'jpegphoto', $index, $draw_delete_buttons = false, $options = array())
Draw the jpegPhoto image(s) for an entry wrapped in HTML. Many options are available to specify how the images are to be displayed.
Usage Examples:
draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',"jpegPhoto",0,true,array('img_opts'=>"border: 1px; width: 150px"));
draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',null,1);
$server | ||
$dn | ||
$attr_name | ||
$index | ||
$draw_delete_buttons | ||
$options |
generatePassword(String $dn, array $user, boolean $alternateAddressAllowed, array<mixed,string> $modules) : array
Sets a generated password and displays it or sends it via mail.
String | $dn | LDAP DN |
array | $user | LDAP attributes of user |
boolean | $alternateAddressAllowed | allow sending to alternate mail address |
array<mixed,string> | $modules | account modules |
list of arrays that can be used to create status messages
get_cached_item( $index, $item, $subitem = 'null') : \Returns
Returns the cached array of LDAP resources.
Note that internally, this function utilizes a two-layer cache, one in memory using a static variable for multiple calls within the same page load, and one in a session for multiple calls within the same user session (spanning multiple page loads).
$index | ||
$item | ||
$subitem |
the cached attributed requested,
or null if there is nothing cached..
get_cached_schema( $schema_type)
Returns the cached array of schemaitem objects for the specified $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.
$schema_type |
get_enc_type( $user_password) : string
Detects password encryption type
Returns crypto string listed in braces. If it is 'crypt' password, returns crypto detected in password hash. Function should detect md5crypt, blowfish and extended DES crypt. If function fails to detect encryption type, it returns NULL.
$user_password |
get_icon( $server_id, $dn, $object_classes = array()) : string
Given a DN and server ID, this function reads the DN's objectClasses and determines which icon best represents the entry. The results of this query are cached in a session variable so it is not run every time the tree browser changes, just when exposing new DNs that were not displayed previously. That means we can afford a little bit of inefficiency here in favor of coolness. :)
This function returns a string like "country.png". All icon files are assumed to be contained in the /images/ directory of phpLDAPadmin.
Developers are encouraged to add new icons to the images directory and modify this function as needed to suit their types of LDAP entries. If the modifications are general to an LDAP audience, the phpLDAPadmin team will gladly accept them as a patch.
$server_id | ||
$dn | ||
$object_classes |
get_next_number( $base, $attr, $increment = false, $filter = false, $startmin = null) : integer
For LDAP servers with auto_number enabled, this function will get the next available number using the host's preferred mechanism (pool or search).
This is configured in config.php by server:
$servers->setValue('auto_number','enable',true|false);
The available mechanisms are: pool: The pool mechanism uses a user-configured entry in the LDAP server to store the last used "number". This mechanism simply fetches and increments and returns that value.
search: The search mechanism will search the LDAP server that has the attribute set. It will then find the smallest value and "fills in the gaps" by incrementing the smallest attribute until an unused value is found.
NOTE: Both mechanisms do NOT prevent race conditions or toe-stomping, so care must be taken when actually creating the entry to check that the number returned here has not been used in the mean time. Note that the two different mechanisms may (will!) return different values as they use different algorithms to arrive at their result. Do not be alarmed if (when!) this is the case.
See config.php.example for more notes on the two mechanisms.
$base | ||
$attr | ||
$increment | ||
$filter | ||
$startmin |
get_rdn( $dn, $include_attrs, $decode = false) : string
Given a DN string, this returns the 'RDN' portion of the string.
For example. given 'cn=Manager,dc=example,dc=com', this function returns 'cn=Manager' (it is really the exact opposite of ds_ldap::getContainer()).
$dn | ||
$include_attrs | ||
$decode |
The RDN
get_schema_attribute( $attr_name, string $dn = null, $use_cache = true) : \AttributeType
Gets a single AttributeType object specified by name.
$attr_name | ||
string | $dn | (optional) It is easier to fetch schema if a DN is provided
|
$use_cache |
The specified AttributeType object or false on error.
get_schema_attributes(string $dn = null, $use_cache = true) : array
Gets an associative array of AttributeType objects for the specified server. Each array entry's key is the name of the attributeType in lower-case and the value is an AttributeType object.
string | $dn | (optional) It is easier to fetch schema if a DN is provided
|
$use_cache |
An array of AttributeType objects.
get_schema_objectclass(string $oclass_name, string $dn = null, $use_cache = true) : \ObjectClass
Gets a single ObjectClass object specified by name.
string | $oclass_name | The name of the objectClass to fetch. |
string | $dn | (optional) It is easier to fetch schema if a DN is provided
|
$use_cache |
The specified ObjectClass object or false on error.
get_schema_objectclasses(string $dn = null, $use_cache = true) : array
Gets an associative array of ObjectClass objects for the specified server. Each array entry's key is the name of the objectClass in lower-case and the value is an ObjectClass object.
string | $dn | (optional) It is easier to fetch schema if a DN is provided
|
$use_cache |
An array of ObjectClass objects.
getAvailableModules(string $scope, boolean $mustSupportAdminInterface = false) : array
Returns an array with all available user module names
string | $scope | account type (user, group, host) |
boolean | $mustSupportAdminInterface | module must support LAM admin interface (default: false) |
list of possible modules
getModulesDependencies(string $scope) : array
Returns a hash array (module name => dependencies) of all module dependencies
"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 | $scope | the account type (user, group, host) |
dependencies
getRDNAttributes(string $typeId, array $selectedModules = null) : array
Returns a list of LDAP attributes which can be used to form the RDN.
The list is already sorted by the priority given by the nodules.
string | $typeId | account type (user, group, host) |
array | $selectedModules | return only RDN attributes of these modules |
list of LDAP attributes
getRecursiveAttributesFromObjectClass(\ObjectClass $oClass) : array
Returns the names of all attributes which are managed by the given object class and its parents.
\ObjectClass | $oClass | object class |
list of attribute names
getSelfServiceOptions(string $scope, array $fields, array $attributes, boolean $passwordChangeOnly, array $readOnlyFields) : array
Returns meta HTML code for each self service field.
string | $scope | account type |
array | $fields | input fields (array( |
array | $attributes | LDAP attributes (attribute names in lower case) |
boolean | $passwordChangeOnly | indicates that the user is only allowed to change his password and no LDAP content is readable |
array | $readOnlyFields | list of read-only fields |
meta HTML code (array(
getSelfServiceSettings(string $scope, \selfServiceProfile $profile) : array
Returns a hash array (module name => elements) of all module options for the configuration page.
string | $scope | account type |
\selfServiceProfile | $profile | currently edited profile |
configuration options
getUploadColumns(\LAM\TYPES\ConfiguredType $type, array $selectedModules) : array
Returns an array containing all input columns for the file upload.
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
)
\LAM\TYPES\ConfiguredType | $type | account type |
array | $selectedModules | selected account modules |
column list
is_dn_string( $str) : boolean
Given a string, this function returns true if the string has the format of a DN (ie, looks like "cn=Foo,dc=example,dc=com"). Returns false otherwise.
The purpose of this function is so that developers can examine a string and know if it looks like a DN, and draw a hyperlink as needed.
(See unit_test.php for test cases)
$str |
lamRunLamdaemonTestSuite(String $serverName, String $serverTitle, boolean $testQuota, \htmlTable $container)
Runs all tests for a given server.
String | $serverName | server ID |
String | $serverTitle | server name |
boolean | $testQuota | true, if Quotas should be checked |
\htmlTable | $container | container for HTML output |
lamTestLamdaemon(string $command, boolean $stopTest, \connection $handle, string $testText, \htmlTable $container) : boolean
Runs a test case of lamdaemon.
string | $command | test command |
boolean | $stopTest | specifies if test should be run |
\connection | $handle | SSH connection |
string | $testText | describing text |
\htmlTable | $container | container for HTML output |
true, if errors occured
ldapGetDN(String $dn, array $attributes = array('dn'), \handle $handle = null) : array
Returns the given DN.
String | $dn | DN |
array | $attributes | list of attributes to fetch |
\handle | $handle | LDAP handle (optional for admin interface pages) |
attributes or null if not found
loadSelfServiceProfile(string $name, string $scope) : \selfServiceProfile
Loads all settings of a self service profile.
string | $name | profile name |
string | $scope | account type |
true if file was readable