new meta HTML classes
This commit is contained in:
parent
7af8ba5924
commit
b1724f0120
|
@ -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>
|
||||||
* This function will create the meta HTML code to
|
* This function will create the meta HTML code to
|
||||||
show a page with all attributes.<br>
|
show a page with all attributes.<br>
|
||||||
*<br>
|
*<br>
|
||||||
* @param array $post HTTP-POST values<br>
|
* @return htmlElement HTML meta data<br>
|
||||||
*/<br>
|
*/<br>
|
||||||
<span style="font-weight: bold;">function</span> <span style="color: rgb(255, 0, 0);">display_html_attributes</span>($post) {<br>
|
<span style="font-weight: bold;">function</span> <span style="color: rgb(255, 0, 0);">display_html_attributes</span>() {<br> $return = new htmlTable();<br>
|
||||||
$return = array();<br>
|
$macCount = 0;<br>
|
||||||
// list current MACs<br>
|
// list current MACs<br>
|
||||||
for ($i = 0; $i <
|
if (isset($this->attributes['macAddress'])) {<br>
|
||||||
sizeof($this->attributes['macAddress']); $i++) {<br>
|
$macCount = sizeof($this->attributes['macAddress']);<br>
|
||||||
$return[] =
|
for ($i = 0;
|
||||||
array(<br>
|
$i < sizeof($this->attributes['macAddress']); $i++) {<br>
|
||||||
|
|
||||||
array('kind' => 'text', 'text' =>
|
$return->addElement(new htmlOutputText(_('MAC
|
||||||
_('MAC address')),<br>
|
address')));<br>
|
||||||
|
|
||||||
array('kind' => 'input', 'name' =>
|
$macInput = new htmlInputField('macAddress' . $i,
|
||||||
'macAddress' . $i, 'type' => 'text', 'size' => '17', 'maxlength'
|
$this->attributes['macAddress'][$i]);<br>
|
||||||
=> '17', 'value' => $this->attributes['macAddress'][$i]),<br>
|
$macInput->setFieldSize(17);<br>
|
||||||
|
$macInput->setFieldMaxLength(17);<br>
|
||||||
|
$return->addElement($macInput);<br>
|
||||||
|
|
||||||
array('kind' => 'input', 'type' =>
|
$return->addElement(new htmlButton('delMAC' . $i,
|
||||||
'submit', 'name' => 'delMAC' . $i, 'value' => _("Remove")),<br>
|
'del.png', true));<br>
|
||||||
|
|
||||||
array('kind' => 'help', 'value' =>
|
$return->addElement(new htmlHelpLink('mac'),
|
||||||
'mac'));<br>
|
true);<br>
|
||||||
|
}<br>
|
||||||
}<br>
|
}<br>
|
||||||
// input box for new MAC<br>
|
// input box for new MAC<br>
|
||||||
$return[] = array(<br>
|
$return->addElement(new htmlOutputText(_('New MAC address')));<br>
|
||||||
array('kind' => 'text', 'text' => _('New MAC address')),<br>
|
$newMacInput = new htmlInputField('macAddress', '');<br>
|
||||||
array('kind' => 'input', 'name' => 'macAddress', 'type' =>
|
$newMacInput->setFieldSize(17);<br>
|
||||||
'text', 'size' => '17', 'maxlength' => '17', 'value' => ''),<br>
|
$newMacInput->setFieldMaxLength(17);<br>
|
||||||
array('kind' => 'input', 'type' => 'submit', 'name' =>
|
$return->addElement($newMacInput);<br>
|
||||||
'addMAC', 'value' => _("Add")),<br>
|
$return->addElement(new htmlButton('addMAC', 'add.png', true));<br>
|
||||||
array('kind' => 'help', 'value' => 'mac'),<br>
|
$return->addElement(new htmlHelpLink('mac'));<br>
|
||||||
array('kind' => 'input', 'type' => 'hidden', 'value' =>
|
$return->addElement(new htmlHiddenInput('mac_number', $macCount));<br>
|
||||||
sizeof($this->attributes['macAddress']), 'name' => 'mac_number'));<br>
|
|
||||||
return $return;<br>
|
return $return;<br>
|
||||||
}<br>
|
}<br>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -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>
|
||||||
$return = array();<br>
|
$return = array();<br>
|
||||||
// configuration options<br>
|
// configuration options<br>
|
||||||
$return[<span style="color: rgb(255, 0, 0);">'config_options'</span>][<span style="color: rgb(255, 0, 0);">'group'</span>] = array(<br>
|
$configContainer = new htmlTable();<br>
|
||||||
array(<br>
|
$configContainer->addElement(new htmlSubTitle(_("Groups")), true);<br>
|
||||||
|
$minGidInput = new
|
||||||
array('kind' => 'text', 'text' =>
|
htmlTableExtendedInputField(_('Minimum GID number'),
|
||||||
'<b>' .
|
'posixGroup_minGID', null, 'minMaxGID');<br>
|
||||||
_('Minimum GID number') . " *: </b>"),<br>
|
$minGidInput->setRequired(true);<br>
|
||||||
array('kind' => 'input', 'name' =>
|
$configContainer->addElement($minGidInput, true);<br>
|
||||||
'posixGroup_minGID', 'type' => 'text', 'size' => '10',
|
$maxGidInput = new
|
||||||
'maxlength' => '255'),<br>
|
htmlTableExtendedInputField(_('Maximum GID number'),
|
||||||
|
'posixGroup_maxGID', null, 'minMaxGID');<br>
|
||||||
array('kind' => 'text', 'value' =>
|
$maxGidInput->setRequired(true);<br>
|
||||||
'&nbsp;'),<br>
|
$configContainer->addElement($maxGidInput, true);<br>
|
||||||
|
$return[<span style="color: red;">'config_options'</span>][<span style="color: red;">'group'</span>] = $configContainer;<br>
|
||||||
array('kind' => 'text', 'text' =>
|
|
||||||
'<b>' .
|
|
||||||
_('Maximum GID number') . " *: </b>"),<br>
|
|
||||||
array('kind' => 'input', 'name' =>
|
|
||||||
'posixGroup_maxGID', 'type' => 'text', 'size' => '10',
|
|
||||||
'maxlength' => '255'),<br>
|
|
||||||
|
|
||||||
array('kind' => 'help', 'value' =>
|
|
||||||
'minMaxGID')),<br>
|
|
||||||
array(<br>
|
|
||||||
|
|
||||||
array('kind' => 'text', 'text' =>
|
|
||||||
'<b>' .
|
|
||||||
_("Password hash type") . ': &nbsp;</b>'),<br>
|
|
||||||
array('kind' => 'select', 'name' =>
|
|
||||||
'posixGroup_pwdHash', 'size' => '1', 'options' => array("CRYPT", "SHA", "SSHA", "MD5", "SMD5",
|
|
||||||
"PLAIN"), 'options_selected' => array('SSHA')),<br>
|
|
||||||
|
|
||||||
array('kind' => 'text', 'value' =>
|
|
||||||
'&nbsp;'),<br>
|
|
||||||
|
|
||||||
array('kind' => 'text', 'value' =>
|
|
||||||
'&nbsp;'),<br>
|
|
||||||
|
|
||||||
array('kind' => 'text', 'value' =>
|
|
||||||
'&nbsp;'),<br>
|
|
||||||
array('kind' => 'help', 'value' => 'pwdHash'))<br>
|
|
||||||
);<br>
|
|
||||||
[...]<br>
|
[...]<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>
|
||||||
|
|
|
@ -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>
|
||||||
$return = array();<br>
|
$return = array();<br>
|
||||||
// profile elements<br>
|
// profile elements<br>
|
||||||
$return[<span style="color: rgb(255, 0, 0);">'profile_options'</span>] = array(<br>
|
$return[<span style="color: rgb(255, 0, 0);">'profile_options'</span>] = array(<br>
|
||||||
array(<br>
|
new
|
||||||
|
htmlTableExtendedInputField(_('Job title'), 'inetOrgPerson_title',
|
||||||
array('kind' => 'text', 'text' =>
|
null, 'title'),<br>
|
||||||
_('Job title') . ":"),<br>
|
new htmlTableExtendedInputField(_('Employee type'), 'inetOrgPerson_employeeType', null, 'employeeType')<br>
|
||||||
|
|
||||||
array('kind' => 'input', 'name' =>
|
|
||||||
'inetOrgPerson_title', 'type' => 'text', 'size' => '30',
|
|
||||||
'maxlength' => '255'),<br>
|
|
||||||
|
|
||||||
array('kind' => 'help', 'value' =>
|
|
||||||
'title')),<br>
|
|
||||||
array(<br>
|
|
||||||
|
|
||||||
array('kind' => 'text', 'text' =>
|
|
||||||
_('Employee type') . ":"),<br>
|
|
||||||
|
|
||||||
array('kind' => 'input', 'name' =>
|
|
||||||
'inetOrgPerson_employeeType', 'type' => 'text', 'size' => '30',
|
|
||||||
'maxlength' => '255'),<br>
|
|
||||||
|
|
||||||
array('kind' => 'help', 'value' =>
|
|
||||||
'employeeType'))<br>
|
|
||||||
);<br>
|
);<br>
|
||||||
[...]<br>
|
[...]<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>
|
||||||
|
|
|
@ -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;"> /**<br>
|
<td style="vertical-align: top;"> /**<br>
|
||||||
|
@ -46,11 +43,9 @@ get_metaData() {<br>
|
||||||
$return["account_types"] = array("host");<br>
|
$return["account_types"] = array("host");<br>
|
||||||
// upload fields<br>
|
// upload fields<br>
|
||||||
<span style="color: rgb(255, 0, 0);">
|
<span style="color: rgb(255, 0, 0);">
|
||||||
$return['upload_columns'] = array(</span><br
|
$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);">
|
<span style="color: rgb(255, 0, 0);">
|
||||||
array(</span><br
|
array(</span><br style="color: rgb(255, 0, 0);">
|
||||||
style="color: rgb(255, 0, 0);">
|
|
||||||
<span style="color: rgb(255, 0, 0);">
|
<span style="color: rgb(255, 0, 0);">
|
||||||
'name' =>
|
'name' =>
|
||||||
'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>
|
||||||
'example'
|
'example'
|
||||||
=> '00:01:02:DE:EF:18'</span><br style="color: rgb(255, 0, 0);">
|
=> '00:01:02:DE:EF:18'</span><br style="color: rgb(255, 0, 0);">
|
||||||
<span style="color: rgb(255, 0, 0);">
|
<span style="color: rgb(255, 0, 0);">
|
||||||
)</span><br
|
)</span><br style="color: rgb(255, 0, 0);">
|
||||||
style="color: rgb(255, 0, 0);">
|
|
||||||
<span style="color: rgb(255, 0, 0);">
|
<span style="color: rgb(255, 0, 0);">
|
||||||
);</span><br>
|
);</span><br>
|
||||||
return $return;<br>
|
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;"> /**<br>
|
<td style="vertical-align: top;"> /**<br>
|
||||||
|
@ -105,12 +97,10 @@ objectClass which is added to all accounts.<br>
|
||||||
* @param array $partialAccounts list of hash arrays
|
* @param array $partialAccounts list of hash arrays
|
||||||
(name => value) which are later added to LDAP<br>
|
(name => value) which are later added to LDAP<br>
|
||||||
* @param array $ids list of IDs for column position
|
* @param array $ids list of IDs for column position
|
||||||
(e.g. "posixAccount_uid" => 5)<br>
|
(e.g. "posixAccount_uid" => 5)<br> * @param array $selectedModules list of selected account modules<br>
|
||||||
* @param array $selectedModules list of selected account modules<br>
|
|
||||||
* @return array list of error messages if any<br>
|
* @return array list of error messages if any<br>
|
||||||
*/<br>
|
*/<br>
|
||||||
<span style="font-weight: bold;">function</span> <span
|
<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, &$partialAccounts, $selectedModules) {<br>
|
$ids, &$partialAccounts, $selectedModules) {<br>
|
||||||
$messages = array();<br>
|
$messages = array();<br>
|
||||||
for ($i = 0; $i <
|
for ($i = 0; $i <
|
||||||
|
@ -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>
|
|
Loading…
Reference in New Issue