Debian Codegraph @

docs/devel/mod_upload2.htm

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html lang="en">
3 <head>
4 <title>Module HowTo - Advanced upload options</title>
5 <link rel="stylesheet" type="text/css" href="style/layout.css">
6 <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
7 </head>
8 <body>
9 <div style="text-align: center;">
10 <h1>Module HowTo - Advanced upload options<br>
11 </h1>
12 <div style="text-align: left;"><br>
13 The <span style="font-style: italic;">ieee802Device</span> module only
14 needs the basic upload functions for its functionality.<br>
15 However there are more possibilities for the modules to control the
16 file upload.<br>
17 </div>
18 <div style="text-align: left;"><br>
19 <h2>1. Module order<br>
20 </h2>
21 Your module might depend on the input values of another module. In this
22 case you probably want that your module is called as the second one.<br>
23 <br>
24 You can define dependencies to other modules with the function <span
25 style="font-weight: bold;">get_uploadPreDepends()</span> or <span
26 style="font-weight: bold;">meta['upload_preDepends']</span>.<br>
27 <br>
28 <span style="font-weight: bold; text-decoration: underline;">Example:</span><br
29 style="font-weight: bold; text-decoration: underline;">
30 <br>
31 The <span style="font-style: italic;">sambaGroupMapping</span> module
32 needs the group name to set the default <span
33 style="font-style: italic;">displayName</span>. Therefore it depends
34 on the <span style="font-style: italic;">posixGroup</span> module<br>
35 <br>
36 <div class="mod-code">
37 &nbsp;&nbsp;&nbsp; * Returns meta data that is interpreted by parent
38 class<br>
39 &nbsp;&nbsp;&nbsp; *<br>
40 &nbsp;&nbsp;&nbsp; * @return array array with meta data<br>
41 &nbsp;&nbsp;&nbsp; */<br>
42 &nbsp;&nbsp;&nbsp;<span style="font-weight: bold;"> function</span>
43 get_metaData() {<br>
44 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $return = array();<br>
45 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; // upload dependencies<br>
46 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$return[<span
47 style="color: rgb(255, 0, 0);">'upload_preDepends'</span>] =
48 array('posixGroup');<br>
49 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
50 </div>
51 <br>
52 <br>
53 <h2>2. Upload post actions<br>
54 </h2>
55 If your module does not only create an account but relates the account
56 with other existing LDAP entries you can do these modifications after
57 the account was created.<br>
58 This is useful for adding users to groups or setting quotas.<br>
59 <br>
60 You have to implement the function <span style="font-weight: bold;">doUploadPostActions()</span>
61 in your module. Since post actions are very special there is no <span
62 style="font-style: italic;">meta data</span> for this.<br>
63 <br>
64 <span style="font-weight: bold; text-decoration: underline;">Example:</span><br
65 style="font-weight: bold; text-decoration: underline;">
66 <br>
67 The <span style="font-style: italic;">posixAccount</span> module
68 offers to put the user account in additional groups. This is done in
69 the post actions.<br>
70 <br>
71 <div class="mod-code">
72 &nbsp;&nbsp;&nbsp; * This function executes one post upload action.<br>
73 &nbsp;&nbsp;&nbsp; *<br>
74 &nbsp;&nbsp;&nbsp; * @param array $data array containing one account in
75 each element<br>
76 &nbsp;&nbsp;&nbsp; * @param array $ids array(&lt;column_name&gt; =&gt;
77 &lt;column number&gt;)<br>
78 &nbsp;&nbsp;&nbsp; * @param array $failed list of accounts which were
79 not created successfully<br>
80 &nbsp;&nbsp;&nbsp; * @param array $temp variable to store temporary
81 data between two post actions<br>
82 &nbsp;&nbsp;&nbsp; * @return array current status<br>
83 &nbsp;&nbsp;&nbsp; * &lt;br&gt; array (<br>
84 &nbsp;&nbsp;&nbsp; * &lt;br&gt;&nbsp; 'status' =&gt; 'finished' |
85 'inProgress'<br>
86 &nbsp;&nbsp;&nbsp; * &lt;br&gt;&nbsp; 'progress' =&gt; 0..100<br>
87 &nbsp;&nbsp;&nbsp; * &lt;br&gt;&nbsp; 'errors' =&gt; array (&lt;array
88 of parameters for StatusMessage&gt;)<br>
89 &nbsp;&nbsp;&nbsp; * &lt;br&gt; )<br>
90 &nbsp;&nbsp;&nbsp; */<br>
91 &nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">function</span> <span
92 style="color: rgb(255, 0, 0);">doUploadPostActions</span>($data, $ids,
93 $failed, &amp;$temp) {<br>
94 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [...]<br>
95 &nbsp;&nbsp;&nbsp; }<br>
96 </div>
97 <br>
98 Please make sure that the actions in one call of <span
99 style="font-weight: bold;">doUploadPostActions()</span> are not very
100 time consuming (only one LDAP operation). Your function will be called
101 repeatedly until you give back the status "finished".<br>
102 This allows LAM to avoid running longer than the maximum execution time
103 by sending meta refreshes to the browser.<br>
104 </div>
105 </div>
106 </body>
107 </html>