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