diff --git a/lam-web/developers/devel/index.htm b/lam-web/developers/devel/index.htm index d377c429..5b8ba22b 100644 --- a/lam-web/developers/devel/index.htm +++ b/lam-web/developers/devel/index.htm @@ -1,9 +1,8 @@ - - - LAM development documentation - - +LAM development documentation + + +

LDAP Account Manager - Code overview

@@ -13,14 +12,12 @@ generate the HTML output and the most important functions provided by the library files.


-overview
+overview



- +
@@ -104,9 +101,16 @@ browser

FAQ

-
+


+

+

Specifications

+ +
- - + \ No newline at end of file diff --git a/lam-web/developers/devel/mod_accountPages.htm b/lam-web/developers/devel/mod_accountPages.htm index 9e0e2a6d..c63f15e1 100644 --- a/lam-web/developers/devel/mod_accountPages.htm +++ b/lam-web/developers/devel/mod_accountPages.htm @@ -2,7 +2,6 @@ Module HowTo - Account pages -

Module HowTo - Account pages
@@ -108,33 +107,28 @@ sizeof($this->attributes['macAddress']); $i++) {
            $return[] = array(
            -    0 => array('kind' => 'text', 'text' => +    array('kind' => 'text', 'text' => _('MAC address')),
            -    1 => array('kind' => 'input', 'name' => +    array('kind' => 'input', 'name' => 'macAddress' . $i, 'type' => 'text', 'size' => '17', 'maxlength' => '17', 'value' => $this->attributes['macAddress'][$i]),
            -    2 => array('kind' => 'input', 'type' => +    array('kind' => 'input', 'type' => 'submit', 'name' => 'delMAC' . $i, 'value' => _("Remove")),
            -    3 => array('kind' => 'help', 'value' => +    array('kind' => 'help', 'value' => 'mac'));
        }
        // input box for new MAC
        $return[] = array(
-            0 => -array('kind' => 'text', 'text' => _('New MAC address')),
-            1 => -array('kind' => 'input', 'name' => 'macAddress', 'type' => +            array('kind' => 'text', 'text' => _('New MAC address')),
+            array('kind' => 'input', 'name' => 'macAddress', 'type' => 'text', 'size' => '17', 'maxlength' => '17', 'value' => ''),
-            2 => -array('kind' => 'input', 'type' => 'submit', 'name' => +            array('kind' => 'input', 'type' => 'submit', 'name' => 'addMAC', 'value' => _("Add")),
-            3 => -array('kind' => 'help', 'value' => 'mac'),
-            4 => -array('kind' => 'input', 'type' => 'hidden', 'value' => +            array('kind' => 'help', 'value' => 'mac'),
+            array('kind' => 'input', 'type' => 'hidden', 'value' => sizeof($this->attributes['macAddress']), 'name' => 'mac_number'));
        return $return;
    }
diff --git a/lam-web/developers/devel/mod_config.htm b/lam-web/developers/devel/mod_config.htm index 9aae47e0..45543701 100644 --- a/lam-web/developers/devel/mod_config.htm +++ b/lam-web/developers/devel/mod_config.htm @@ -1,11 +1,9 @@ - - - Module HowTo - Configuration options - - +Module HowTo - Configuration options + + + -

Module HowTo - Configuration options


@@ -26,19 +24,16 @@ will display all options in one fieldset for each module. Please notice that there will be no separation on account types if you module is suitable for different account types.

-The configuration options are specified with get_configOptions() +The configuration options are specified with get_configOptions() or meta['config_options'].

-Example:
+Example:

The posixGroup module offers three configuration options. The min/maximum values for GIDs and the password hash type.

- +
@@ -109,22 +104,19 @@ the browser.
Probably you also want to check if the input data is syntactically correct.
The baseModule already -provides different checks which can be activated with meta data. However you can also do +provides different checks which can be activated with meta data. However you can also do the checking in the module.
Implementing the function check_configOptions() in your module will allow you to do the checks yourself. Basic checks can be defined with meta['config_checks'].

-Example:
+Example:

The posixGroup module only needs to check if the GID numbers are correct. The password hash type needs not to be checked as it is a selection.

-
    /**
@@ -51,46 +46,46 @@ class
get_metaData() {
        $return = array();
        // configuration options
-        $return['config_options']['group'] = array(
+        $return['config_options']['group'] = array(
            array(
-               - 0 => array('kind' => 'text', 'text' => '<b>' . +           +     array('kind' => 'text', 'text' => +'<b>' . _('Minimum GID number') . " *: </b>"),
-               - 1 => array('kind' => 'input', 'name' => +                array('kind' => 'input', 'name' => 'posixGroup_minGID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
-               - 2 => array('kind' => 'text', 'value' => '&nbsp;'),
-               - 3 => array('kind' => 'text', 'text' => '<b>' . +           +     array('kind' => 'text', 'value' => +'&nbsp;'),
+           +     array('kind' => 'text', 'text' => +'<b>' . _('Maximum GID number') . " *: </b>"),
-               - 4 => array('kind' => 'input', 'name' => +                array('kind' => 'input', 'name' => 'posixGroup_maxGID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
-               - 5 => array('kind' => 'help', 'value' => 'minMaxGID')),
+           +     array('kind' => 'help', 'value' => +'minMaxGID')),
            array(
-               - 0 => array('kind' => 'text', 'text' => '<b>' . +           +     array('kind' => 'text', 'text' => +'<b>' . _("Password hash type") . ': &nbsp;</b>'),
-               - 1 => array('kind' => 'select', 'name' => -'posixGroup_pwdHash', 'size' => '1',
-               - 'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", +                array('kind' => 'select', 'name' => +'posixGroup_pwdHash', 'size' => '1', 'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5", "PLAIN"), 'options_selected' => array('SSHA')),
-               - 2 => array('kind' => 'text', 'value' => '&nbsp;'),
-               - 3 => array('kind' => 'text', 'value' => '&nbsp;'),
-               - 4 => array('kind' => 'text', 'value' => '&nbsp;'),
-               - 5 => array('kind' => 'help', 'value' => 'pwdHash'))
+           +     array('kind' => 'text', 'value' => +'&nbsp;'),
+           +     array('kind' => 'text', 'value' => +'&nbsp;'),
+           +     array('kind' => 'text', 'value' => +'&nbsp;'),
+                array('kind' => 'help', 'value' => 'pwdHash'))
        );
        [...]
+
    /**
@@ -137,9 +129,7 @@ class
get_metaData() {
        $return = array();
        // configuration checks
-        $return['config_checks']['group']['posixGroup_minGID'] = +        $return['config_checks']['group']['posixGroup_minGID'] = array (
            'type' => 'ext_preg',
@@ -151,9 +141,7 @@ array (
 'required_message' => $this->messages['gidNumber'][5],
            'error_message' => $this->messages['gidNumber'][5]);
-        $return['config_checks']['group']['posixGroup_maxGID'] = +        $return['config_checks']['group']['posixGroup_maxGID'] = array (
            'type' => 'ext_preg',
@@ -165,9 +153,7 @@ array (
 'required_message' => $this->messages['gidNumber'][6],
            'error_message' => $this->messages['gidNumber'][6]);
-        $return['config_checks']['group']['cmpGID'] = array (
+        $return['config_checks']['group']['cmpGID'] = array (
            'type' => 'int_greater',
            'cmp_name1' @@ -183,9 +169,7 @@ array (

The type "ext_preg" means that -the baseModule will use the get_preg() function in lib/account.inc for the syntax +the baseModule will use the get_preg() function in lib/account.inc for the syntax check. This function already contains regular expressions for the most common cases.
To check if the minimum GID is smaller than the maximum GID we define a @@ -193,61 +177,5 @@ check for the nonexistant option "cmpGID" and define it as optional. This will do the comparison check.


-

3. Descriptions

-What is still missing is a descriptive title for the fieldset in the -configuration editor and a description for each configuration option -which is displayed when the user saves the settings.
-
-These descriptions are defined with get_configDescriptions() -or meta['config_descriptions'].
-
-Example:
-
-The posixGroup module will -set a title for the fieldset and a description for the three -configuration options.
-
- - - - - - -
    /**
-    * Returns meta data that is interpreted by parent -class
-    *
-    * @return array array with meta data
-    */
-    function -get_metaData() {
-        $return = array();
-        // configuration descriptions
-        $return['config_descriptions'] = array(
-            'legend' => -_("GID ranges for Unix groups"),
-            'descriptions' -=> array(
-               - 'posixGroup_minGID' => _("Minimum GID number for Unix groups"),
-               - 'posixGroup_maxGID' => _("Maximum GID number for Unix groups"),
-               - 'posixGroup_pwdHash' => _("Password hash type for Unix -groups"),
-            )
-        );
-        [...]
-
-
-This will set the fieldset title to "GID ranges for Unix groups" and -the descriptions for the settings list.
- -

-
- - + \ No newline at end of file diff --git a/lam-web/developers/devel/mod_profiles.htm b/lam-web/developers/devel/mod_profiles.htm index 7d394fcf..96ca3962 100644 --- a/lam-web/developers/devel/mod_profiles.htm +++ b/lam-web/developers/devel/mod_profiles.htm @@ -1,9 +1,8 @@ - - - Module HowTo - Account profiles - - +Module HowTo - Account profiles + + +

Module HowTo - Account profiles
@@ -26,8 +25,7 @@ containing its profile options.
The profile options are specified with get_profileOptions() or meta['profile_options'].

-Example:
+Example:

The inetOrgPerson module has only two attributes which may be set to a default value: job @@ -35,8 +33,7 @@ title and employee type.
The other attributes are account specific and not useful as profile options.

- +
    /**
@@ -49,29 +46,28 @@ class
get_metaData() {
        $return = array();
        // profile elements
-        $return['profile_options'] = array(
+        $return['profile_options'] = array(
            array(
            -    0 => array('kind' => 'text', 'text' => +    array('kind' => 'text', 'text' => _('Job title') . ":"),
            -    1 => array('kind' => 'input', 'name' => +    array('kind' => 'input', 'name' => 'inetOrgPerson_title', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
            -    2 => array('kind' => 'help', 'value' => +    array('kind' => 'help', 'value' => 'title')),
            array(
            -    0 => array('kind' => 'text', 'text' => +    array('kind' => 'text', 'text' => _('Employee type') . ":"),
            -    1 => array('kind' => 'input', 'name' => +    array('kind' => 'input', 'name' => 'inetOrgPerson_employeeType', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
            -    2 => array('kind' => 'help', 'value' => +    array('kind' => 'help', 'value' => 'employeeType'))
        );
        [...]
@@ -90,22 +86,19 @@ of the input element might be not enough.
Probably you also want to check if the input data is syntactically correct.
The baseModule already -provides different checks which can be activated with meta data. However you can also do +provides different checks which can be activated with meta data. However you can also do the checking in the module.
Implementing the function check_profileOptions() in your module will allow you to do the checks yourself. Basic checks can be defined with meta['profile_checks'].

-Example:
+Example:

The inetOrgPerson module only needs some regular expression checks on the input. This can be done by the baseModule.

- +
    /**
@@ -118,18 +111,14 @@ class
get_metaData() {
        $return = array();
        // profile checks
-        $return['profile_checks']['inetOrgPerson_title'] = array(
+        $return['profile_checks']['inetOrgPerson_title'] = array(
            'type' => 'ext_preg',
            'regex' => 'title',
            'error_message' => $this->messages['title'][0]);
-        $return['profile_checks']['inetOrgPerson_employeeType'] = +        $return['profile_checks']['inetOrgPerson_employeeType'] = array(
            'type' => 'ext_preg',
@@ -144,9 +133,7 @@ array(

The type "ext_preg" means that -the baseModule will use the get_preg() function in lib/account.inc for the syntax +the baseModule will use the get_preg() function in lib/account.inc for the syntax check. This function already contains regular expressions for the most common cases.

@@ -157,22 +144,18 @@ they need for their internal data structures.
The baseModule already provides the possibility to store profile values directly as LDAP attributes in $this->attributes. -This is done by defining profile-attribute mappings in meta['profile_mappings'].
+This is done by defining profile-attribute mappings in meta['profile_mappings'].
If you have other values than LDAP attributes or need some post -processing you can implement the function load_profile() in your module.
+processing you can implement the function load_profile() in your module.

-Example:
+Example:

The inetLocalMailRecipient module only needs a static mapping. This can be done by the baseModule.

- +
    /**
@@ -185,8 +168,7 @@ class
get_metaData() {
        $return = array();
        // profile mappings
-        $return['profile_mappings'] = array(
+        $return['profile_mappings'] = array(
            'inetLocalMailRecipient_host' => 'mailHost'
        );
@@ -204,5 +186,4 @@ stored as LDAP attribute "mailHost".

- - + \ No newline at end of file diff --git a/lam-web/developers/devel/modules-specification.htm b/lam-web/developers/devel/modules-specification.htm index 86a895ad..b69c19ef 100644 --- a/lam-web/developers/devel/modules-specification.htm +++ b/lam-web/developers/devel/modules-specification.htm @@ -570,6 +570,83 @@ $fields: list of self service field names
    'mod' => array(),
    'del' => array(),
);
+
+ +
+

2.1.25. getSelfServiceSettings

+ + +
+ + + + + + + + + + +
function getSelfServiceSettings()
+
+ + +
+Returns a list of self service configuration settings.
+
+ + +The return value is an array +that contains meta HTML code.
+ +
+ +The type "fieldset" is not allowed here.
+ +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 confilcts.
+ +
+ + +

2.1.26. checkSelfServiceSettings

+ + +
+ + + + + + + + + + +
function checkSelfServiceSettings($options)
+
+ + +
+Checks if the self service settings are valid.
+ +
+ +$options: is an hash array +(option name => value) that contains the 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 (0 => message type, 1 => message +head, 2 => message text, 3 => additional variables).
+ +If no errors occured the function returns an empty array.
+ +
+ +