Manages DHCP entries.

It implements the complete module interface and uses meta-data provided by the account modules for its functions.

Location and naming of modules
All LAM modules are placed in lib/modules/ and are named ".inc". E.g. if you create a new module and its class name is "qmail" then the filename would be "qmail.inc". The class name of a module must contain only a-z, A-Z, 0-9, -, and _.

You can avoid to override many functions by using get_metaData().

All module classes should extend the baseModule class.

package modules
author Roland Gruber

 Methods

Creates a new dhcp_settings object.

__construct(string $scope) 

Parameters

$scope

string

account type

In this function the LDAP account is built up.

build_uploadAccounts(array $rawAccounts, array $ids, array $partialAccounts, array $selectedModules) : array

Calling this method does not require the existence of an enclosing accountContainer.

Returns an array which contains subarrays to generate StatusMessages if any errors occured.

Parameters

$rawAccounts

array

list of hash arrays (name => value) from user input

$ids

array

list of IDs for column position (e.g. "posixAccount_uid" => 5)

$partialAccounts

array

list of hash arrays (name => value) which are later added to LDAP

$selectedModules

array

list of selected account modules

Returns

arraylist of error messages if any

Returns if a given self service field can be set in read-only mode.

canSelfServiceFieldBeReadOnly(String $fieldID, \selfServiceProfile $profile) 
Inherited

inherited_from \baseModule::canSelfServiceFieldBeReadOnly()

Parameters

$fieldID

String

field identifier

$profile

\selfServiceProfile

currently edited profile

Returns true if this module can manage accounts of the current type, otherwise false.

can_manage() : boolean
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

see \global\baseModule::get_metaData()
inherited_from \baseModule::can_manage()

Returns

booleantrue if module fits

Checks if all input values are correct and returns the LDAP attributes which should be changed.

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


Return values:
messages: array of parameters to create status messages
add: array of attributes to add
del: array of attributes to remove
mod: array of attributes to modify
info: array of values with informational value (e.g. to be used later by pre/postModify actions)

Calling this method does not require the existence of an enclosing accountContainer.

inherited_from \baseModule::checkSelfServiceOptions()

Parameters

$fields

string

input fields

$attributes

array

LDAP attributes

$passwordChangeOnly

boolean

indicates that the user is only allowed to change his password and no LDAP content is readable

$readOnlyFields

array

list of read-only fields

Returns

arraymessages and attributes (array('messages' => array(), 'add' => array('mail' => array('test@test.com')), 'del' => array(), 'mod' => array(), 'info' => array()))

Checks if the self service settings are valid.

checkSelfServiceSettings(array $options, \selfServiceProfile $profile) : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

If the input data is invalid the return value is an array that contains arrays to build StatusMessages (message type, message head, message text). If no errors occured the function returns an empty array.

inherited_from \baseModule::checkSelfServiceSettings()

Parameters

$options

array

hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.

$profile

\selfServiceProfile

self service profile

Returns

arrayerror messages

Checks input values of module settings.

check_configOptions(array $scopes, array $options) : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

If the input data is invalid the return value is an array that contains subarrays to build StatusMessages ('message type', 'message head', 'message text').
If no errors occured the function returns an empty array.

see \global\baseModule::get_metaData()
inherited_from \baseModule::check_configOptions()

Parameters

$scopes

array

list of account types which are used

$options

array

hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.

Returns

arraylist of error messages

Checks input values of account profiles.

check_profileOptions(array $options) : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

$options is an hash array (option name => value) that contains the user input. The option values are all arrays containing one or more elements.
If the input data is invalid the return value is an array that contains arrays to build StatusMessages (message type, message head, message text). If no errors occured the function returns an empty array.

see \global\baseModule::get_metaData()
inherited_from \baseModule::check_profileOptions()

Parameters

$options

array

a hash array (name => value) containing the user input

Returns

arraylist of error messages (array(type, title, text)) to generate StatusMessages, if any

This function returns an array with the same syntax as save_attributes().

delete_attributes() : \List
Inherited

Calling this method requires the existence of an enclosing accountContainer.

It allows additional LDAP changes when an account is deleted.

inherited_from \baseModule::delete_attributes()

Returns

\Listof LDAP operations, same as for save_attributes()

This function creates meta HTML code to display the module specific page for the self service.

displaySpecialSelfServicePage(\selfServiceProfile $profile) : \htmlElement
Inherited

see \global\htmlElement
inherited_from \baseModule::displaySpecialSelfServicePage()

Parameters

$profile

\selfServiceProfile

self service settings

Returns

\htmlElementmeta HTML object

Returns the HTML meta data for the main account page.

display_html_attributes() : \htmlElement

Calling this method requires the existence of an enclosing accountContainer.

Returns

\htmlElementHTML meta data

This function creates meta HTML code which will be displayed when an account should be deleted.

display_html_delete() : \htmlElement
Inherited

Calling this method requires the existence of an enclosing accountContainer.

This can be used to interact with the user, e.g. should the home directory be deleted? The output of all modules is displayed on a single page.

see \global\htmlElement
inherited_from \baseModule::display_html_delete()

Returns

\htmlElementmeta HTML object

This function is responsible to do additional tasks after the account has been created in LDAP (e.g.

doUploadPostActions(array $data, array $ids, array $failed, array $temp, array $accounts) : array
Inherited

modifying group memberships, adding Quota etc..).

Calling this method does not require the existence of an enclosing accountContainer.

This function is called as long as the returned status is 'finished'. Please make sure that one function call lasts no longer than 3-4 seconds. Otherwise the upload may fail because the time limit is exceeded. You should not make more than one LDAP operation in each call.

inherited_from \baseModule::doUploadPostActions()

Parameters

$data

array

array containing one account in each element

$ids

array

maps the column names to keys for the sub arrays (array( => ))

$failed

array

list of account numbers which could not be successfully uploaded to LDAP

$temp

array

variable to store temporary data between two post actions

$accounts

array

list of LDAP entries

Returns

arraycurrent status
array (
'status' => 'finished' | 'inProgress' // defines if all operations are complete
'progress' => 0..100 // the progress of the operations in percent
'errors' => array // list of arrays which are used to generate StatusMessages
)

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

doUploadPreActions(array $attributes) : array
Inherited

inherited_from \baseModule::doUploadPreActions()

Parameters

$attributes

array

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

Returns

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

Returns the LDAP attributes which are managed in this module.

getAttributes() : array
Inherited

inherited_from \baseModule::getAttributes()

Returns

arrayattributes

Controls if the module button the account page is visible and activated.

getButtonStatus() : string
Inherited

Calling this method requires the existence of an enclosing accountContainer.

Possible return values:

  • enabled: button is visible and active
  • disabled: button is visible and deactivated (greyed)
  • hidden: no button will be shown

inherited_from \baseModule::getButtonStatus()

Returns

stringstatus ("enabled", "disabled", "hidden")

Returns a DHCP option.

getDHCPOption(String $name) : String

Parameters

$name

String

option name

Returns

Stringvalue

Returns the path to the module icon.

getIcon() : \unknown
Inherited

The path must be releative to graphics (e.g. key.png). You can also set $this->meta['icon']. The preferred size is 32x32px.

see \global\baseModule::get_metaData()
inherited_from \baseModule::getIcon()

Returns

\unknown

Returns a list of aliases for LDAP attributes.

getLDAPAliases() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

All alias attributes will be renamed to the given attribute names.

see \global\baseModule::get_metaData()
inherited_from \baseModule::getLDAPAliases()

Returns

arraylist of aliases like array("alias name" => "attribute name")

This allows modules to create a link to a module specific page for the self service.

getLinkToSpecialSelfServicePage(array $settings) : String
Inherited

The link is shown on the login page of the self service. You can use this to provide e.g. a page to reset passwords.

inherited_from \baseModule::getLinkToSpecialSelfServicePage()

Parameters

$settings

array

self service settings

Returns

Stringlink text (null if no special page used)

Returns a list of LDAP attributes which are managed by this module.

getManagedAttributes() : array
Inherited

All attribute names will be renamed to match the given spelling.

see \global\baseModule::get_metaData()
inherited_from \baseModule::getManagedAttributes()

Returns

arraylist of attributes

Returns a list of managed object classes for this module.

getManagedObjectClasses() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

This is used to fix spelling errors in LDAP-Entries (e.g. if "posixACCOUNT" is read instead of "posixAccount" from LDAP).

Example: return array('posixAccount')

see \global\baseModule::get_metaData()
inherited_from \baseModule::getManagedObjectClasses()

Returns

arraylist of object classes

Returns the LDAP attributes which are managed in this module (with unchanged values).

getOriginalAttributes() : array
Inherited

inherited_from \baseModule::getOriginalAttributes()

Returns

arrayattributes

This function returns a list of PHP extensions (e.g.

getRequiredExtensions() : array
Inherited

hash) which are needed by this module.

Calling this method does not require the existence of an enclosing accountContainer.

see \global\baseModule::get_metaData()
inherited_from \baseModule::getRequiredExtensions()

Returns

arrayextensions

Returns a list of possible input fields and their descriptions.

getSelfServiceFields() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

Format: array( => )

see \global\baseModule::get_metaData()
inherited_from \baseModule::getSelfServiceFields()

Returns

arrayfields

Returns the meta HTML code for each input field.

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

Calling this method does not require the existence of an enclosing accountContainer.

It is not possible to display help links.

see \global\htmlElement
inherited_from \baseModule::getSelfServiceOptions()

Parameters

$fields

array

list of active fields

$attributes

array

attributes of LDAP account

$passwordChangeOnly

boolean

indicates that the user is only allowed to change his password and no LDAP content is readable

$readOnlyFields

array

list of read-only fields

Returns

arraylist of meta HTML elements (field name => htmlTableRow)

This function returns a list of possible LDAP attributes (e.g.

getSelfServiceSearchAttributes() : array
Inherited

uid, cn, ...) which can be used to search for LDAP objects.

Calling this method does not require the existence of an enclosing accountContainer.

see \global\baseModule::get_metaData()
inherited_from \baseModule::getSelfServiceSearchAttributes()

Returns

arrayattributes

Returns a list of self service configuration settings.

getSelfServiceSettings(\selfServiceProfile $profile) : \htmlElement
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The name attributes are used as keywords to load and save settings. We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.

see \global\baseModule::get_metaData()
see \global\htmlElement
inherited_from \baseModule::getSelfServiceSettings()

Parameters

$profile

\selfServiceProfile

currently edited profile

Returns

\htmlElementmeta HTML object

Returns a hash array containing a list of possible LDAP attributes that can be used to form the RDN (Relative Distinguished Name).

get_RDNAttributes() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The returned elements have this form: =>
is the name of the LDAP attribute
defines the priority of the attribute (can be "low", "normal", "high")

Example: return array('uid' => 'normal', 'cn' => 'low')

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_RDNAttributes()

Returns

arraylist of attributes

Returns an alias name for the module.

get_alias() : string
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

This function returns a more descriptive string than the class name. Alias names are used for the buttons on the account pages and the module selection in the configuration wizard.
Please take care that your alias name is not too long. It may contain any character but should not include parts that may be interpreted by the browser (e.g. '<' or '>'). If you use different aliases dependent on the account type please make sure that there is a general alias for unknown types.

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_alias()

Returns

stringalias name

Returns a list of configuration options.

get_configOptions(array $scopes, array $allScopes) : mixed
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The field names are used as keywords to load and save settings. We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.

see \global\baseModule::get_metaData()
see \global\htmlElement
inherited_from \baseModule::get_configOptions()

Parameters

$scopes

array

account types (user, group, host)

$allScopes

array

list of all active account modules and their scopes (module => array(scopes))

Returns

mixedhtmlElement or array of htmlElement

This function returns a list with all depending and conflicting modules.

get_dependencies() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The return value is an array with two sub arrays, "depends" and "conflicts". All values of the conflict array are string values with module names. All values of the depends array are either string values with module names or arrays which include only string values with module names.
If an element of the depends array is itself an array, this means that your module depends on one of these modules.

Example: return array("depends" => array("posixAccount", array("qmail", "sendmail")), "conflicts" => array("exim"))

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_dependencies()

Returns

arraylist of dependencies and conflicts

This function returns the help entry array for a specific help id.

get_help(string $id) : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The result is an hashtable with the following keys:

  • Headline (required)
    The headline of this help entry. Can consist of any alpha-numeric characters. No HTML/CSS elements are allowed.
  • Text (required)
    The text of the help entry which may contain any alpha-numeric characters.
  • SeeAlso (optional)
    A reference to anonther related web site. It must be an array containing a field called "text" with the link text that should be displayed and a field called "link" which is the link target.


Example:

array('Headline' => 'This is the head line', 'Text' => 'Help content', 'SeeAlso' => array('text' => 'LAM homepage', 'link' => 'http://www.ldap-account-manager.org/'))

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_help()

Parameters

$id

string

The id string for the help entry needed.

Returns

arrayThe desired help entry.

Returns an LDAP filter for the account lists

get_ldap_filter() : string
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

Returns an array('or' => '...', 'and' => '...') that is used to build the LDAP filter. Usually, this is used to filter object classes. All "or" filter parts of the base modules are combined with OR and then combined with the "and" parts.
The resulting LDAP filter will look like this: (&(|(OR1)(OR2)(OR3))(AND1)(AND2)(AND3))

Example: return array('or' => '(objectClass=posixAccount)', 'and' => '(!(uid=*$))')

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_ldap_filter()

Returns

stringLDAP filter

Returns the PDF entries for this module.

get_pdfEntries() : array

Returns

arraylist of possible PDF entries

Returns a hashtable with all entries that may be printed out in the PDF.

get_pdfFields() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

This method must be overwritten in case that there are non static values to be returned. The $this->meta['PDF_fields'] array may be used for static content.

Format of returned hashtable:

This function uses XML formatted commands to define the PDF output. Each part in the PDF document is surrounded by "" and "".
Inside the tags there are different ways to format the output:

  • simple line with attribute name and value: attribute nameattribute value
  • table: attribute namevaluevaluevaluevalue

Special commands:

  • Alignment in : You can specify the alignment in tags with align=(L|R|C) (e.g. )
  • Cell width: allows an attribute "width" to set the cell width (e.g. or ).
  • Line breaks: Line breaks can be specified by adding a <
    > tag. The new line will start at the left border of the PDF document.


Examples:

Simple name+value lines:

In most cases you will just want to display a single line per attribute with its name and value.

'myAttribute' => 'AttrName12345'

This will give the following PDF output:

Attribute name: 12345


Multiline values:

Sometimes you have multivalued attributes where it is not applicable to write all values in one line but where you want to list your values one below the other or show a table. This can be done by using the tag.

This example only uses one column but you can just use more tags per tag to display more columns.

'myAttribute' => 'AttrName123456789'

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_pdfFields()

Returns

arrayPDF entries

This function defines what attributes will be used in the account profiles and their appearance in the profile editor.

get_profileOptions() : \htmlElement
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The return value is an object implementing htmlElement.
The field name are used as keywords to load and save profiles. We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.

see \global\baseModule::get_metaData()
see \global\htmlElement
inherited_from \baseModule::get_profileOptions()

Returns

\htmlElementmeta HTML object

Returns the account type of this module (user, group, host)

get_scope() : string
Inherited

inherited_from \baseModule::get_scope()

Returns

stringaccount type

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

get_uploadColumns(array $selectedModules) : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

This funtion returns an array which contains subarrays which represent an upload column. Syntax of column arrays:

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
string: values, // possible input values (optional)
string: default, // default value (optional)
boolean: required // true, if user must set a value for this column
boolean: unique // true if all values of this column must be different values (optional, default: "false")
)

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_uploadColumns()

Parameters

$selectedModules

array

list of selected account modules

Returns

arraycolumn list

Returns a list of module names which must be processed in building the account befor this module.

get_uploadPreDepends() : array
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

The named modules may not be active, LAM will check this automatically.

see \global\baseModule::get_metaData()
inherited_from \baseModule::get_uploadPreDepends()

Returns

arraylist of module names

Manages AJAX requests.

handleAjaxRequest() 
Inherited

This function may be called with or without an account container.

inherited_from \baseModule::handleAjaxRequest()

Initializes the module after it became part of an {@link accountContainer}

init(string $base) 
Inherited

Calling this method requires the existence of an enclosing accountContainer.

inherited_from \baseModule::init()

Parameters

$base

string

the name of the {@link accountContainer} object ($_SESSION[$base])

Returns true if your module is a base module and otherwise false.

is_base_module() : boolean
Inherited

Calling this method does not require the existence of an enclosing accountContainer.

Every account type needs exactly one base module. A base module manages a structural object class. E.g. the inetOrgPerson module is a base module since its object class is structural.

see \global\baseModule::get_metaData()
inherited_from \baseModule::is_base_module()

Returns

booleantrue if base module (defaults to false if no meta data is provided)

This function fills the message array.

load_Messages() 

Calling this method requires the existence of an enclosing accountContainer.

This function loads the LDAP attributes when an account should be loaded.

load_attributes(array $attributes) 
Inherited

Calling this method requires the existence of an enclosing accountContainer.

By default this method loads the object classes and accounts which are specified in getManagedObjectClasses() and getManagedAttributes().

inherited_from \baseModule::load_attributes()

Parameters

$attributes

array

array like the array returned by get_ldap_attributes(dn of account) but without count indices

Loads the values of an account profile into internal variables.

load_profile(array $profile) 

Calling this method does not require the existence of an enclosing accountContainer.

Parameters

$profile

array

hash array with profile values (identifier => value)

This function is used to check if all settings for this module have been made.

module_complete() : boolean
Inherited

Calling this method requires the existence of an enclosing accountContainer.

This function tells LAM if it can create/modify the LDAP account. If your module needs any additional input then set this to false. The user will be notified that your module needs more input.
This method's return value defaults to true.

inherited_from \baseModule::module_complete()

Returns

booleantrue, if settings are complete

This function is used to check if this module page can be displayed.

module_ready() : boolean
Inherited

Calling this method requires the existence of an enclosing accountContainer.

Your module might depend on input of other modules. This function determines if the user can change to your module page or not. The return value is true if your module accepts input, otherwise false.
This method's return value defaults to true.

inherited_from \baseModule::module_ready()

Returns

booleantrue, if page can be displayed

Allows the module to run commands after the LDAP entry is deleted.

postDeleteActions() : array
Inherited

Calling this method requires the existence of an enclosing accountContainer.

inherited_from \baseModule::postDeleteActions()

Returns

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

Allows the module to run commands after the LDAP entry is changed or created.

postModifyActions(boolean $newAccount, array $attributes) : array
Inherited

Calling this method requires the existence of an enclosing accountContainer.

inherited_from \baseModule::postModifyActions()

Parameters

$newAccount

boolean

new account

$attributes

array

LDAP attributes of this entry

Returns

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

Allows the module to run commands after the LDAP entry is changed or created.

postModifySelfService(array $attributes) : boolean
Inherited

inherited_from \baseModule::postModifySelfService()

Parameters

$attributes

array

LDAP attributes of this entry

Returns

booleantrue, if no problems occured

Allows the module to run commands before the LDAP entry is deleted.

preDeleteActions() : array
Inherited

Calling this method requires the existence of an enclosing accountContainer.

inherited_from \baseModule::preDeleteActions()

Returns

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

Allows the module to run commands before the LDAP entry is changed or created.

preModifyActions(boolean $newAccount, array $attributes) : array
Inherited

Calling this method requires the existence of an enclosing accountContainer.

The modification is aborted if an error message is returned.

inherited_from \baseModule::preModifyActions()

Parameters

$newAccount

boolean

new account

$attributes

array

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

Returns

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

Allows the module to run commands before the LDAP entry is changed or created.

preModifySelfService(array $attributes) : boolean
Inherited

An error message should be printed if the function returns false.

inherited_from \baseModule::preModifySelfService()

Parameters

$attributes

array

LDAP attributes of this entry

Returns

booleantrue, if no problems occured

Processes user input of the primary module page.

process_attributes() : array

It checks if all input values are correct and updates the associated LDAP attributes.

Returns

arraylist of info/error messages

Returns a list of modifications which have to be made to the LDAP account.

save_attributes() : array

Calling this method requires the existence of an enclosing accountContainer.


This function returns an array with 3 entries:
array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... )
DN is the DN to change. It is possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid)

"add" are attributes which have to be added to the LDAP entry
"remove" are attributes which have to be removed from the LDAP entry
"modify" are attributes which have to be modified in the LDAP entry
"notchanged" are attributes which stay unchanged
"info" values with informational value (e.g. to be used later by pre/postModify actions)

This builds the required comands from $this-attributes and $this->orig.

Returns

arraylist of modifications
This function returns an array with 3 entries:
array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... )
DN is the DN to change. It may be possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid)
"add" are attributes which have to be added to LDAP entry
"remove" are attributes which have to be removed from LDAP entry
"modify" are attributes which have to been modified in LDAP entry
"info" are values with informational value (e.g. to be used later by pre/postModify actions)

Specifies if this module supports the LAM admin interface.

supportsAdminInterface() : boolean
Inherited

The LAM admin interface are the pages that allow to manage e.g. users and groups. In contrast there is also the LAM self service interface. Most modules support the admin interface.

inherited_from \baseModule::supportsAdminInterface()

Returns

booleansupport admin interface

Adds a text input field that may contain multiple values to the given htmlTable.

addMultiValueInputTextField(\htmlTable $container, String $attrName, String $label, boolean $required, integer $length) 
Inherited

The field name will be the same as the attribute name plus a counting number (e.g. street_0). The last field will be followed by a button to add a new value. This is named add_{attribute name} (e.g. add_street). There must be a help entry with the attribute name as ID. A new line will also be added after this entry so multiple calls will show the fields one below the other.

inherited_from \baseModule::addMultiValueInputTextField()

Parameters

$container

\htmlTable

parent container

$attrName

String

attribute name

$label

String

label name

$required

boolean

this is a required field (default false)

$length

integer

field length

Adds a simple text input field to the given htmlTable.

addSimpleInputTextField(\htmlTable $container, String $attrName, String $label, boolean $required, integer $length, boolean $isTextArea) 
Inherited

The field name will be the same as the attribute name. There must also be a help entry with the attribute name as ID. A new line will also be added after this entry so multiple calls will show the fields one below the other.

inherited_from \baseModule::addSimpleInputTextField()

Parameters

$container

\htmlTable

parent container

$attrName

String

attribute name

$label

String

label name

$required

boolean

this is a required field (default false)

$length

integer

field length

$isTextArea

boolean

show as text area (default false)

Adds a simple PDF entry to the given array.

addSimplePDFField(array $result, String $name, String $label, String $attrName, String $delimiter) 
Inherited

inherited_from \baseModule::addSimplePDFField()

Parameters

$result

array

result array (entry will be added here)

$name

String

ID

$label

String

label name

$attrName

String

attribute name (default: =$name)

$delimiter

String

delimiter if multiple attribute values exist (default: ", ")

Adds a simple text input field for the self service.

addSimpleSelfServiceTextField(array $container, String $name, String $label, array $fields, array $attributes, array $readOnlyFields, boolean $required, boolean $isTextArea) 
Inherited

The field name will be the same as the class name plus "_" plus attribute name (e.g. posixAccount_cn).

inherited_from \baseModule::addSimpleSelfServiceTextField()

Parameters

$container

array

array that is used as return value for getSelfServiceOptions()

$name

String

attribute name (== field name)

$label

String

label to display in front of input field

$fields

array

list of active fields

$attributes

array

attributes of LDAP account

$readOnlyFields

array

list of read-only fields

$required

boolean

field is required

$isTextArea

boolean

display as text area

Checks the input value of a self service text field.

checkSimpleSelfServiceTextField(array $container, String $name, array $attributes, string $fields, array $readOnlyFields, String $validationID) 
Inherited

The field name must be the same as the class name plus "_" plus attribute name (e.g. posixAccount_cn). If validation is used then there must exist a message named [{attribute name}][0] (e.g. $this->messages['street'][0]).

inherited_from \baseModule::checkSimpleSelfServiceTextField()

Parameters

$container

array

return value of checkSelfServiceOptions()

$name

String

attribute name

$attributes

array

LDAP attributes

$fields

string

input fields

$readOnlyFields

array

list of read-only fields

$validationID

String

validation ID for get_preg()

Returns the {@link accountContainer} object.

getAccountContainer() : \accountContainer
Inherited

see \global\accountContainer
inherited_from \baseModule::getAccountContainer()

Returns

\accountContaineraccountContainer object

Returns if the given configuration option is set.

isBooleanConfigOptionSet(String $optionName) : boolean
Inherited

This function returns false if the configuration options cannot be read.

inherited_from \baseModule::isBooleanConfigOptionSet()

Parameters

$optionName

String

name of the option

Returns

booleantrue if option is set

Validates a multi-value text field.

processMultiValueInputTextField(String $attrName, array $errors, String $validationID) 
Inherited

The input fields must be created with function addMultiValueInputTextField(). If validation is used then there must exist a message named [{attribute name}][0] (e.g. $this->messages['street'][0]).

inherited_from \baseModule::processMultiValueInputTextField()

Parameters

$attrName

String

attribute name

$errors

array

errors array where to put validation errors

$validationID

String

validation ID for function get_preg() (default: null, null means no validation)

Calculates the net mask from the subnet.

calculateNetMask(String $subnet) : integer

Parameters

$subnet

String

subnet

Returns

integernetmask

Checks if the subnet mask is valid.

checkSubnetMask(String $mask) : boolean

Parameters

$mask

String

subnet mask

Returns

booleancorrect or incorrect

Returns the default lease time.

getDefaultLeaseTime() : String

Returns

Stringtime

Returns the maximum lease time.

getMaxLeaseTime() : String

Returns

Stringtime

Sets a DHCP option.

setDHCPOption(String $name, String $value) 

Parameters

$name

String

option name

$value

String

option value

Sets the default lease time.

setDefaultLeaseTime(String $time) 

Parameters

$time

String

time

Sets the maximum lease time.

setMaxLeaseTime(String $time) 

Parameters

$time

String

time

 Properties

 

LDAP attributes

$attributes 

 

if true, managed object classes are added when an account is created or loaded (default: true)

$autoAddObjectClasses 
Inherited

inherited_from \baseModule::$$autoAddObjectClasses
 

contains all error messages of a module

$messages 
Inherited

inherited_from \baseModule::$$messages
 

includes all meta data provided by the sub class

$meta 
Inherited

inherited_from \baseModule::$$meta
 

configuration settings of all modules

$moduleSettings 
Inherited

inherited_from \baseModule::$$moduleSettings
 

contains all ldap attributes which are loaded from ldap

$orig 
Inherited

inherited_from \baseModule::$$orig
 

self service settings of all modules

$selfServiceSettings 
Inherited

inherited_from \baseModule::$$selfServiceSettings
 

all netbios node types

$all_netbios_node_types 

 

name of parent accountContainer ($_SESSION[$base])

$base 
Inherited

inherited_from \baseModule::$$base
 

the account type of this module (user, group, host)

$scope 
Inherited

inherited_from \baseModule::$$scope