Skip to content

Commit a8f8c4b

Browse files
committed
refactoring
1 parent 3c536af commit a8f8c4b

18 files changed

Lines changed: 92 additions & 367 deletions

lam/docs/devel/mod_accountPages.htm

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ <h2>1. Loading the LDAP attributes<br>
3232
object class and the <span style="font-style: italic;">'macAddress'</span>
3333
attribute. Therefore we will save these two values.<br>
3434
<br>
35-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
36-
<tbody>
37-
<tr>
38-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
35+
<div class="mod-code">
3936
&nbsp;&nbsp;&nbsp; * This function loads all needed attributes into the
4037
object.<br>
4138
&nbsp;&nbsp;&nbsp; *<br>
@@ -65,10 +62,7 @@ <h2>1. Loading the LDAP attributes<br>
6562
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
6663
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br>
6764
&nbsp;&nbsp;&nbsp; }<br>
68-
</td>
69-
</tr>
70-
</tbody>
71-
</table>
65+
</div>
7266
<br>
7367
<br>
7468
<h2>2. Page display</h2>
@@ -93,10 +87,7 @@ <h2>2. Page display</h2>
9387
The variable <span style="font-style: italic;">$this-&gt;attributes</span>
9488
contains the LDAP attributes which are useful for this module.<br>
9589
<br>
96-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
97-
<tbody>
98-
<tr>
99-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
90+
<div class="mod-code">
10091
&nbsp;&nbsp;&nbsp; * This function will create the meta HTML code to
10192
show a page with all attributes.<br>
10293
&nbsp;&nbsp;&nbsp; *<br>
@@ -137,10 +128,7 @@ <h2>2. Page display</h2>
137128
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return-&gt;addElement(new htmlHiddenInput('mac_number', $macCount));<br>
138129
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $return;<br>
139130
&nbsp;&nbsp;&nbsp; }<br>
140-
</td>
141-
</tr>
142-
</tbody>
143-
</table>
131+
</div>
144132
<br>
145133
<br>
146134
<h2>3. Processing input data<br>
@@ -164,10 +152,7 @@ <h2>3. Processing input data<br>
164152
The function checks the input fields and fills the LDAP attributes. If
165153
all is ok it will enable the user to move to another module page.<br>
166154
<br>
167-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
168-
<tbody>
169-
<tr>
170-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
155+
<div class="mod-code">
171156
&nbsp;&nbsp;&nbsp; * Write variables into object and do some regex
172157
checks<br>
173158
&nbsp;&nbsp;&nbsp; *<br>
@@ -235,10 +220,7 @@ <h2>3. Processing input data<br>
235220
array_unique($this-&gt;attributes['macAddress']);<br>
236221
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $errors;<br>
237222
&nbsp;&nbsp;&nbsp; }<br>
238-
</td>
239-
</tr>
240-
</tbody>
241-
</table>
223+
</div>
242224
<br>
243225
<br>
244226
<h2>4. Defining that your module is ready for user input and LDAP
@@ -271,10 +253,7 @@ <h2>4. Defining that your module is ready for user input and LDAP
271253
accept input and the account needs a <span style="font-style: italic;">sambaSID</span>
272254
before it can be saved.<br>
273255
<br>
274-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
275-
<tbody>
276-
<tr>
277-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
256+
<div class="mod-code">
278257
&nbsp;&nbsp;&nbsp; * This function is used to check if this module page
279258
can be displayed.<br>
280259
&nbsp;&nbsp;&nbsp; * It returns false if a module depends on data from
@@ -308,10 +287,7 @@ <h2>4. Defining that your module is ready for user input and LDAP
308287
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return true;<br>
309288
&nbsp;&nbsp;&nbsp; }<br>
310289
<br>
311-
</td>
312-
</tr>
313-
</tbody>
314-
</table>
290+
</div>
315291
<br>
316292
<br>
317293
<h2>5. Saving the LDAP attributes<br>
@@ -331,10 +307,7 @@ <h2>5. Saving the LDAP attributes<br>
331307
this function to make sure that its object class is saved. Other
332308
modules (e.g. quota) use it build the lamdaemon commands.<br>
333309
<br>
334-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
335-
<tbody>
336-
<tr>
337-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
310+
<div class="mod-code">
338311
&nbsp;&nbsp;&nbsp; * Returns a list of modifications which have to be
339312
made to the LDAP account.<br>
340313
&nbsp;&nbsp;&nbsp; *<br>
@@ -363,10 +336,7 @@ <h2>5. Saving the LDAP attributes<br>
363336
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
364337
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return parent::save_attributes();<br>
365338
&nbsp;&nbsp;&nbsp; }<br>
366-
</td>
367-
</tr>
368-
</tbody>
369-
</table>
339+
</div>
370340
<br>
371341
<br>
372342
<span style="font-weight: bold;"></span>

lam/docs/devel/mod_basics.htm

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ <h2>3. Defining the class</h2>
4040
<br>
4141
<span style="font-weight: bold;">Example:</span><br>
4242
<br>
43-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
44-
<tbody>
45-
<tr>
46-
<td style="vertical-align: top;">/**<br>
43+
<div class="mod-code">
4744
* Provides MAC addresses for hosts.<br>
4845
*<br>
4946
* @package modules<br>
@@ -52,10 +49,7 @@ <h2>3. Defining the class</h2>
5249
<span style="font-style: italic;">extends </span><span style="font-weight: bold;">baseModule</span> {<br>
5350
<br>
5451
}<br>
55-
</td>
56-
</tr>
57-
</tbody>
58-
</table>
52+
</div>
5953
<br>
6054
<h2>4. Meta data</h2>
6155
The module interface includes a lot of required and optional functions.
@@ -70,10 +64,7 @@ <h2>4. Meta data</h2>
7064
<br>
7165
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br>
7266
<br>
73-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
74-
<tbody>
75-
<tr>
76-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
67+
<div class="mod-code">
7768
&nbsp;&nbsp;&nbsp; * Returns meta data that is interpreted by parent
7869
class<br>
7970
&nbsp;&nbsp;&nbsp; *<br>
@@ -84,10 +75,7 @@ <h2>4. Meta data</h2>
8475
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // icon<br>
8576
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return['icon'] = 'user.png';<br>
8677
&nbsp;&nbsp;&nbsp; }<br>
87-
</td>
88-
</tr>
89-
</tbody>
90-
</table>
78+
</div>
9179
<br>
9280
You will see this functions several times in the next parts of this
9381
HowTo.<br>

lam/docs/devel/mod_config.htm

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ <h2>1. Defining configuration options<br>
3131
<br>
3232
The <span style="font-style: italic;">posixGroup</span> module offers several configuration options including the min/maximum values for GIDs.<br>
3333
<br>
34-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
35-
<tbody>
36-
<tr>
37-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
34+
<div class="mod-code">
3835
&nbsp;&nbsp;&nbsp; * Returns meta data that is interpreted by parent
3936
class<br>
4037
&nbsp;&nbsp;&nbsp; *<br>
@@ -58,10 +55,7 @@ <h2>1. Defining configuration options<br>
5855
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $configContainer-&gt;addElement($maxGidInput, true);<br>
5956
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return[<span style="color: red;">'config_options'</span>][<span style="color: red;">'group'</span>] = $configContainer;<br>
6057
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
61-
</td>
62-
</tr>
63-
</tbody>
64-
</table>
58+
</div>
6559
<br>
6660
The min/maximum GID numbers are defined with simple text boxes.<br><br>
6761
<h2>2. Checking user input</h2>
@@ -80,10 +74,7 @@ <h2>2. Checking user input</h2>
8074
needs to check if the GID numbers are correct. The password hash type
8175
needs not to be checked as it is a selection.<br>
8276
<br>
83-
<table style="width: 100%; text-align: left;" class="mod-code" border="0" cellpadding="2" cellspacing="2">
84-
<tbody>
85-
<tr>
86-
<td style="vertical-align: top;">&nbsp; &nbsp; /**<br>
77+
<div class="mod-code">
8778
&nbsp;&nbsp;&nbsp; * Returns meta data that is interpreted by parent
8879
class<br>
8980
&nbsp;&nbsp;&nbsp; *<br>
@@ -127,10 +118,7 @@ <h2>2. Checking user input</h2>
127118
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
128119
&nbsp;'error_message' =&gt; $this-&gt;messages['gidNumber'][7]);<br>
129120
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
130-
</td>
131-
</tr>
132-
</tbody>
133-
</table>
121+
</div>
134122
<br>
135123
The type <span style="font-weight: bold;">"ext_preg"</span> means that
136124
the <span style="font-style: italic;">baseModule</span> will use the <span style="font-style: italic;">get_preg()</span> function in <span style="font-style: italic;">lib/account.inc</span> for the syntax

lam/docs/devel/mod_ext.htm

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ <h1>Module HowTo - Defining required extensions<br>
2424
The <span style="font-style: italic;">posixAccount</span> module needs
2525
to generate password hashes. Therefore it needs the Hash extension.<br>
2626
<br>
27-
<table style="width: 100%; text-align: left;" class="mod-code"
28-
border="0" cellpadding="2" cellspacing="2">
29-
<tbody>
30-
<tr>
31-
<td style="vertical-align: top;">&nbsp;&nbsp;&nbsp; /**<br>
27+
<div class="mod-code">
3228
&nbsp;&nbsp;&nbsp; * Returns meta data that is interpreted by parent
3329
class<br>
3430
&nbsp;&nbsp;&nbsp; *<br>
@@ -41,10 +37,7 @@ <h1>Module HowTo - Defining required extensions<br>
4137
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$return["extensions"] =
4238
array("hash");<br>
4339
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
44-
</td>
45-
</tr>
46-
</tbody>
47-
</table>
40+
</div>
4841
<br>
4942
<br>
5043
<br>

0 commit comments

Comments
 (0)