added icon
This commit is contained in:
parent
6eca9338e7
commit
fb8d08fbf8
|
@ -1,10 +1,9 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Module HowTo - General module options</title>
|
||||
<link rel="stylesheet" type="text/css" href="style/layout.css">
|
||||
</head>
|
||||
<body>
|
||||
<html><head><title>Module HowTo - General module options</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="style/layout.css"></head><body>
|
||||
<div style="text-align: center;">
|
||||
<h1>Module HowTo - General module options<br>
|
||||
</h1>
|
||||
|
@ -13,21 +12,18 @@
|
|||
<div style="text-align: left;"><br>
|
||||
<h2>1. Account types<br>
|
||||
</h2>
|
||||
LAM currently provides three account types: <span
|
||||
style="font-weight: bold;">users, groups, hosts<br>
|
||||
LAM currently provides three account types: <span style="font-weight: bold;">users, groups, hosts<br>
|
||||
</span>A module can manage one or more account types.<br>
|
||||
<br>
|
||||
The types are specified with <span style="font-weight: bold;">can_manage()</span>
|
||||
or <span style="font-weight: bold;">meta['account_types']</span>.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
||||
style="font-weight: bold; text-decoration: underline;">
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
|
||||
<br>
|
||||
Our <span style="font-style: italic;">ieee802Device</span>
|
||||
module will be used only for host accounts.<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
|
@ -41,8 +37,7 @@ get_metaData() {<br>
|
|||
$return = array();<br>
|
||||
// manages host accounts<br>
|
||||
<span style="color: rgb(255, 0, 0);">
|
||||
$return["account_types"] = array("host");</span><br
|
||||
style="color: rgb(255, 0, 0);">
|
||||
$return["account_types"] = array("host");</span><br style="color: rgb(255, 0, 0);">
|
||||
return $return;<br>
|
||||
}<br>
|
||||
</td>
|
||||
|
@ -54,15 +49,13 @@ get_metaData() {<br>
|
|||
<h2>2. Base modules<br>
|
||||
</h2>
|
||||
In LDAP every entry needs exactly one <span style="font-style: italic;">structural
|
||||
object class</span>. Therefore all modules which provide a <span
|
||||
style="font-style: italic;">structural object class</span> are marked
|
||||
object class</span>. Therefore all modules which provide a <span style="font-style: italic;">structural object class</span> are marked
|
||||
as <span style="font-weight: bold;">base module</span>.<br>
|
||||
<br>
|
||||
This is done with <span style="font-weight: bold;">is_base_module()</span>
|
||||
or <span style="font-weight: bold;">meta['is_base']</span>.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
||||
style="font-weight: bold; text-decoration: underline;">
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
|
||||
<br>
|
||||
The <span style="font-style: italic;">inetOrgPerson</span>
|
||||
module manages the structural object class "inetOrgPerson" and
|
||||
|
@ -70,8 +63,7 @@ therefore is a <span style="font-weight: bold;">base module</span>.<br>
|
|||
If your module is not a base module you can skip the meta data for
|
||||
this, default is <span style="font-style: italic;">false</span>.<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
|
@ -85,8 +77,7 @@ get_metaData() {<br>
|
|||
$return = array();<br>
|
||||
// base module<br>
|
||||
<span style="color: rgb(255, 0, 0);">
|
||||
$return["is_base"] = true;</span><br
|
||||
style="color: rgb(255, 0, 0);">
|
||||
$return["is_base"] = true;</span><br style="color: rgb(255, 0, 0);">
|
||||
return $return;<br>
|
||||
}<br>
|
||||
</td>
|
||||
|
@ -96,9 +87,7 @@ get_metaData() {<br>
|
|||
<br>
|
||||
<br>
|
||||
<h2>3. Alias name</h2>
|
||||
The module name is very limited, therefore every module has an <span
|
||||
style="font-style: italic;">alias name</span>. This <span
|
||||
style="font-style: italic;">alias name</span> has no limitations and
|
||||
The module name is very limited, therefore every module has an <span style="font-style: italic;">alias name</span>. This <span style="font-style: italic;">alias name</span> has no limitations and
|
||||
can be translated. It may contain special characters but make sure that
|
||||
it does not contain HTML special characters like "<".<br>
|
||||
The <span style="font-style: italic;">alias name </span>can be the
|
||||
|
@ -109,14 +98,12 @@ The <span style="font-style: italic;">alias name</span> is specified
|
|||
with <span style="font-weight: bold;">get_alias()</span>
|
||||
or <span style="font-weight: bold;">meta['alias']</span>.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
||||
style="font-weight: bold; text-decoration: underline;">
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
|
||||
<br>
|
||||
Our <span style="font-style: italic;">ieee802Device</span>
|
||||
module will get the alias MAC address.<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
|
@ -130,8 +117,7 @@ get_metaData() {<br>
|
|||
$return = array();<br>
|
||||
// alias name<br>
|
||||
<span style="color: rgb(255, 0, 0);">
|
||||
$return["alias"] = _("MAC address");</span><br
|
||||
style="color: rgb(255, 0, 0);">
|
||||
$return["alias"] = _("MAC address");</span><br style="color: rgb(255, 0, 0);">
|
||||
return $return;<br>
|
||||
}<br>
|
||||
</td>
|
||||
|
@ -148,15 +134,13 @@ module are not structural.<br>
|
|||
The dependencies are specified with <span style="font-weight: bold;">get_dependencies()</span>
|
||||
or <span style="font-weight: bold;">meta['dependencies']</span>.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
||||
style="font-weight: bold; text-decoration: underline;">
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
|
||||
<br>
|
||||
Our <span style="font-style: italic;">ieee802Device</span>
|
||||
module depends on the account module (because it is the only structural
|
||||
module at this time).<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
|
@ -171,8 +155,7 @@ get_metaData() {<br>
|
|||
// module dependencies<br>
|
||||
<span style="color: rgb(255, 0, 0);">
|
||||
$return['dependencies'] = array('depends' =>
|
||||
array('account'), 'conflicts' => array());</span><br
|
||||
style="color: rgb(255, 0, 0);">
|
||||
array('account'), 'conflicts' => array());</span><br style="color: rgb(255, 0, 0);">
|
||||
return $return;<br>
|
||||
}<br>
|
||||
</td>
|
||||
|
@ -185,29 +168,25 @@ array('account'), 'conflicts' => array());</span><br
|
|||
There are many situations where you will display messages to the user.
|
||||
The modules should define such messages at a common place to make it
|
||||
easier to modify them without searching the complete file.<br>
|
||||
The <span style="font-style: italic;">baseModule</span> offers the $<span
|
||||
style="font-weight: bold;">messages</span> variable for this. It
|
||||
The <span style="font-style: italic;">baseModule</span> offers the $<span style="font-weight: bold;">messages</span> variable for this. It
|
||||
should be filled by a function called <span style="font-weight: bold;">load_Messages()</span>.<br>
|
||||
The <span style="font-style: italic;">baseModule</span> will
|
||||
automatically check if you have implemented this function and call it
|
||||
at construction time.<br>
|
||||
<br>
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
||||
style="font-weight: bold; text-decoration: underline;">
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
|
||||
<br>
|
||||
Now let our <span style="font-style: italic;">ieee802Device</span>
|
||||
module define a message.<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
* This function fills the error message array with
|
||||
messages<br>
|
||||
*/<br>
|
||||
<span style="font-weight: bold;">function</span> <span
|
||||
style="color: rgb(255, 0, 0);">load_Messages</span>() {<br>
|
||||
<span style="font-weight: bold;">function</span> <span style="color: rgb(255, 0, 0);">load_Messages</span>() {<br>
|
||||
$this->messages['mac'][0] =
|
||||
array('ERROR', 'MAC address is invalid!'); // third array value
|
||||
is set dynamically<br>
|
||||
|
@ -231,8 +210,7 @@ smbldap-tools) also create accounts and the spelling is differnt.<br>
|
|||
The <span style="font-style: italic;">ieee802Device</span> module
|
||||
manages one object class.<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
|
@ -271,8 +249,7 @@ the "cn" attribute. This attribute is also known under the alias
|
|||
This way the module will never see attributes called "commonName"
|
||||
because LAM renames them as soon as the LDAP entry is loaded.<br>
|
||||
<br>
|
||||
<table style="width: 100%; text-align: left;" class="mod-code"
|
||||
border="0" cellpadding="2" cellspacing="2">
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
|
@ -300,5 +277,50 @@ get_metaData() {<br>
|
|||
<h2><span style="font-weight: bold;"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<h2>8. Icon<br>
|
||||
</h2>
|
||||
You can specify a icon for you module. It will be displayed on the
|
||||
account pages and other module specific places (e.g. file upload).<br>
|
||||
The icons must be 32x32 pixels in size. The location is relative to the <span style="font-style: italic;">graphics</span> directory.<br>
|
||||
|
||||
<br>
|
||||
|
||||
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br>
|
||||
|
||||
<br>
|
||||
|
||||
The <span style="font-style: italic;">posixGroup</span> module uses the "tux.png" from the graphics directory.<br>
|
||||
|
||||
<br>
|
||||
|
||||
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"> /**<br>
|
||||
* Returns meta data that is interpreted by parent
|
||||
class<br>
|
||||
*<br>
|
||||
* @return array array with meta data<br>
|
||||
*/<br>
|
||||
<span style="font-weight: bold;">function</span>
|
||||
get_metaData() {<br>
|
||||
$return = array();<br> // icon<br>
|
||||
<span style="color: rgb(255, 0, 0);">$return['icon'] = 'tux.png';</span><br>
|
||||
return $return;<br>
|
||||
}<br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<br>
|
||||
|
||||
<span style="font-weight: bold;"></span>
|
||||
<h2><span style="font-weight: bold;"></span></h2>
|
||||
|
||||
|
||||
|
||||
</body></html>
|
Loading…
Reference in New Issue