LDAPAccountManager/lam/docs/modules-specification.htm

829 lines
31 KiB
HTML
Raw Normal View History

2004-02-17 21:08:08 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="content-type">
2004-02-17 21:08:08 +00:00
<title>Module specification</title>
</head>
<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 "&lt;class
name&gt;.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>
2004-06-11 15:44:49 +00:00
All module classes should extend the baseModule class.<br>
2004-02-17 21:08:08 +00:00
<br>
<h2>2. Class functions</h2>
2004-06-11 15:44:49 +00:00
<h3>2.1. Functions that have to work without superior accountContainer<br>
</h3>
2004-03-02 19:25:09 +00:00
<h3><br>
</h3>
<h3>2.1.1. can_manage*</h3>
2004-02-17 21:08:08 +00:00
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px;">
2004-03-02 19:25:09 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
2004-06-13 19:58:58 +00:00
style="font-weight: bold;">function can_manage()</span><br>
2004-03-02 19:25:09 +00:00
</td>
</tr>
</tbody>
</table>
<br>
Returns <span style="font-style: italic;">true</span> if this module
2004-06-13 19:58:58 +00:00
can manage accounts of the current type<span style="font-style: italic;"></span>,
2004-03-02 19:25:09 +00:00
otherwise <span style="font-style: italic;">false</span>.<br>
<br>
<br>
<h3>2.1.2. get_alias*</h3>
2004-02-17 21:08:08 +00:00
<br>
<table style="text-align: left; width: 300px;" border="0"
cellspacing="2" cellpadding="2">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
2004-06-14 16:05:36 +00:00
style="font-weight: bold;">function get_alias()</span><br>
2004-02-17 21:08:08 +00:00
</td>
</tr>
</tbody>
</table>
<br>
2004-02-21 19:27:12 +00:00
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
2004-06-14 16:05:36 +00:00
any character but should not include parts that may be interpreted by
the browser (e.g. '&lt;' or '&gt;').<br>
If you use different aliases dependent on the account type please make
sure that there is a general alias for unknown types.<br>
2004-02-17 21:08:08 +00:00
<br>
2004-06-11 15:44:49 +00:00
<h3>2.1.3. is_base_module*</h3>
2004-02-17 21:08:08 +00:00
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
2004-06-11 15:44:49 +00:00
style="font-weight: bold;">function is_base_module()</span><br>
2004-02-17 21:08:08 +00:00
</td>
</tr>
</tbody>
</table>
<br>
2004-02-21 19:27:12 +00:00
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>
2004-06-11 15:44:49 +00:00
<span style="font-weight: bold;"></span><br>
2004-02-21 19:27:12 +00:00
Every account type needs at least one base module. A base module
defines a full qualified account.<br>
E.g. modules that use the object class posixAccount may be base modules
as it makes sense to manage these Unix accounts. On the other hand the
quota module is no base module as it needs posixAccount.<br>
<br>
2004-06-11 15:44:49 +00:00
<h3>2.1.4. get_ldap_filter*</h3>
2004-02-21 19:27:12 +00:00
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
2004-02-21 19:27:12 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
2004-06-20 17:32:02 +00:00
style="font-weight: bold;">function get_ldap_filter()</span><br>
2004-02-21 19:27:12 +00:00
</td>
</tr>
</tbody>
</table>
<br>
Returns an array('or' =&gt; '...', 'and' =&gt; '...') that is used to
build the LDAP filter. Usually
2004-02-21 19:27:12 +00:00
used to filter object classes.<br>
2004-06-20 17:32:02 +00:00
<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:
(&amp;(|(OR1)(OR2)(OR3))(AND1)(AND2)(AND3))<br>
2004-02-21 19:27:12 +00:00
<br>
<span style="font-weight: bold;">Example: <span
style="font-style: italic;">return "('or' =&gt;
2004-06-20 17:32:02 +00:00
'(objectClass=posixAccount)', 'and' =&gt; '(!(uid=*$))')"</span></span><br>
2004-02-21 19:27:12 +00:00
<br>
<span style="font-weight: bold; color: rgb(255, 0, 0);">This function
is only used for base modules. Standard modules do not need to
implement it.</span><br>
<br>
<h3>2.1.5. get_dependencies*</h3>
2004-02-17 21:08:08 +00:00
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; font-weight: bold;">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">function
2004-06-20 17:32:02 +00:00
get_dependencies()<br>
2004-02-17 21:08:08 +00:00
</td>
</tr>
</tbody>
</table>
<br>
This function returns a list of modules it depends on.<br>
<br>
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>
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>
<span style="font-weight: bold;">Example: </span><span
style="font-weight: bold; font-style: italic;">return array("depends"
=&gt; array("posixAccount", array("qmail", "sendmail")), "conflicts"
=&gt; array("exim"));</span><br
style="font-weight: bold; font-style: italic;">
<br>
2004-06-11 15:44:49 +00:00
<h3>2.1.6. get_metaData()</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_metaData()</span><br>
</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" =&gt;
true);</span><br style="font-weight: bold;">
<br>
<h3>2.1.7. get_configOptions()*</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_configOptions($scopes)</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Returns a list of configuration options.<br>
<span style="font-weight: bold;">$scopes</span> is a list of <span
style="font-style: italic;">account types</span> (user, group, host)
which are used.<br>
<span style="font-weight: bold;"></span><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>
<br>
<h3>2.1.8. get_configDescriptions()*</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_configDescriptions()</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Returns the description of every configuration option and the legend of
the module fieldset on the configuration page.<br>
<span style="font-weight: bold;"></span><br>
The <span style="font-style: italic;">return</span> value is a hash
array with this format:<br>
&nbsp;&nbsp;&nbsp; <br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; array( 'legend'
=&gt; 'Some general description for fieldset',</span><br
style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'descriptions' =&gt; array('option1'
=&gt; 'description1', ...))</span><br>
<br>
<h3>2.1.9. check_configOptions*</h3>
<br>
<table style="text-align: left; width: 400px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function check_configOptions($scopes,
$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 =&gt; 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 =&gt; message type, 1 =&gt; message
head, 2 =&gt; message text, 3 =&gt; additional variables).<br>
If no errors occured the function returns an empty array.<span
style="font-weight: bold;"></span><br>
<br style="font-weight: bold;">
<span style="font-weight: bold;"></span>
<h3>2.1.10. get_scope()</h3>
2004-06-11 15:44:49 +00:00
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_scope()</span><br>
</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>
<br>
<br>
<h3>2.2. Class functions</h3>
<h3>2.2.1. init</h3>
2004-02-17 21:08:08 +00:00
<br>
2004-03-14 16:40:59 +00:00
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function init($base)</span><br>
2004-02-17 21:08:08 +00:00
</td>
</tr>
</tbody>
</table>
<br>
Every module needs a initializing function that has an<span
style="font-style: italic;"> <span style="font-weight: bold;">account
container</span></span> as argument $base.<br>
With this account container you can interact with other modules and use
several helper functions.<br>
2004-02-17 21:08:08 +00:00
<br>
<h3>2.2.2. module_ready</h3>
2004-03-14 16:40:59 +00:00
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
2004-03-14 16:40:59 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function module_ready()</span><br>
2004-03-14 16:40:59 +00:00
</td>
</tr>
</tbody>
</table>
<br>
Your module might depend on input of other modules. This function
determines if the module button on the account page is active 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>
2004-02-17 21:08:08 +00:00
<br>
<h3>2.2.3. module_complete</h3>
2004-02-17 21:08:08 +00:00
<br>
2004-03-14 16:40:59 +00:00
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function module_complete()</span><br>
2004-02-17 21:08:08 +00:00
</td>
</tr>
</tbody>
</table>
<br>
This function is called after your module has processed the POST input
data.<br>
If there was an input error and you want to display a page again then
return <span style="font-weight: bold;">false</span>. If <span
style="font-weight: bold;">true</span> is returned the next module
page will be displayed.<br>
2004-02-17 21:08:08 +00:00
<br>
<h3>2.2.4. get_help</h3>
2004-02-17 21:08:08 +00:00
<br>
2004-03-14 16:40:59 +00:00
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_help($helpID)</span><br>
2004-02-17 21:08:08 +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>
2004-02-17 21:08:08 +00:00
<br>
<h3>2.2.5. get_profileOptions*</h3>
2004-02-17 21:08:08 +00:00
<br>
2004-03-14 16:40:59 +00:00
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
2004-02-17 21:08:08 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_profileOptions()</span><br>
2004-02-17 21:08:08 +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>
2004-02-17 21:08:08 +00:00
<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>
2004-03-15 16:30:52 +00:00
<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>
<h3>2.2.6. check_profileOptions*</h3>
<br>
<table style="text-align: left; width: 400px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
2004-03-15 16:30:52 +00:00
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function check_profileOptions($options)</span><br>
2004-03-15 16:30:52 +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 =&gt; 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 =&gt; message type, 1 =&gt; message
head, 2 =&gt; message text, 3 =&gt; additional variables).<br>
If no errors occured the function returns an empty array.<span
style="font-weight: bold;"></span><br>
2004-03-15 16:30:52 +00:00
<br>
<h3>2.2.7. get_pdfEntries</h3>
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_PDF_Entries($scope)</span><br>
</td>
</tr>
</tbody>
</table>
<br>
This function is called when a PDF is to be created.<br>
<span style="font-weight: bold;">$scope</span> is the account type
("user", "group", "host" at this time).<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>
2004-08-28 11:53:40 +00:00
<h3>2.2.8. get_uploadColumns</h3>
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_uploadColumns()</span><br>
</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: &lt;module name&gt;_&lt;column name&gt;)</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;">boolean</span>
required:</span> true, if user must set a value for this column<br>
</li>
</ul>
<br>
2004-06-11 15:44:49 +00:00
<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>
2004-02-21 19:27:12 +00:00
<h3><br>
</h3>
2004-02-17 21:08:08 +00:00
<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>
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>
<br>
<span style="font-weight: bold;">Format for <span
style="font-style: italic;">data elements</span>:</span><br>
<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>
<li><span style="font-weight: bold;">value:</span> A <span
style="font-style: italic;">data element</span>. Can be used
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>
</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>
<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>
</ul>
<li><span style="font-weight: bold;">table:</span> Adds a table. Can
be used recursively.</li>
<ul>
<li><span style="font-weight: bold;">value:</span> A <span
style="font-style: italic;">data element</span>. Can be used
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>
</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>
</ul>
<br>
<span style="font-weight: bold;">Example:</span><span
style="font-family: monospace;"><br>
<br>
</span><code>array(<br>
&nbsp; array(<br>
&nbsp;&nbsp;&nbsp; array("kind" =&gt; "text", "text" =&gt; "This is an
example", "td" =&gt; array("colspan" =&gt; 3))<br>
&nbsp; ), <br>
&nbsp; array(<br>
&nbsp;&nbsp;&nbsp; array("kind" =&gt; "text", "text" =&gt; "Input:"),<br>
&nbsp; &nbsp; array("kind" =&gt; "input", "name" =&gt; "myinput",
"type" =&gt; "text"),<br>
&nbsp; &nbsp; array("kind" =&gt; "help", "value" =&gt; "42")<br>
&nbsp; )<br>
)<br>
</code><br>
2004-02-17 21:08:08 +00:00
<br>
2004-03-15 16:30:52 +00:00
<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>
<span style="font-weight: bold;">ext</span> <span
style="font-style: italic;">(REQUIRED)</span> <br>
Must be <b>FALSE</b> in this case.
<br>
<br>
<span style="font-weight: bold;">Headline</span> <span
style="font-style: italic;">(REQUIRED)</span> <br>
The headline of this help entry. Can consist of any alpha-numeric
characters. No HTML/CSS elements are not allowed here.
<br>
<br>
<span style="font-weight: bold;">Text</span> <span
style="font-style: italic;">(REQUIRED)</span> <br>
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>
2004-03-17 17:27:56 +00:00
<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>
2004-03-17 17:27:56 +00:00
</ul>
<br>
<span style="font-weight: bold;">SeeAlso</span> <span
style="font-style: italic;">(OPTIONAL)</span> <br>
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>
<span style="font-weight: bold;"><a>ext</a></span><a> <span
style="font-style: italic;">(REQUIRED)</span> <br>
Must be <b>TRUE</b> in this case.
<br>
<br>
<span style="font-weight: bold;">Link</span> <span
style="font-style: italic;">(REQUIRED)</span> <br>
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>
2004-06-11 15:44:49 +00:00
<br>
<br>
<h2>6. Module meta data</h2>
2004-06-13 19:58:58 +00:00
<h3>6.1 can_manage()
</h3>
&nbsp;&nbsp;&nbsp; "account_types" =&gt; array<br>
<br>
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; Example:
array("user", "host")</span><br style="font-weight: bold;">
<br>
<h3>6.2 is_base_module()</h3>
2004-06-11 15:44:49 +00:00
&nbsp;&nbsp;&nbsp; "is_base" =&gt; boolean<br>
<br>
2004-06-13 19:58:58 +00:00
<h3>6.3 get_ldap_filter()</h3>
2004-06-11 15:44:49 +00:00
&nbsp;&nbsp;&nbsp; "ldap_filter" =&gt; array<br>
<br>
<span style="font-weight: bold;">&nbsp;&nbsp; Example:</span><span
style="font-style: italic; font-weight: bold;"> array('or' =&gt;
2004-06-20 17:32:02 +00:00
'objectClass=posixAccount', 'and' =&gt; '(!(uid=*$))')<br>
<br>
</span>
<h3>6.4 get_dependencies()<br>
</h3>
&nbsp;&nbsp;&nbsp; "dependencies" =&gt; array<br>
<br>
<span style="font-weight: bold;">&nbsp;&nbsp; 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"
=&gt; array("posixAccount", array("qmail", "sendmail")), "conflicts"
=&gt; array("exim")</span></span><span
style="font-style: italic; font-weight: bold;">)<br>
</span><br>
<h3>6.5 get_profileOptions()<br>
</h3>
&nbsp;&nbsp;&nbsp; "profile_options" =&gt; array<br>
<br>
<span style="font-weight: bold;">&nbsp;&nbsp; <span
style="font-style: italic;">Syntax for array is the same as for the
return value of get_profileOptions().<br>
<br>
</span></span>
<h3>6.6 check_profileOptions()<br>
</h3>
&nbsp;&nbsp;&nbsp; "profile_checks" =&gt; array<br>
<br>
<span style="font-weight: bold;">&nbsp;&nbsp; The keys of the array are
the names of the option identifiers.<br>
&nbsp;&nbsp; Each array element is an array containing these values:<br>
<br>
2004-06-20 17:32:02 +00:00
</span>
<ul>
<li style="font-weight: bold;">type:<span style="font-weight: normal;">
determines how to check input</span></li>
<ul>
<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>
</ul>
<li style="font-weight: bold;">error_message:<span
style="font-weight: normal;"> message that is displayed if input value
was syntactically incorrect</span></li>
<ul>
<li style="font-weight: bold;"><span style="font-weight: normal;">array
to build StatusMessages (0 =&gt; message type, 1 =&gt; message
head, 2 =&gt; message text, 3 =&gt; additional variables)</span><span
style="font-weight: normal;"></span></li>
</ul>
<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>
name of first 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>)</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>
</span></li>
<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
filled set to true (optional)<span style="font-weight: bold;"><br>
</span></li>
<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>
<ul>
<li>&nbsp;array to build StatusMessages (0 =&gt; message type, 1
=&gt; message
head, 2 =&gt; message text, 3 =&gt; additional variables)</li>
</ul>
</ul>
<br>
<h3>6.7 get_configOptions()<br>
</h3>
&nbsp;&nbsp;&nbsp; "config_options" =&gt; array('user' =&gt; array,
'host' =&gt; array, 'all' =&gt; array)<br>
<br>
&nbsp;&nbsp;&nbsp; The values from <span style="font-weight: bold;">'all'</span>
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;">
<br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp; <span
style="font-style: italic;">Syntax for sub arrays is the same as for
the
return value of get_configOptions().<br>
<br>
</span></span>
<h3>6.8 get_configDescriptions()<br>
</h3>
&nbsp;&nbsp;&nbsp; "config_descriptions" =&gt; array<br>
<br>
<span style="font-weight: bold;">&nbsp;&nbsp; <span
style="font-style: italic;">Syntax for array is the same as for the
return value of get_configDescriptions().<br>
<br>
</span></span>
<h3>6.9 check_configOptions()<br>
</h3>
&nbsp;&nbsp;&nbsp; "config_checks" =&gt; array('user' =&gt; array,
'host' =&gt; 'array', 'all' =&gt; array)<br>
<br>
&nbsp;&nbsp;&nbsp; The values from 'all' are always used for checking,
the other values only if they are inside the <span
style="font-style: italic;">$scopes</span> array.<br>
<span style="font-weight: bold;"><br style="font-weight: bold;">
</span><span style="font-weight: bold;">&nbsp;&nbsp; <span
style="font-style: italic;">Syntax for sub arrays is the same as for
check_profileOptions().<br>
<br>
</span></span>
<h3><br>
</h3>
<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>
2004-02-17 21:08:08 +00:00
</body>
</html>