1
|
#!/usr/bin/perl
|
2
|
# edit_user.cgi
|
3
|
# A form for adding or editing a MON user
|
4
|
|
5
|
require './mon-lib.pl';
|
6
|
&ReadParse();
|
7
|
if ($in{'new'}) {
|
8
|
&ui_print_header(undef, $text{'user_create'}, "");
|
9
|
}
|
10
|
else {
|
11
|
&ui_print_header(undef, $text{'user_edit'}, "");
|
12
|
@users = &list_users();
|
13
|
%user = %{$users[$in{'index'}]};
|
14
|
}
|
15
|
|
16
|
print "<form action=save_user.cgi>\n";
|
17
|
print "<input type=hidden name=index value=$in{'index'}>\n";
|
18
|
print "<input type=hidden name=new value=$in{'new'}>\n";
|
19
|
print "<table border>\n";
|
20
|
print "<tr $tb> <td><b>$text{'user_header'}</b></td> </tr>\n";
|
21
|
print "<tr $cb> <td><table>\n";
|
22
|
|
23
|
print "<tr> <td><b>$text{'user_user'}</b></td>\n";
|
24
|
print "<td><input name=user size=25 value=\"$user{'user'}\"></td> </tr>\n";
|
25
|
|
26
|
print "<tr> <td><b>$text{'user_pass'}</b></td> <td>\n";
|
27
|
if (%user) {
|
28
|
print "<input type=radio name=pass_def value=1 checked> $text{'user_leave'}\n";
|
29
|
print "<input type=radio name=pass_def value=0>\n";
|
30
|
print "<input name=pass size=20 type=password></td> </tr>\n";
|
31
|
}
|
32
|
else {
|
33
|
print "<input name=pass size=20 type=password></td> </tr>\n";
|
34
|
}
|
35
|
print "</table></td></tr></table>\n";
|
36
|
if (%user) {
|
37
|
print "<input type=submit value=\"$text{'save'}\">\n";
|
38
|
print "<input type=submit name=delete value=\"$text{'delete'}\">\n";
|
39
|
}
|
40
|
else {
|
41
|
print "<input type=submit value=\"$text{'create'}\">\n";
|
42
|
}
|
43
|
print "</form>\n";
|
44
|
|
45
|
&ui_print_footer("list_users.cgi", $text{'users_return'},
|
46
|
"", $text{'index_return'});
|
47
|
|