diff --git a/lam/docs/devel/mod_accountPages.htm b/lam/docs/devel/mod_accountPages.htm index 9e0e2a6d..c63f15e1 100644 --- a/lam/docs/devel/mod_accountPages.htm +++ b/lam/docs/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/docs/devel/mod_config.htm b/lam/docs/devel/mod_config.htm index 995366ac..45543701 100644 --- a/lam/docs/devel/mod_config.htm +++ b/lam/docs/devel/mod_config.htm @@ -1,9 +1,8 @@ - - - Module HowTo - Configuration options - - +Module HowTo - Configuration options + + +

Module HowTo - Configuration options

@@ -25,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.

- +
@@ -108,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.

-
    /**
@@ -50,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'))
        );
        [...]
+
    /**
@@ -136,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',
@@ -150,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',
@@ -164,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' @@ -182,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,5 +178,4 @@ This will do the comparison check.


- - + \ No newline at end of file diff --git a/lam/docs/devel/mod_profiles.htm b/lam/docs/devel/mod_profiles.htm index 7d394fcf..96ca3962 100644 --- a/lam/docs/devel/mod_profiles.htm +++ b/lam/docs/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