2006-07-09 14:14:57 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2006-11-15 17:14:31 +00:00
< html > < head >
< meta content = "text/html; charset=ISO-8859-15" http-equiv = "content-type" > < title > Module specification< / title >
2006-07-09 14:14:57 +00:00
< style >
<!--
h2 {
2008-01-06 18:15:35 +00:00
color:#000080;
2006-07-09 14:14:57 +00:00
}
h3 {
2008-01-06 18:15:35 +00:00
color:#000080;
2006-07-09 14:14:57 +00:00
}
h4 {
2008-01-06 18:15:35 +00:00
color:#000080;
2006-07-09 14:14:57 +00:00
}
table {
background-color:#bdcaff;
}
-->
2008-01-06 18:15:35 +00:00
< / style >
< link rel = "shortcut icon" type = "image/x-icon" href = "images/favicon.ico" >
< / head >
2006-07-09 14:14:57 +00:00
< body >
< h1 style = "text-align: center;" > This document describes the module
interface for LDAP Account Manager< / h1 >
< br >
< br >
< h2 > 1. Location and naming of modules< / h2 >
All LAM modules are placed in lib/modules/ and are named "< class
name> .inc".< br >
E.g. if you create a new module and its class name is "qmail" then the
filename would be "qmail.inc".< br >
< br >
The class name of a module must contain only a-z, A-Z, 0-9, -, and _.< br >
All module classes should extend the baseModule class.< br >
< br >
< h2 > 2. Class functions< / h2 >
< h3 > 2.1. Functions that have to work without superior accountContainer< br >
< / h3 >
< h3 > < br >
< / h3 >
< h3 > 2.1.1. can_manage*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function can_manage()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns < span style = "font-style: italic;" > true< / span > if this module
can manage accounts of the current type< span style = "font-style: italic;" > < / span > ,
otherwise < span style = "font-style: italic;" > false< / span > .< br >
< br >
< br >
< h3 > 2.1.2. get_alias*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_alias()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns a more descriptive string than the class name.
Alias names are used for the buttons of the account pages and the
module selection of the configuration wizard.< br >
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 '> ').< br >
If you use different aliases dependent on the account type please make
sure that there is a general alias for unknown types.< br >
< br >
< h3 > 2.1.3. is_base_module*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function is_base_module()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns < span style = "font-weight: bold;" > true< / span > if your module is
a base module and otherwise < span style = "font-weight: bold;" > false< / span > .< br >
< span style = "font-weight: bold;" > < / span > < br >
Every account type needs exactly one base module. A base module manages
a structural object class.< br >
E.g. the inetOrgPerson module is a base module since its object class
is structural.< br >
< br >
< h3 > 2.1.4. get_ldap_filter*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_ldap_filter()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns an array('or' => '...', 'and' => '...') that is used to
build the LDAP filter. Usually
used to filter object classes.< br >
< span style = "font-weight: bold;" > < / span > < br >
All "or" filter parts of the base modules are combined with OR and then
combined with the "and" parts.< br >
The resulting LDAP filter will look like this:
(& (|(OR1)(OR2)(OR3))(AND1)(AND2)(AND3))< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example: < span style = "font-style: italic;" > return "('or' =>
2006-07-09 14:14:57 +00:00
'(objectClass=posixAccount)', 'and' => '(!(uid=*$))')"< / span > < / span > < br >
< span style = "font-weight: bold; color: rgb(255, 0, 0);" > < / span > < br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.5. getManagedObjectClasses*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getManagedObjectClasses()< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns an array of object class names which are managed by this module.< br >
< span style = "font-weight: bold;" > < / span > < br >
This is used to fix spelling errors in LDAP-Entries (e.g. if
"posixACCOUNT" is read instead of "posixAccount" from LDAP).< br >
< br >
< span style = "font-weight: bold;" > Example: < span style = "font-style: italic;" > return "('posixAccount')"< / span > < / span > < br >
< span style = "font-weight: bold; color: rgb(255, 0, 0);" > < / span > < br >
< h3 > 2.1.6. getLDAPAliases*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getLDAPAliases()< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns a list of LDAP attribute alias names.< br >
< br >
< span style = "font-weight: bold;" > return array(< alias name> =>
< attribute name> )< / span > < br >
< br >
< h3 > 2.1.7. get_RDNAttributes*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_RDNAttributes()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns a hash array containing a list of possible LDAP attributes that
can be used to form the RDN (Relative Distinguished Name).< br >
< span style = "font-weight: bold;" > < / span > < br >
The keys of the array are the LDAP attributes, the values are the
priority < span style = "font-style: italic;" > ("low"/"normal"/"high")< / span > .< br >
Attributes with higher priority are placed higher in the drop down box
for the RDN selection.< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example: < span style = "font-style: italic;" > return "('uid' =>
2006-07-09 14:14:57 +00:00
'normal', 'cn' => 'low')"< / span > < / span > < br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold; color: rgb(255, 0, 0);" > < / span >
< h3 > 2.1.8. get_dependencies*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center; font-weight: bold;" > function
2006-07-09 14:14:57 +00:00
get_dependencies()< br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns a list of modules it depends on.< br >
< br >
2006-11-15 17:14:31 +00:00
The return value is an array with two sub arrays, < span style = "font-weight: bold;" > "depends"< / span > and < span style = "font-weight: bold;" > "conficts"< / span > .< br >
2006-07-09 14:14:57 +00:00
All values of the conflict array are string values with module names.< br >
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.< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example: < / span > < span style = "font-weight: bold; font-style: italic;" > return array("depends"
2006-07-09 14:14:57 +00:00
=> array("posixAccount", array("qmail", "sendmail")), "conflicts"
2006-11-15 17:14:31 +00:00
=> array("exim"));< / span > < br style = "font-weight: bold; font-style: italic;" >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.9. get_metaData()< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_metaData()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns an hash array including meta data for the baseModule.< br >
< br >
< span style = "font-weight: bold;" > Example: return array("is_base" =>
true);< / span > < br style = "font-weight: bold;" >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.10. get_configOptions()*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_configOptions($scopes,
$allScopes)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns a list of configuration options.< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > $scopes< / span > is a list of < span style = "font-style: italic;" > account types< / span > (user, group, host)
2006-07-09 14:14:57 +00:00
which are used.< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > $allScopes< / span > is a list of all
active account modules and their scopes (module => array(scopes))< br >
< br >
2006-07-09 14:14:57 +00:00
The return value is an array
that contains < span style = "font-weight: bold;" > meta HTML code< / span > .< br >
< br >
The type "fieldset" is not allowed here.< br >
The < span style = "font-style: italic;" > name< / span > 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 confilcts.< br >
2006-11-15 17:14:31 +00:00
< br > < h3 > 2.1.11. check_configOptions*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function check_configOptions($scopes,
2006-07-09 14:14:57 +00:00
$options)< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function checks the input for module configuration settings.< br >
< br >
< span style = "font-weight: bold;" > $scopes< / span > is a list of used
account types (user, group, host).< br >
< span style = "font-weight: bold;" > < / span > < span style = "font-weight: bold;" > $options< / span >
is an hash array
(option name => value) that contains the input. The option values
are all arrays containing one or more elements.< br >
If the input data is invalid the return value is an array that contains
arrays to build StatusMessages (0 => message type, 1 => message
head, 2 => message text, 3 => additional variables).< br >
2006-11-15 17:14:31 +00:00
If no errors occured the function returns an empty array.< span style = "font-weight: bold;" > < / span > < br >
2006-07-09 14:14:57 +00:00
< br style = "font-weight: bold;" >
< span style = "font-weight: bold;" > < / span >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.12. get_scope()< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_scope()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns the account type (user/group/host) of this module object.< br >
< span style = "font-weight: bold;" > < / span > < br >
< span style = "font-weight: bold;" > This function is provided by the
baseModule and should not be overwritten.< / span > < br >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.13. get_uploadColumns*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_uploadColumns()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns a list of column entries for the upload .csv-file.< br >
Each column entry is an array containing these values:< br >
< ul >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > string< / span >
name:< / span > fixed non-translated name which is used as column name
(should be of format: < module name> _< column name> )< / li >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > string< / span >
description:< / span > short descriptive name< / li >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > string< / span >
help:< / span > help ID< / li >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > string< / span >
example:< / span > example value< / li >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > string< / span >
2006-11-15 17:14:31 +00:00
values:< / span > possible input values< span style = "font-style: italic;" > < / span > < span style = "font-weight: bold; font-style: italic;" > (optional)< / span > < / li >
< li > < span style = "font-weight: bold; font-style: italic;" > string< / span > < span style = "font-weight: bold;" > default:< / span > < span style = "font-weight: bold; font-style: italic;" > < / span > default value < span style = "font-weight: bold; font-style: italic;" > (optional)< / span > < br >
2006-07-09 14:14:57 +00:00
< / li >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > boolean< / span >
2006-11-15 17:14:31 +00:00
required:< / span > true, if user must set a value for this column < span style = "font-weight: bold; font-style: italic;" > (optional, default:
2006-07-09 14:14:57 +00:00
"false")< / span > < br >
< / li >
< li > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > boolean< / span >
unique:< / span > true if
2006-11-15 17:14:31 +00:00
all values of this column must be different values < span style = "font-style: italic; font-weight: bold;" > (optional, default:
2006-07-09 14:14:57 +00:00
"false")< / span > < br >
< / li >
< / ul >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.14. get_uploadPreDepends*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_uploadPreDepends()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns a list of module names which must be processed before this
module at builing accounts.< br >
The named modules may not be active, LAM will check this automatically.< br >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.15. build_uploadAccounts< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_uploadAccounts($rawAccounts,
2006-07-09 14:14:57 +00:00
$ids, $partialAccounts)< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function takes the user input and generates the LDAP accounts.< br >
< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
$rawAccounts:< / span > The user input data, contains one sub array for
each account.< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
$ids:< / span > Maps the column names to keys for the sub arrays.< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
$partialAccounts:< / span > Containing one sub array for each account,
format is the same as used for ldap_add().< br >
< br >
Returns an array which contains sub arrays to generate StatusMessages
if any errors occured.< br >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.16. do_uploadPostActions< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function do_uploadPostActions($data, $ids,
2006-07-09 14:14:57 +00:00
$failed, & $temp)< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function is responsible to do additional tasks after the account
has been created in LDAP.< br >
E.g. modifying group memberships, adding Quota etc..< br >
< br >
2006-11-15 17:14:31 +00:00
This function is called as long as the returned status is < span style = "font-style: italic;" > 'finished'< / span > . Please make sure that
2006-07-09 14:14:57 +00:00
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.< br >
< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
$data:< / span > The user input data, contains one sub array for each
account.< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
$ids:< / span > Maps the column names to keys for the sub arrays.< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
$failed:< / span > List of account numbers which could not be successfully
uploaded to LDAP.< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > array< / span >
& $temp:< / span > Pointer to temporary variable which can be used to
save information between two function calls.< br >
< br >
< span style = "font-weight: bold;" > return array (< / span > < br >
< span style = "font-weight: bold;" > 'status' =>
'finished' | 'inProgress'< / span > // Defines if all
operations are complete< br >
< span style = "font-weight: bold;" > 'progress' =>
0..100< / span > // The progress of the operations in percent< br >
< span style = "font-weight: bold;" > 'errors' =>
array()< / span > // List of arrays which are used to generate
StatusMessages< br >
< span style = "font-weight: bold;" > )< / span > < br >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.17. get_profileOptions*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_profileOptions()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function defines what attributes will be used in the account
profiles and their appearance in the profile editor.< br >
< br >
< span style = "font-weight: bold;" > < / span > The return value is an array
that contains < span style = "font-weight: bold;" > meta HTML code< / span > .< br >
< br >
The type "fieldset" is not allowed here.< br >
The < span style = "font-style: italic;" > name< / span > attributes 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 confilcts.< br >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.18. check_profileOptions*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function check_profileOptions($options)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function checks the input for a new or modified account profile.< br >
< br >
< span style = "font-weight: bold;" > < / span > < span style = "font-weight: bold;" > $options< / span >
is an hash array
(option name => value) that contains the input. The option values
are all arrays containing one or more elements.< br >
If the input data is invalid the return value is an array that contains
arrays to build StatusMessages (0 => message type, 1 => message
head, 2 => message text, 3 => additional variables).< br >
2006-11-15 17:14:31 +00:00
If no errors occured the function returns an empty array.< span style = "font-weight: bold;" > < / span > < br >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.19. load_profile*< / h3 >
2006-07-09 14:14:57 +00:00
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function load_profile($profile)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function loads the values from an account profile to the module's
internal data structures.< br >
< br >
< span style = "font-weight: bold;" > < / span > < span style = "font-weight: bold;" > $profile< / span >
is an hash array (identifier => array(values)) with all values
of an account profile.< br >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 2.1.20. getRequiredExtensions*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getRequiredExtensions()< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns a list of PHP extensions (e.g. mhash) which are
needed by this module.< br >
< br >
< h3 > 2.1.21. getSelfServiceSearchAttributes*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getSelfServiceSearchAttributes()< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns a list of possible LDAP attributes (e.g. uid, cn, ...) which can be used to search for LDAP objects.< br >
< br >
< h3 > 2.1.22. getSelfServiceFields*< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getSelfServiceFields()< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns a list of possible self service fields and their descriptions.< br >
< br >
< span style = "font-weight: bold;" > return array ('myField' => 'Field description');< / span > < br >
< br >
< h3 > 2.1.23. getSelfServiceOptions< / h3 >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getSelfServiceOptions($fields, $attributes)< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
Builds and returns the meta HTML code for each self service field.< br >
< br >
< span style = "font-weight: bold;" > $fields:< / span > list of self service field names< br >
< span style = "font-weight: bold;" > $attributes:< / span > LDAP attributes of the current account (all lower case)< br >
< br >
< h3 > 2.1.24. checkSelfServiceOptions< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function checkSelfServiceOptions($fields, $attributes)< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns a list of LDAP operations and error messages.< br >
< span style = "font-weight: bold;" > < br >
$fields:< / span > list of self service field names< br >
< span style = "font-weight: bold;" > $attributes:< / span > LDAP attributes of the current account (all lower case)< br >
< br >
< span style = "font-weight: bold;" > return array(< / span > < br style = "font-weight: bold;" >
< span style = "font-weight: bold;" > 'messages' => array(array('ERROR', 'Error topic', 'Error message')),< / span > < br style = "font-weight: bold;" >
< span style = "font-weight: bold;" > 'add' => array('mail' => array('test@test.com')),< / span > < br style = "font-weight: bold;" >
< span style = "font-weight: bold;" > 'mod' => array(),< / span > < br style = "font-weight: bold;" >
< span style = "font-weight: bold;" > 'del' => array(),< / span > < br style = "font-weight: bold;" >
< span style = "font-weight: bold;" > );< / span > < br style = "font-weight: bold;" >
2007-11-04 11:08:16 +00:00
< span style = "font-weight: bold;" > < br >
< / span >
< h3 > 2.1.25. getSelfServiceSettings< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getSelfServiceSettings()< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
Returns a list of self service configuration settings.< br >
< br >
The return value is an array
that contains < span style = "font-weight: bold;" > meta HTML code< / span > .< br >
< br >
The type "fieldset" is not allowed here.< br >
The < span style = "font-style: italic;" > name< / span > 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 confilcts.< br >
< span style = "font-weight: bold;" > < / span > < br >
< h3 > 2.1.26. checkSelfServiceSettings< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function checkSelfServiceSettings($options)< / span > < br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
Checks if the self service settings are valid.< br >
< br >
< span style = "font-weight: bold;" > $options:< / span > is an hash array
(option name => value) that contains the input. The option values
are all arrays containing one or more elements.< br >
< br >
If the input data is invalid the return value is an array that contains
arrays to build StatusMessages (0 => message type, 1 => message
head, 2 => message text, 3 => additional variables).< br >
If no errors occured the function returns an empty array.< br >
< span style = "font-weight: bold;" > < / span > < br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > < br >
< br >
< / span >
2006-07-09 14:14:57 +00:00
< h3 > 2.2. Functions which are called inside of an account container< br >
< / h3 >
< h3 > 2.2.1. init< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function init($base)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
2006-11-15 17:14:31 +00:00
Every module needs a initializing function that has an< span style = "font-style: italic;" > < span style = "font-weight: bold;" > account
2006-07-09 14:14:57 +00:00
container< / span > < / span > as argument $base.< br >
With this account container you can interact with other modules and use
several helper functions.< br >
< br >
< h3 > 2.2.2. module_ready< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function module_ready()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
Your module might depend on input of other modules. This function
determines if the user can change to your module page or not.< br >
The return value is < span style = "font-weight: bold;" > true< / span > if
your module accepts input, otherwise < span style = "font-weight: bold;" > false< / span > .< br >
< br >
This function is implemented by the < span style = "font-style: italic;" > baseModule< / span >
which returns < span style = "font-weight: bold;" > true< / span > as default.< br >
< br >
< h3 > 2.2.3. module_complete< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function module_complete()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function tells LAM if it can create/modify the LDAP account. If
2006-11-15 17:14:31 +00:00
your module needs any additional input then set this to < span style = "font-weight: bold;" > false< / span > . The user will be notified
2006-07-09 14:14:57 +00:00
that your module needs more input.< br >
< br >
This function is implemented by the < span style = "font-style: italic;" > baseModule< / span >
which returns < span style = "font-weight: bold;" > true< / span > as default.< br >
< br >
< h3 > 2.2.4. getButtonStatus< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function getButtonStatus()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function tells LAM if the module button on the account page is
visible and active.< br >
The function may return these values:< br >
< ul >
< li > < span style = "font-weight: bold;" > enabled:< / span > button is
visible and active< / li >
< li > < span style = "font-weight: bold;" > disabled:< / span > button is
visible and deactivated (greyed)< / li >
< li > < span style = "font-weight: bold;" > hidden:< / span > no button will be
shown< br >
< / li >
< / ul >
< br >
< h3 > 2.2.4. get_help< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_help($helpID)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function is called when a page requests a help topic from this
module.< br >
< span style = "font-weight: bold;" > $helpID< / span > is the help identifier;
it must only contain a-z, A-Z, 0-9
-, . and _.< br >
It must return the help entry as array for the submitted help
identifier. The format of the array to be returned is described in
section 4. "Help entry syntax".< br >
< br >
< h3 > 2.2.7. get_pdfEntries< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function get_PDF_Entries()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function is called when a PDF is to be created.< br >
It returns the fields which are printed in the PDF file for the
specified account type. At the monent there is no (easy) possibility
for the user to decide which fields are to be displayed. Perhaps there
will be a PDF config tool in future releases where you can offer the
user to decide which fields are to be displayed on the PDF file. The
format of the array to be returned is described in section 5. "PDF
syntax".< br >
< br >
< h3 > 2.2.8. dynamic_Message< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function dynamic_Message($attribute, $id)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function is only needed when a status message contains strings
with variables.< br >
< span style = "font-weight: bold;" > $attribute< / span > is the attribute the
message is corresponding to.< br >
< span style = "font-weight: bold;" > $id< / span > selects the exact message.< br >
< br >
Returnis an array as expected from StatusMessage().< br >
< br >
< h3 > 2.2.9. load_Messages< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function load_Messages()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function is fills the array $this-> messages. First Index (x) is
the attribute the message is corresponding to.< br >
Second Index (y) selects the exact message. Third Index (z) contains an
array as expected from StatusMessage().< br >
$this-> messages[x][y][z]< br >
< br >
< h3 > 2.2.10. load_attributes< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function load_attributes($attr)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function loads attributes when an account should be loaded.< br >
< span style = "font-weight: bold;" > $attr< / span > is an array like the
array returned by get_ldap_attributes(dn of account) but without count
indicees.< br >
If all attributes are very simple are part of the dn of account it's
possible to just call $this-> load_ldap_attributes($attr)< br >
which is part of baseModule.< br >
The function load_ldap_attributes loads all attributes which fit to the
objectClass of the module.< br >
This function has t be expanded when attributes have to be loaded from
a different DN or handled completly< br >
separat.< br >
< br >
< h3 > 2.2.11. save_attributes< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function save_attributes()< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns an array with changes which should be saved.< br >
The return array has the following syntax: First index is the ldap dn
which should be changed. Second< br >
index is the kind of modification. Possible values are: 'add',
'modify', 'notchanged', 'remove'.< br >
Third index is the attribute which should be changes. Fourth index is
an array with all values of< br >
an attribute.< br >
< span style = "font-weight: bold;" > < / span > If you want to call lamdaemon
first index is 'lamdaemon'. Second index is 'command'. Third index is
the command< br >
itself which should be executed by lamdaemon.< br >
< br >
This function is implemented by the < span style = "font-style: italic;" > baseModule< / span >
which builds the required comands from < span style = "font-weight: bold;" > $this-attributes< / span >
and < span style = "font-weight: bold;" > $this-> orig< / span > .< br >
< br >
< h3 > 2.2.12. delete_attributes< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function delete_attributes($post)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function returns an array with the same syntax as
save_attributes(). It additional LDAP changes when an account is
deleted.< br >
< span style = "font-weight: bold;" > $post< / span > is the $_POST array.< br >
< br >
< br >
< h3 > 2.2.13. process_attributes< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function process_attributes($post)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function processes user input. It checks user input. It also
saves changes in attributes.< br >
It may
return an array which contains status messages. Each entry is an array
containing the status message parameters.< br >
< span style = "font-weight: bold;" > $post< / span > is the $_POST
array.< br >
< br >
< span style = "font-weight: bold; text-decoration: underline;" > Example:< / span > < br >
< br >
return array(0 => array('ERROR', 'Invalid input!', 'This is not
allowed here.'));< br >
< br >
< br >
< h3 > 2.2.14. process_*< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function process_*($post)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function has the exact behavoir like process_attributes function.
* is the name of the subpage which< br >
should be processed.< br >
< span style = "font-weight: bold;" > $post< / span > is the $_POST array. It
is needed to interact with the user.< br >
< br >
< br >
< h3 > 2.2.15. display_html_attributes($post)< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function display_html_attributes($post)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function creates meta HTML code. The code is the page the module
wants to display.< br >
Return is an array of meta HTML code.< br >
< span style = "font-weight: bold;" > $post< / span > is the $_POST array. It
is needed t interact with the user.< br >
< br >
< br >
< h3 > 2.2.16. display_html_*($post)< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function display_html_*($post)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function has the exact behavoir like display_html_attributes(). *
is the name of the subpage which< br >
should be displayed.< br >
< span style = "font-weight: bold;" > $post< / span > is the $_POST array. It
is needed t interact with the user.< br >
< br >
< span style = "font-weight: bold;" > < br >
< / span >
< h3 > 2.2.17. display_html_delete($post)< br >
< / h3 >
< br >
< table border = "0" cellpadding = "2" cellspacing = "2" >
< tbody >
< tr >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; text-align: center;" > < span style = "font-weight: bold;" > function display_html_delete($post)< / span > < br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< / tbody >
< / table >
< br >
This function creates meta HTML code. The code will be displayed when
an account should be deleted.< br >
This is needed to interact, e.g. should the home directory be deleted?< br >
The output of all modules is displayed on a single page.< br >
Return is an array of meta HTML code.< br >
< span style = "font-weight: bold;" > $post< / span > is the $_POST array. It
is needed t interact with the user.< br >
< br >
< br >
< br >
< span style = "font-weight: bold;" > *: These functions do not need to be
implemented if meta data is supplied. See 6 for a list of meta data
formats.< / span > < br >
< h3 > < br >
< / h3 >
< h2 > 3. Meta HTML code< / h2 >
The modules are not allowed to display HTML code directly but return
meta HTML code. This allows to have a common design for all module
pages.< br >
2006-11-15 17:14:31 +00:00
Meta HTML code is always returned as a three dimensional < span style = "font-weight: bold;" > array[a][b][c]< / span > where < span style = "font-weight: bold;" > a< / span > is the row number, < span style = "font-weight: bold;" > b< / span > is the coumn number and < span style = "font-weight: bold;" > c< / span > is is a < span style = "font-style: italic;" > data elememt< / span > .< br >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Format for < span style = "font-style: italic;" > data elements< / span > :< / span > < br >
2006-07-09 14:14:57 +00:00
< br >
A < span style = "font-style: italic;" > data element< / span > is an array
which contains the data to display.< br >
All < span style = "font-style: italic;" > data elements< / span > must
contail a value < span style = "font-weight: bold;" > "kind"< / span > which
defines what kind of element should be displayed.< br >
< br >
These are the possibilies for < span style = "font-weight: bold;" > kind< / span >
and what other options are implicated:< br >
< br >
< ul >
< li > < span style = "font-weight: bold;" > fieldset:< / span > Inserts a
fieldset.< / li >
< ul >
< li > < span style = "font-weight: bold;" > legend:< / span > The legend of
the fieldset.< / li >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > value:< / span > A < span style = "font-style: italic;" > data element< / span > . Can be used
2006-07-09 14:14:57 +00:00
recursively.< / li >
< / ul >
< li > < span style = "font-weight: bold;" > help:< / span > Adds a help link.< / li >
< ul >
< li > < span style = "font-weight: bold;" > value:< / span > The help number
for the help entry.< / li >
< li > < span style = "font-weight: bold;" > scope:< / span > The account type
for the help entry.< br >
< / li >
< / ul >
< li > < span style = "font-weight: bold;" > input:< / span > Adds a HTML input
element.< / li >
< ul >
< li > < span style = "font-weight: bold;" > name:< / span > The name of the
element, will be used later as variable name when user input is
returned.< / li >
< li > < span style = "font-weight: bold;" > type:< / span > allowed values:
submit, reset, checkbox, text, password, file, hidden< / li >
< li > < span style = "font-weight: bold;" > checked:< / span > Boolean value,
if true a checkbox will be checked. This value is only needed or
checkboxes.< / li >
< li > < span style = "font-weight: bold;" > disabled:< / span > Boolean
value, if true the element will be disabled.< / li >
< li > < span style = "font-weight: bold;" > size:< / span > The length of the
input element, only used for text, password and file.< / li >
< li > < span style = "font-weight: bold;" > maxlength:< / span > The maximum
size of the input element, only used for text, password and file.< / li >
< li > < span style = "font-weight: bold;" > value:< / span > The element will
have this value as default. Button elements will have this as caption.< / li >
< / ul >
< li > < span style = "font-weight: bold;" > select:< / span > This will add a
select field.< / li >
< ul >
< li > < span style = "font-weight: bold;" > name:< / span > The name of the
element, will be used later as variable name when user input is
returned.< / li >
< li > < span style = "font-weight: bold;" > multiple:< / span > Boolean
value, if set to true the user can select more than one entry.< / li >
< li > < span style = "font-weight: bold;" > options:< / span > Array of
string. This is the list of option values the user can select.< / li >
< li > < span style = "font-weight: bold;" > options_selected:< / span > Array
of string. This is the list of pre selected elements, must contain
values that are also in < span style = "font-style: italic;" > options< / span > .< / li >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > descriptiveOptions:< / span >
Boolean value, if set to true then all elements in options
must be arrays themselves (array(< span style = "font-style: italic;" > value< / span > ,
< span style = "font-style: italic;" > description< / span > )) (default:
false)< br >
< / li >
2006-07-09 14:14:57 +00:00
< li > < span style = "font-weight: bold;" > size:< / span > The size of the
select field, if set to 1 a dropdown box will be displayed.< / li >
< li > < span style = "font-weight: bold;" > noSorting:< / span > If set to
true then the entries will not be sorted. Default is false.< br >
< / li >
< / ul >
< li > < span style = "font-weight: bold;" > table:< / span > Adds a table. Can
be used recursively.< / li >
< ul >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > value:< / span > A < span style = "font-style: italic;" > data element< / span > . Can be used
2006-07-09 14:14:57 +00:00
recursively.< / li >
< / ul >
< li > < span style = "font-weight: bold;" > text:< / span > Inserts a text
element.< / li >
< ul >
< li > < span style = "font-weight: bold;" > text:< / span > The text to
display.< / li >
< / ul >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > textarea:< / span > Adds a
multiline text field.< / li >
< ul >
< li > < span style = "font-weight: bold;" > name:< / span > The name of the
element, will be used later as variable name when user input is
returned.< / li >
< li > < span style = "font-weight: bold;" > rows:< / span > Number of rows
(required)< br >
< / li >
< li > < span style = "font-weight: bold;" > cols:< / span > Number of
characters for each line (required)< br >
< / li >
< li > < span style = "font-weight: bold;" > readonly:< / span > Boolean
value, if true the text field will be read only.< br >
< / li >
< / ul >
2006-07-09 14:14:57 +00:00
< li > < span style = "font-weight: bold;" > image:< / span > Displays an image.< / li >
< ul >
< li > < span style = "font-weight: bold;" > path:< / span > Path to the image< / li >
< li > < span style = "font-weight: bold;" > width:< / span > Width of the
image< / li >
< li > < span style = "font-weight: bold;" > height:< / span > Height of the
image< / li >
< li > < span style = "font-weight: bold;" > alt:< / span > Alt text of the
image< br >
< / li >
< / ul >
< / ul >
< br >
Beneath those values a < span style = "font-weight: bold;" > "td"< / span >
value may be added. This has to be an array with one or more of these
options:< br >
< br >
< ul >
< li > < span style = "font-weight: bold;" > colspan:< / span > Like the HTML
colspan attribute for td elements< / li >
< li > < span style = "font-weight: bold;" > rowspan:< / span > Like the HTML
rowspan attribute for td elements< / li >
< li > < span style = "font-weight: bold;" > align:< / span >
left/center/right/justify Like the HTML align attribute< / li >
< li > < span style = "font-weight: bold;" > valign:< / span > top/middle/bottom
Like the HTML valign attribute< / li >
< li > < span style = "font-weight: bold;" > width:< / span > Like the HTML
height attribute for td elements< br >
< / li >
< / ul >
< br >
Input buttons which should load a different subpage of a module must
have a special < span style = "font-style: italic;" > name < / span > attribute:< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > name< / span > => 'form_subpage_' . < span style = "font-style: italic;" > < module name> < / span > . '_' . < span style = "font-style: italic;" > < subpage name> < / span > . '_' . < span style = "font-style: italic;" > < button name> < / span > < br >
2006-07-09 14:14:57 +00:00
< ul >
< li > < span style = "font-weight: bold;" > < module name> :< / span > name
of this account module (e.g. 'posixAccount')< / li >
< li > < span style = "font-weight: bold;" > < subpage name> :< / span >
name of next subpage (e.g. 'attributes')< / li >
< li > < span style = "font-weight: bold;" > < button name> :< / span > a
name to distinguish buttons (e.g. 'ok'/'cancel'/'back')< br >
< / li >
< / ul >
< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example:< / span > < span style = "font-family: monospace;" > < br >
2006-07-09 14:14:57 +00:00
< br >
< / span > < code > array(< br >
0 => array(< br >
0 => array("kind" => "text", "text" =>
"This is an
example", "td" => array("colspan" => 3))< br >
), < br >
1 => array(< br >
0 => array("kind" => "text", "text" =>
"Input:"),< br >
1 => array("kind" => "input", "name" =>
"myinput",
"type" => "text"),< br >
2 => array("kind" => "help", "value" => "42")< br >
),< br >
< / code > < code > 2 => array(< br >
0 => array("kind" => "input", "name" =>
'form_subpage_myModule_attributes_back', "value" => _("Back"))< br >
)< br >
< / code > < code > )< br >
< / code > < br >
< br >
< h3 > < br >
< / h3 >
< h2 > 4. Help entry syntax< / h2 >
The array that is returned by the get_help function must follow the
below described syntax. Fields marked < b > REQUIRED< / b > are neccessary
under any circumstances. Fields marked < b > OPTIONAL< / b > may be left out
when not needed.< br >
There are basically two different types of help entries that can be
used. Internal help entries, that means the headline, text, etc is
included in the help entry or external help entries, that means the
help entry has only a reference pointing to a HTML/PHP page that offers
the help entry.
< br >
< h3 > < br >
4.1. Internal help entries< / h3 >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > ext< / span > < span style = "font-style: italic;" > (REQUIRED)< / span > < br >
2006-07-09 14:14:57 +00:00
Must be < b > FALSE< / b > in this case.
< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Headline< / span > < span style = "font-style: italic;" > (REQUIRED)< / span > < br >
2006-07-09 14:14:57 +00:00
The headline of this help entry. Can consist of any alpha-numeric
characters. No HTML/CSS elements are not allowed here.
< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Text< / span > < span style = "font-style: italic;" > (REQUIRED)< / span > < br >
2006-07-09 14:14:57 +00:00
The text of this help entry. Can constist if any alpha-numeric
characters and can contain placeholder for variables passed to this
help entry. The placeholder must follow the syntax for placeholder
defined by the PHP < b > printf< / b > function. HTML/CSS elements are
allowed here as long as they follow the XHTML1.0 Strict specification.< br >
< br >
When placeholders are included you can submit the values that should be
displayed there as arguments when calling the < b > templates/help.php< / b >
file. There they are attached as < b > var1< / b > , < b > var2< / b > and so on.
The names must follow the following rules:< br >
< ul >
< li > 1. They must be named < b > var$i< / b > where $i is any positive
number except the '0'.< / li >
< li > 2. This number ($i) must either be '1' or $i -1 must be present.< / li >
< / ul >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > SeeAlso< / span > < span style = "font-style: italic;" > (OPTIONAL)< / span > < br >
2006-07-09 14:14:57 +00:00
An array of references to anonther related subjects. Each row of the
array must contain a field called "text" with the text that should be
displayed and may contain a field called "link" which is used as value
for the href attribute of a HTML < a > tag when set.
< br >
< / a >
< h3 > < a > < br >
4.2. External help entries< / a > < / h3 >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > < a > ext< / a > < / span > < a > < span style = "font-style: italic;" > (REQUIRED)< / span > < br >
2006-07-09 14:14:57 +00:00
Must be < b > TRUE< / b > in this case.
< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Link< / span > < span style = "font-style: italic;" > (REQUIRED)< / span > < br >
2006-07-09 14:14:57 +00:00
The complete filename of the file stored under the help/ directory
which should be displayed when this help entry is called.
< / a > < br >
< br >
< h3 > < br >
< / h3 >
< h2 > 5. PDF syntax< / h2 >
The get_pdfEntries() function uses XML formatted commands to define the
2006-11-15 17:14:31 +00:00
PDF output. Each part in the PDF document is surrounded by < span style = "font-weight: bold; font-style: italic;" > "< block> "< / span >
2006-07-09 14:14:57 +00:00
and < span style = "font-weight: bold; font-style: italic;" > "< /block> "< / span > .< br >
< br >
Inside the < block> tags there are different ways to format the
output:< br >
< ul >
< li > < span style = "font-weight: bold;" > simple line with attribute name
and value:< / span > < span style = "font-weight: bold; font-style: italic;" > < block> < key> < / span > attribute
name< span style = "font-weight: bold; font-style: italic;" > < /key> < value> < / span > attribute
value< span style = "font-weight: bold; font-style: italic;" > < /value> < /block> < / span > < / li >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > table:< / span > < span style = "font-weight: bold; font-style: italic;" > < block> < key> < / span > attribute
name< span style = "font-weight: bold; font-style: italic;" > < /key> < tr> < td> < / span > value< span style = "font-weight: bold; font-style: italic;" > < td> < / span > < span style = "font-weight: bold; font-style: italic;" > < td> < / span > value< span style = "font-weight: bold; font-style: italic;" > < td> < / span > < span style = "font-weight: bold; font-style: italic;" > < /tr> < /block> < block> < tr> < td> < / span > value< span style = "font-weight: bold; font-style: italic;" > < /td> < / span > < span style = "font-weight: bold; font-style: italic;" > < td> < / span > value< span style = "font-weight: bold; font-style: italic;" > < td> < / span > < span style = "font-weight: bold; font-style: italic;" > < /tr> < /block> < / span > < span style = "font-weight: bold; font-style: italic;" > < / span > < / li >
2006-07-09 14:14:57 +00:00
< / ul >
< br >
Special commands:< br style = "font-weight: bold;" >
< ul >
< li > < span style = "font-weight: bold;" > Alignment in < td> :< / span >
2006-11-15 17:14:31 +00:00
You can specify the alignment in < td> tags with < span style = "font-weight: bold; font-style: italic;" > align=(L|R|C)< / span >
2006-07-09 14:14:57 +00:00
(e.g. < td align=\"L\"> )< / li >
< li > < span style = "font-weight: bold;" > Cell width: < td> < / span >
allows an attribute "width" to set the cell width (e.g. < td
width=20%> or < td width=30> ).< br >
< / li >
< li > < span style = "font-weight: bold;" > Line breaks:< / span > Line breaks
2006-11-15 17:14:31 +00:00
can be specified by adding a < span style = "font-weight: bold; font-style: italic;" > < br /> < / span >
2006-07-09 14:14:57 +00:00
tag. The new line will start at the left border of the PDF document.< / li >
< / ul >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold; text-decoration: underline;" > Examples:< / span > < br style = "font-weight: bold; text-decoration: underline;" >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > 1. Simple name+value lines:< / span > < br style = "font-weight: bold;" >
2006-07-09 14:14:57 +00:00
< br >
In most cases you will just want to display a single line per attribute
with its name and value.< br >
< br >
< span style = "font-weight: bold;" > 'myAttribute'< / span >
2006-11-15 17:14:31 +00:00
=> < span style = "font-weight: bold;" > '< span style = "font-style: italic;" > < block> < key> < / span > < / span > AttrName< span style = "font-weight: bold; font-style: italic;" > < /key> < value> < / span > 12345< span style = "font-weight: bold; font-style: italic;" > < /value> < /block> < / span > < span style = "font-weight: bold;" > '< / span > < br >
2006-07-09 14:14:57 +00:00
< br >
2006-11-15 17:14:31 +00:00
This will give the following PDF output: < span style = "font-weight: bold;" > AttrName:< / span > 12345< br >
2006-07-09 14:14:57 +00:00
< br >
< span style = "font-weight: bold;" > < br >
2. Multiline values:< / span > < br >
< br >
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.< br >
This can be done by using the < td> tag. This example only uses
one column but can just use more < td> tags per < block> tag
to display more columns.< br >
< br >
< span style = "font-weight: bold;" > 'myAttribute'< / span >
2006-11-15 17:14:31 +00:00
=> < span style = "font-weight: bold;" > '< span style = "font-style: italic;" > < block> < key> < / span > < / span > AttrName< span style = "font-weight: bold; font-style: italic;" > < /key> < tr> < td
align=\"L\"> < / span > 123< span style = "font-weight: bold; font-style: italic;" > < /td> < /tr> < /block> < block> < tr> < td
align=\"L\"> < / span > 456< span style = "font-weight: bold; font-style: italic;" > < /td> < /tr> < /block> < block> < tr> < td
align=\"L\"> < / span > 789< span style = "font-weight: bold; font-style: italic;" > < /td> < /tr> < /block> < / span > < span style = "font-weight: bold;" > '< / span > < br >
2006-07-09 14:14:57 +00:00
< br >
This will give the following PDF output: < br >
< br >
2006-11-15 17:14:31 +00:00
< table style = "text-align: left; background-color: rgb(255, 255, 255); width: 121px; height: 79px;" border = "0" cellpadding = "2" cellspacing = "2" >
2006-07-09 14:14:57 +00:00
< tbody >
< tr >
< td style = "vertical-align: top;" > < span style = "font-weight: bold;" > AttrName:< / span > < br >
< / td >
< td style = "vertical-align: top;" > 123< br >
< / td >
< / tr >
< tr >
< td style = "vertical-align: top;" > < br >
< / td >
2006-11-15 17:14:31 +00:00
< td style = "vertical-align: top; background-color: rgb(255, 255, 255);" > 456< br >
2006-07-09 14:14:57 +00:00
< / td >
< / tr >
< tr >
< td style = "vertical-align: top;" > < br >
< / td >
< td style = "vertical-align: top;" > 789< br >
< / td >
< / tr >
< / tbody >
< / table >
< br >
< br >
< br >
< br >
< h2 > 6. Module meta data< / h2 >
< h3 > 6.1 can_manage()
< / h3 >
"account_types" => array< br >
< br >
< span style = "font-weight: bold;" > Example:
array("user", "host")< / span > < br style = "font-weight: bold;" >
< br >
< h3 > 6.2 is_base_module()< / h3 >
"is_base" => boolean< br >
< br >
< h3 > 6.3 get_ldap_filter()< / h3 >
"ldap_filter" => array< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('or' =>
2006-07-09 14:14:57 +00:00
'objectClass=posixAccount', 'and' => '(!(uid=*$))')< br >
< br >
< / span >
2006-11-15 17:14:31 +00:00
< h3 > 6.4 getManagedObjectClasses()< / h3 >
"objectClasses" => array< br >
< br >
< span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('posixAccount')< br >
< br >
< / span >
< h3 > 6.5 getLDAPaliases()< br >
< / h3 >
"LDAPaliases" => array()< br >
< span style = "font-weight: bold;" > < br >
< span style = "font-style: italic;" > < / span > < / span > < span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('commonName'
=> 'cn')< / span > < br >
< br >
< span style = "font-style: italic; font-weight: bold;" > < br >
< / span >
< span style = "font-style: italic; font-weight: bold;" > < / span >
< h3 > 6.6 get_RDNAttributes()< / h3 >
2006-07-09 14:14:57 +00:00
"RDN" => array< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('uid' =>
2006-07-09 14:14:57 +00:00
'normal', 'cn' => 'low')< br >
< br >
< / span >
< span style = "font-style: italic; font-weight: bold;" > < / span >
2006-11-15 17:14:31 +00:00
< h3 > 6.7 get_dependencies()< br >
2006-07-09 14:14:57 +00:00
< / h3 >
"dependencies" => array< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array(< / span > < span style = "font-style: italic; font-weight: bold;" > < span style = "font-weight: bold; font-style: italic;" > "depends"
2006-07-09 14:14:57 +00:00
=> array("posixAccount", array("qmail", "sendmail")), "conflicts"
2006-11-15 17:14:31 +00:00
=> array("exim")< / span > < / span > < span style = "font-style: italic; font-weight: bold;" > )< br >
2006-07-09 14:14:57 +00:00
< / span > < br >
2006-11-15 17:14:31 +00:00
< h3 > 6.8 get_profileOptions()< br >
2006-07-09 14:14:57 +00:00
< / h3 >
"profile_options" => array< br >
< br >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > Syntax for array is the same as for the
2006-07-09 14:14:57 +00:00
return value of get_profileOptions().< br >
< br >
< / span > < / span >
2006-11-15 17:14:31 +00:00
< h3 > 6.9 check_profileOptions()< br >
2006-07-09 14:14:57 +00:00
< / h3 >
"profile_checks" => array< br >
< br >
< span style = "font-weight: bold;" > The keys of the array are
the names of the option identifiers.< br >
Each array element is an array containing these values:< br >
< br >
< / span >
< ul >
< li style = "font-weight: bold;" > type:< span style = "font-weight: normal;" >
determines how to check input< / span > < / li >
< ul >
2006-11-15 17:14:31 +00:00
< li style = "font-weight: bold;" > regex:< span style = "font-weight: normal;" > check with regular expression from < span style = "font-style: italic;" > regex< / span > variable, case sensitive< / span > < / li >
< li style = "font-weight: bold;" > regex_i:< span style = "font-weight: normal;" > check with regular expression from < span style = "font-style: italic;" > regex< / span > variable, case insensitive< / span > < / li >
< li style = "font-weight: bold;" > < span style = "font-weight: normal;" > < span style = "font-weight: bold;" > int_greater:< / span > integer value of < span style = "font-style: italic;" > cmp_name1< / span > must be
greater than the integer value from the option < span style = "font-style: italic;" > cmp_name2< / span > < / span > < / li >
< li style = "font-weight: bold;" > < span style = "font-weight: normal;" > < span style = "font-weight: bold;" > int_greaterOrEqual:< / span > integer value< / span > < span style = "font-weight: normal;" > < span style = "font-weight: normal;" > of < span style = "font-style: italic;" > cmp_name1< / span > < / span > < / span > < span style = "font-weight: normal;" >
must be greater or equal than the integer value from the option < span style = "font-style: italic;" > cmp_name2< / span > < / span > < / li >
2006-07-09 14:14:57 +00:00
< / ul >
2006-11-15 17:14:31 +00:00
< li style = "font-weight: bold;" > error_message:< span style = "font-weight: normal;" > message that is displayed if input value
2006-07-09 14:14:57 +00:00
was syntactically incorrect< / span > < / li >
< ul >
< li style = "font-weight: bold;" > < span style = "font-weight: normal;" > array
to build StatusMessages (0 => message type, 1 => message
2006-11-15 17:14:31 +00:00
head, 2 => message text, 3 => additional variables)< / span > < span style = "font-weight: normal;" > < / span > < / li >
2006-07-09 14:14:57 +00:00
< / ul >
2006-11-15 17:14:31 +00:00
< li style = "font-weight: bold;" > regex:< span style = "font-weight: normal;" > regular expression string (only if < span style = "font-style: italic;" > type< / span > is < span style = "font-style: italic;" > regex< / span > /< span style = "font-style: italic;" > regex_i< / span > )< / span > < / li >
< li style = "font-weight: bold;" > < span style = "font-weight: normal;" > < span style = "font-weight: normal;" > < span style = "font-weight: bold;" > cmp_name1:< / span >
2006-07-09 14:14:57 +00:00
name of first input
2006-11-15 17:14:31 +00:00
variable that is used for comparison (only if < span style = "font-style: italic;" > type< / span > is < span style = "font-style: italic;" > int_greater/int_greaterOrEqual< / span > )< / span > < / span > < / li >
< li style = "font-weight: bold;" > < span style = "font-weight: normal;" > < span style = "font-weight: bold;" > cmp_name2:< / span > name of second input
variable that is used for comparison (only if < span style = "font-style: italic;" > type< / span > is < span style = "font-style: italic;" > int_greater/int_greaterOrEqual< / span > )< br >
2006-07-09 14:14:57 +00:00
< / span > < / li >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > required:< / span > < span style = "font-style: italic;" > true< / span > or < span style = "font-style: italic;" > false< / span > , if this input field must be
2006-07-09 14:14:57 +00:00
filled set to true (optional)< span style = "font-weight: bold;" > < br >
< / span > < / li >
2006-11-15 17:14:31 +00:00
< li > < span style = "font-weight: bold;" > required_message:< / span > message< span style = "font-weight: normal;" > that is displayed if no input value was
given< / span > < span style = "font-weight: normal;" > (only if < span style = "font-style: italic;" > required< / span > == true)< / span > < span style = "font-weight: bold;" > < / span > < / li >
2006-07-09 14:14:57 +00:00
< ul >
< li > array to build StatusMessages (0 => message type, 1
=> message
head, 2 => message text, 3 => additional variables)< / li >
< / ul >
< / ul >
< br >
2006-11-15 17:14:31 +00:00
< h3 > 6.10 load_profile()< br >
2006-07-09 14:14:57 +00:00
< / h3 >
"profile_mappings" => array('profile_identifier1'
=> 'LDAP_attribute1', 'profile_identifier2' => 'LDAP_attribute2')< br >
< br >
The mapped values are stored directly in
$this-> attributes.< br >
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > < br >
< / span > < / span >
2006-11-15 17:14:31 +00:00
< h3 > 6.11 get_configOptions()< br >
2006-07-09 14:14:57 +00:00
< / h3 >
"config_options" => array('user' => array,
'host' => array, 'all' => array)< br >
< br >
The values from < span style = "font-weight: bold;" > 'all'< / span >
2006-11-15 17:14:31 +00:00
are always returned, the other values only if they are inside the < span style = "font-style: italic;" > $scopes< / span > array.< br style = "font-weight: bold;" >
2006-07-09 14:14:57 +00:00
< br style = "font-weight: bold;" >
2006-11-15 17:14:31 +00:00
< span style = "font-weight: bold;" > < span style = "font-style: italic;" > Syntax for sub arrays is the same as for
2006-07-09 14:14:57 +00:00
the
return value of get_configOptions().< br >
2006-11-15 17:14:31 +00:00
< br > < / span > < / span > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > < / span > < / span > < h3 > 6.12 check_configOptions()< br >
2006-07-09 14:14:57 +00:00
< / h3 >
"config_checks" => array('user' => array,
'host' => 'array', 'all' => array)< br >
< br >
The values from 'all' are always used for checking,
2006-11-15 17:14:31 +00:00
the other values only if they are inside the < span style = "font-style: italic;" > $scopes< / span > array.< br >
2006-07-09 14:14:57 +00:00
< span style = "font-weight: bold;" > < br style = "font-weight: bold;" >
2006-11-15 17:14:31 +00:00
< / span > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > Syntax for sub arrays is the same as for
2006-07-09 14:14:57 +00:00
check_profileOptions().< br >
< br >
< / span > < / span >
2006-11-15 17:14:31 +00:00
< h3 > 6.13 get_uploadColumns()< / h3 >
2006-07-09 14:14:57 +00:00
"upload_columns" => array()< br >
< span style = "font-weight: bold;" > < br >
< span style = "font-style: italic;" > Syntax for array is the same as for
the
return value of get_uploadColumns().< br >
< / span > < / span > < br >
2006-11-15 17:14:31 +00:00
< h3 > 6.14 get_uploadPreDepends()< / h3 >
2006-07-09 14:14:57 +00:00
"upload_preDepends" => array()< br >
< span style = "font-weight: bold;" > < br >
< span style = "font-style: italic;" > Syntax for array is the same as for
the
return value of get_uploadPreDepends().< br >
< / span > < / span > < br >
2006-11-15 17:14:31 +00:00
< h3 > 6.15 getRequiredExtensions()< br >
< / h3 >
"extensions" => array()< br >
< span style = "font-weight: bold;" > < br >
< span style = "font-style: italic;" > < / span > < / span > < span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('mhash')< / span > < br >
< br >
2006-07-09 14:14:57 +00:00
2006-11-15 17:14:31 +00:00
< h3 > 6.16 getSelfServiceSearchAttributes()< br >
< / h3 >
2006-07-09 14:14:57 +00:00
2006-11-15 17:14:31 +00:00
"selfServiceSearchAttributes" => array()< br >
< span style = "font-weight: bold;" > < br >
< span style = "font-style: italic;" > < / span > < / span > < span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('uid')< / span > < br >
< br >
< h3 > 6.17 getSelfServiceFields()< br >
< / h3 >
"selfServiceFieldSettings" => array()< br >
< span style = "font-weight: bold;" > < br >
< span style = "font-style: italic;" > < / span > < / span > < span style = "font-weight: bold;" > Example:< / span > < span style = "font-style: italic; font-weight: bold;" > array('pwd' => 'Password')< / span > < br >
< br >
< span style = "font-weight: bold;" > < / span > < span style = "font-weight: bold;" > < span style = "font-style: italic;" > < / span > < / span > < span style = "font-style: italic; font-weight: bold;" > < / span > < span style = "font-style: italic; font-weight: bold;" > < / span > < span style = "font-style: italic; font-weight: bold;" > < / span >
< / body > < / html >