new meta HTML classes

This commit is contained in:
Roland Gruber 2010-10-24 13:52:51 +00:00
parent 7af8ba5924
commit b1724f0120
4 changed files with 68 additions and 136 deletions

View File

@ -1,9 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Module HowTo - Account pages</title> <html><head><title>Module HowTo - Account pages</title>
<link rel="stylesheet" type="text/css" href="style/layout.css"></head> <link rel="stylesheet" type="text/css" href="style/layout.css"><link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"></head><body>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
<body>
<div style="text-align: center;"> <div style="text-align: center;">
<h1>Module HowTo - Account pages<br> <h1>Module HowTo - Account pages<br>
</h1> </h1>
@ -94,39 +93,41 @@ contains the LDAP attributes which are useful for this module.<br>
&nbsp;&nbsp;&nbsp; * This function will create the meta HTML code to &nbsp;&nbsp;&nbsp; * This function will create the meta HTML code to
show a page with all attributes.<br> show a page with all attributes.<br>
&nbsp;&nbsp;&nbsp; *<br> &nbsp;&nbsp;&nbsp; *<br>
&nbsp;&nbsp;&nbsp; * @param array $post HTTP-POST values<br> &nbsp;&nbsp;&nbsp; * @return htmlElement HTML meta data<br>
&nbsp;&nbsp;&nbsp; */<br> &nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">function</span> <span style="color: rgb(255, 0, 0);">display_html_attributes</span>($post) {<br> &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">function</span> <span style="color: rgb(255, 0, 0);">display_html_attributes</span>() {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = new htmlTable();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = array();<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $macCount = 0;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // list current MACs<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // list current MACs<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for ($i = 0; $i &lt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (isset($this-&gt;attributes['macAddress'])) {<br>
sizeof($this-&gt;attributes['macAddress']); $i++) {<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $macCount = sizeof($this-&gt;attributes['macAddress']);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return[] = &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for ($i = 0;
array(<br> $i &lt; sizeof($this-&gt;attributes['macAddress']); $i++) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlOutputText(_('MAC
_('MAC address')),<br> address')));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'name' =&gt; &nbsp;&nbsp;&nbsp; $macInput = new htmlInputField('macAddress' . $i,
'macAddress' . $i, 'type' =&gt; 'text', 'size' =&gt; '17', 'maxlength' $this-&gt;attributes['macAddress'][$i]);<br>
=&gt; '17', 'value' =&gt; $this-&gt;attributes['macAddress'][$i]),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $macInput-&gt;setFieldSize(17);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $macInput-&gt;setFieldMaxLength(17);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement($macInput);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'type' =&gt; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlButton('delMAC' . $i,
'submit', 'name' =&gt; 'delMAC' . $i, 'value' =&gt; _("Remove")),<br> 'del.png', true));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'help', 'value' =&gt; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlHelpLink('mac'),
'mac'));<br> true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // input box for new MAC<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // input box for new MAC<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return[] = array(<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlOutputText(_('New MAC address')));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt; _('New MAC address')),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $newMacInput = new htmlInputField('macAddress', '');<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'name' =&gt; 'macAddress', 'type' =&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $newMacInput-&gt;setFieldSize(17);<br>
'text', 'size' =&gt; '17', 'maxlength' =&gt; '17', 'value' =&gt; ''),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $newMacInput-&gt;setFieldMaxLength(17);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'type' =&gt; 'submit', 'name' =&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement($newMacInput);<br>
'addMAC', 'value' =&gt; _("Add")),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlButton('addMAC', 'add.png', true));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array('kind' =&gt; 'help', 'value' =&gt; 'mac'),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlHelpLink('mac'));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'type' =&gt; 'hidden', 'value' =&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlHiddenInput('mac_number', $macCount));<br>
sizeof($this-&gt;attributes['macAddress']), 'name' =&gt; 'mac_number'));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $return;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $return;<br>
&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp; }<br>
</td> </td>

View File

@ -1,11 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Module HowTo - Configuration options</title> <html><head><title>Module HowTo - Configuration options</title>
<link rel="stylesheet" type="text/css" href="style/layout.css"> <link rel="stylesheet" type="text/css" href="style/layout.css">
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"></head><body>
</head>
<body>
<h1>Module HowTo - Configuration options<br> <h1>Module HowTo - Configuration options<br>
</h1> </h1>
<div style="text-align: left;"><br> <div style="text-align: left;"><br>
@ -31,9 +29,7 @@ or <span style="font-weight: bold;">meta['config_options']</span>.<br>
<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> <br>
The <span style="font-style: italic;">posixGroup</span> module offers The <span style="font-style: italic;">posixGroup</span> module offers several configuration options including the min/maximum values for GIDs.<br>
three configuration options. The min/maximum values for GIDs and the
password hash type.<br>
<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> <tbody>
@ -48,60 +44,26 @@ class<br>
get_metaData() {<br> get_metaData() {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = array();<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = array();<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; // configuration options<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; // configuration options<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$return[<span style="color: rgb(255, 0, 0);">'config_options'</span>][<span style="color: rgb(255, 0, 0);">'group'</span>] = array(<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $configContainer = new htmlTable();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $configContainer-&gt;addElement(new htmlSubTitle(_("Groups")), true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $minGidInput = new
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt; htmlTableExtendedInputField(_('Minimum GID number'),
'&lt;b&gt;' . 'posixGroup_minGID', null, 'minMaxGID');<br>
_('Minimum GID number') . " *: &lt;/b&gt;"),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $minGidInput-&gt;setRequired(true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'name' =&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $configContainer-&gt;addElement($minGidInput, true);<br>
'posixGroup_minGID', 'type' =&gt; 'text', 'size' =&gt; '10', &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $maxGidInput = new
'maxlength' =&gt; '255'),<br> htmlTableExtendedInputField(_('Maximum GID number'),
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'posixGroup_maxGID', null, 'minMaxGID');<br>
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'value' =&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $maxGidInput-&gt;setRequired(true);<br>
'&amp;nbsp;'),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $configContainer-&gt;addElement($maxGidInput, true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return[<span style="color: red;">'config_options'</span>][<span style="color: red;">'group'</span>] = $configContainer;<br>
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt;
'&lt;b&gt;' .
_('Maximum GID number') . " *: &lt;/b&gt;"),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'name' =&gt;
'posixGroup_maxGID', 'type' =&gt; 'text', 'size' =&gt; '10',
'maxlength' =&gt; '255'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'help', 'value' =&gt;
'minMaxGID')),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt;
'&lt;b&gt;' .
_("Password hash type") . ': &amp;nbsp;&lt;/b&gt;'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'select', 'name' =&gt;
'posixGroup_pwdHash', 'size' =&gt; '1', 'options' =&gt; array("CRYPT", "SHA", "SSHA", "MD5", "SMD5",
"PLAIN"), 'options_selected' =&gt; array('SSHA')),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'value' =&gt;
'&amp;nbsp;'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'value' =&gt;
'&amp;nbsp;'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'value' =&gt;
'&amp;nbsp;'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'help', 'value' =&gt; 'pwdHash'))<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<br> <br>
The min/maximum GID numbers are defined with simple text boxes. The The min/maximum GID numbers are defined with simple text boxes.<br><br>
password hash is selected with a drop down box and SSHA as default
value.<br>
You should make sure that the column count (here: 6) is the same for
each row. Otherwise the configuration page might be badly rendered by
the browser.<br>
<br>
<h2>2. Checking user input</h2> <h2>2. Checking user input</h2>
Probably you also want to check if the input data is syntactically Probably you also want to check if the input data is syntactically
correct.<br> correct.<br>

View File

@ -1,10 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Module HowTo - Account profiles</title> <html><head><title>Module HowTo - Account profiles</title>
<link rel="stylesheet" type="text/css" href="style/layout.css"></head>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
<body>
<link rel="stylesheet" type="text/css" href="style/layout.css"><link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"></head><body>
<div style="text-align: center;"> <div style="text-align: center;">
<h1>Module HowTo - Account profiles<br> <h1>Module HowTo - Account profiles<br>
</h1> </h1>
@ -48,28 +46,10 @@ get_metaData() {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = array();<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = array();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // profile elements<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // profile elements<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return[<span style="color: rgb(255, 0, 0);">'profile_options'</span>] = array(<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return[<span style="color: rgb(255, 0, 0);">'profile_options'</span>] = array(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array(<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; new
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; htmlTableExtendedInputField(_('Job title'), 'inetOrgPerson_title',
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt; null, 'title'),<br>
_('Job title') . ":"),<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; new htmlTableExtendedInputField(_('Employee type'), 'inetOrgPerson_employeeType', null, 'employeeType')<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'name' =&gt;
'inetOrgPerson_title', 'type' =&gt; 'text', 'size' =&gt; '30',
'maxlength' =&gt; '255'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'help', 'value' =&gt;
'title')),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; array(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'text', 'text' =&gt;
_('Employee type') . ":"),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'input', 'name' =&gt;
'inetOrgPerson_employeeType', 'type' =&gt; 'text', 'size' =&gt; '30',
'maxlength' =&gt; '255'),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; array('kind' =&gt; 'help', 'value' =&gt;
'employeeType'))<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
</td> </td>
@ -79,7 +59,7 @@ _('Employee type') . ":"),<br>
<br> <br>
This defines two text boxes in the profile editor, one for the job This defines two text boxes in the profile editor, one for the job
title and one for the employee type.<br> title and one for the employee type.<br>
Your profile options should also provide a help link if the description Your profile options should also provide a help link because the description
of the input element might be not enough.<br> of the input element might be not enough.<br>
<br> <br>
<br> <br>

View File

@ -1,11 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html><head><title>Module HowTo - File upload</title>
<head>
<title>Module HowTo - File upload</title>
<link rel="stylesheet" type="text/css" href="style/layout.css"> <link rel="stylesheet" type="text/css" href="style/layout.css">
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"></head><body>
</head>
<body>
<div style="text-align: center;"> <div style="text-align: center;">
<h1>Module HowTo - File upload<br> <h1>Module HowTo - File upload<br>
</h1> </h1>
@ -22,14 +21,12 @@ and several other values.<br>
The upload columns are specified with <span style="font-weight: bold;">get_uploadColumns()</span> The upload columns are specified with <span style="font-weight: bold;">get_uploadColumns()</span>
or <span style="font-weight: bold;">meta['upload_columns']</span>.<br> or <span style="font-weight: bold;">meta['upload_columns']</span>.<br>
<br> <br>
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br <span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
style="font-weight: bold; text-decoration: underline;">
<br> <br>
The <span style="font-style: italic;">ieee802Device</span> The <span style="font-style: italic;">ieee802Device</span>
module has only one attribute and therefore one column: the MAC address.<br> module has only one attribute and therefore one column: the MAC address.<br>
<br> <br>
<table style="width: 100%; text-align: left;" class="mod-code" <table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
border="0" cellpadding="2" cellspacing="2">
<tbody> <tbody>
<tr> <tr>
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br> <td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
@ -46,11 +43,9 @@ get_metaData() {<br>
&nbsp;&nbsp;&nbsp; $return["account_types"] = array("host");<br> &nbsp;&nbsp;&nbsp; $return["account_types"] = array("host");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // upload fields<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // upload fields<br>
<span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; $return['upload_columns'] = array(</span><br &nbsp;&nbsp;&nbsp; $return['upload_columns'] = array(</span><br style="color: rgb(255, 0, 0);">
style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(</span><br &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;array(</span><br style="color: rgb(255, 0, 0);">
style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'name' =&gt; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'name' =&gt;
'ieee802Device_mac',</span><br style="color: rgb(255, 0, 0);"> 'ieee802Device_mac',</span><br style="color: rgb(255, 0, 0);">
@ -64,8 +59,7 @@ get_metaData() {<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'example' &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'example'
=&gt; '00:01:02:DE:EF:18'</span><br style="color: rgb(255, 0, 0);"> =&gt; '00:01:02:DE:EF:18'</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; )</span><br &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; )</span><br style="color: rgb(255, 0, 0);">
style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">&nbsp;&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; );</span><br> &nbsp;&nbsp; );</span><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $return;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $return;<br>
@ -85,16 +79,14 @@ This is done with <span style="font-weight: bold;">build_uploadAccounts()</span>
The function gets the input data and a list of LDAP accounts as The function gets the input data and a list of LDAP accounts as
parameter.<br> parameter.<br>
<br> <br>
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br <span style="font-weight: bold; text-decoration: underline;">Example:</span><br style="font-weight: bold; text-decoration: underline;">
style="font-weight: bold; text-decoration: underline;">
<br> <br>
The <span style="font-style: italic;">ieee802Device</span> The <span style="font-style: italic;">ieee802Device</span>
module has only one LDAP attribute - <span style="font-style: italic;">'macAddress'</span> module has only one LDAP attribute - <span style="font-style: italic;">'macAddress'</span>
- and the <span style="font-style: italic;">'ieee802Device'</span> - and the <span style="font-style: italic;">'ieee802Device'</span>
objectClass which is added to all accounts.<br> objectClass which is added to all accounts.<br>
<br> <br>
<table style="width: 100%; text-align: left;" class="mod-code" <table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
border="0" cellpadding="2" cellspacing="2">
<tbody> <tbody>
<tr> <tr>
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br> <td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
@ -105,12 +97,10 @@ objectClass which is added to all accounts.<br>
&nbsp;&nbsp;&nbsp; * @param array $partialAccounts list of hash arrays &nbsp;&nbsp;&nbsp; * @param array $partialAccounts list of hash arrays
(name =&gt; value) which are later added to LDAP<br> (name =&gt; value) which are later added to LDAP<br>
&nbsp;&nbsp;&nbsp; * @param array $ids list of IDs for column position &nbsp;&nbsp;&nbsp; * @param array $ids list of IDs for column position
(e.g. "posixAccount_uid" =&gt; 5)<br>  (e.g. "posixAccount_uid" =&gt; 5)<br>&nbsp; &nbsp; * @param array $selectedModules list of selected account modules<br>
  * @param array $selectedModules list of selected account modules<br>
&nbsp;&nbsp;&nbsp; * @return array list of error messages if any<br> &nbsp;&nbsp;&nbsp; * @return array list of error messages if any<br>
&nbsp;&nbsp;&nbsp; */<br> &nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">function</span> <span &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">function</span> <span style="color: rgb(255, 0, 0);">build_uploadAccounts</span>($rawAccounts,
style="color: rgb(255, 0, 0);">build_uploadAccounts</span>($rawAccounts,
$ids, &amp;$partialAccounts, $selectedModules) {<br> $ids, &amp;$partialAccounts, $selectedModules) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $messages = array();<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $messages = array();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for ($i = 0; $i &lt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for ($i = 0; $i &lt;
@ -169,5 +159,4 @@ $errMsg;<br>
<h2><span style="font-weight: bold;"></span></h2> <h2><span style="font-weight: bold;"></span></h2>
</div> </div>
</div> </div>
</body> </body></html>
</html>