5 print([[<script type="text/javascript">
23 local _td01
= "</td><td>";
25 --[[rows(con, "select id,email,clear,crypt,name,uid,gid,homedir,maildir,quota,access,"..
26 "postfix,disablepop3,disableimap,disablewebmail,sharedgroup,smtpaccess"..
27 " from postfix_users")
29 -- XXX do not show some fields
30 -- should we design a model to describe database, then will easy when database structure changed
31 -- email quota access postfix disablepop3 disableimap disablewebmail smtpaccess
33 print('<tr class="th"><td width="25%">'..lang
.email
..
34 '</td><td width="10%">' ..lang
.quota
..
35 '</td><td width="6%">' ..lang
.access
..
36 '</td><td width="8%">' ..lang
.postfix
..
37 '</td><td width="8%">' ..lang
.disablepop3
..
38 '</td><td width="8%">' ..lang
.disableimap
..
39 '</td><td width="12%">' ..lang
.disablewebmail
..
40 '</td><td width="8%">' ..lang
.smtpaccess
..
41 '</td><td>' ..lang
.action
..
43 for id
,email
,clear
,crypt
,name
,uid
,gid
,homedir
,maildir
,quota
,access
,postfix
,disablespop3
,
44 disableimap
,disablewebmail
,sharedgroup
,smtpaccess
46 rows(con
, "select id,email,clear,crypt,name,uid,gid,homedir,maildir,quota,access,"..
47 "postfix,disablepop3,disableimap,disablewebmail,sharedgroup,smtpaccess"..
48 " from postfix_users")
50 print('<tr class="tr_' .. (i
%2) .. '"><td>' ..
55 disablespop3
.. _td01
..
56 disableimap
.. _td01
..
57 disablewebmail
.. _td01
..
58 smtpaccess
.. _td01
..
64 -- create all element for add/edit in the form
65 function out_edit_element()
66 print('<tr><td width="120px">'..lang
.email
..'</td><td><input type=text id=email name=email>'..'</td>'
67 ..'<tr><td>'..lang
.quota
..'</td><td><input type=text id=quota name=quota>'..'</td>'
68 ..'<tr><td>'..lang
.access
..'</td><td><input type=text id=access name=access>'..'</td>'
69 ..'<tr><td>'..lang
.postfix
..'</td><td><input type=text id=postfix name=postfix>'..'</td>'
70 ..'<tr><td>'..lang
.disablepop3
..'</td><td><input type=text id=dpop3 name=dpop3>'..'</td>'
71 ..'<tr><td>'..lang
.disableimap
..'</td><td><input type=text id=dimap name=dimap>'..'</td>'
72 ..'<tr><td>'..lang
.disablewebmail
..'</td><td><input type=text id=dwebmail name=dwebmail>'..'</td>'
73 ..'<tr><td>'..lang
.smtpaccess
..'</td><td><input type=text id=smtpac name=smtpac>'..'</td>'
74 ..'<tr><td> </td><td><input type=submit id=submit name=submit onclick="do_submit();" value="'
75 ..lang
.submit
..'"> <input type=button id=cancel onclick="do_cancel();" value="'
76 ..lang
.cancel
..'"></td></tr>');
80 as_table(out_edit_element
, "100%", "");
81 as_table(cb_table
, "100%", "");
85 print("<b>" .. lang
["postfix user management"] .. ":</b><p>");
88 for email, pwd in rows(con, "select email,clear from postfix_users") do
89 print(string.format ("%s:%s<br>", email, pwd));
93 as_form(cb_form
, "do_user");
97 as_head(cb_head
, lang
["postfix user management"]);
98 as_body(cb_body
, "init();");