Handle hostnames with upper-case letters
[webmin.git] / pserver / edit_passwd.cgi
1 #!/usr/local/bin/perl
2 # Display a form for editing or adding a new CVS user
3
4 require './pserver-lib.pl';
5 $access{'passwd'} || &error($text{'passwd_ecannot'});
6 &ReadParse();
7 if ($in{'new'}) {
8         &ui_print_header(undef, $text{'edit_title1'}, "");
9         }
10 else {
11         &ui_print_header(undef, $text{'edit_title2'}, "");
12         @passwd = &list_passwords();
13         $user = $passwd[$in{'idx'}];
14         }
15
16 print "<form action=save_passwd.cgi>\n";
17 print "<input type=hidden name=new value='$in{'new'}'>\n";
18 print "<input type=hidden name=idx value='$in{'idx'}'>\n";
19
20 print "<table border>\n";
21 print "<tr $tb> <td><b>$text{'edit_header'}</b></td> </tr>\n";
22 print "<tr $cb> <td><table>\n";
23
24 print "<tr> <td><b>$text{'edit_user'}</b></td>\n";
25 printf "<td><input name=user size=15 value='%s'></td> </tr>\n",
26         $user->{'user'};
27
28 print "<tr> <td><b>$text{'edit_pass'}</b></td>\n";
29 printf "<td><input type=radio name=pass_def value=2 %s> %s\n",
30         $user->{'pass'} ? "" : "checked", $text{'edit_pass2'};
31 if ($in{'new'}) {
32         printf "<input type=radio name=pass_def value=3> %s\n",
33                 $text{'edit_pass3'} if (&foreign_check("useradmin"));
34         }
35 else {
36         printf "<input type=radio name=pass_def value=1 %s> %s\n",
37                 $user->{'pass'} ? "checked" : "", $text{'edit_pass1'}
38                 if ($user->{'pass'});
39         }
40 printf "<input type=radio name=pass_def value=0> %s\n",
41         $text{'edit_pass0'};
42 print "<input type=password name=pass size=15></td> </tr>\n";
43
44 print "<tr> <td><b>$text{'edit_unix'}</b></td>\n";
45 printf "<td><input type=radio name=unix_def value=1 %s> %s\n",
46         $user->{'unix'} ? "" : "checked", $text{'edit_unixdef'};
47 printf "<input type=radio name=unix_def value=0 %s>\n",
48         $user->{'unix'} ? "checked" : "";
49 print &unix_user_input("unix", $user->{'unix'}),"</td> </tr>\n";
50
51 print "</table></td></tr></table>\n";
52 if ($in{'new'}) {
53         print "<input type=submit value='$text{'create'}'>\n";
54         }
55 else {
56         print "<input type=submit value='$text{'save'}'>\n";
57         print "<input type=submit name=delete value='$text{'delete'}'>\n";
58         }
59 print "</form>\n";
60
61 &ui_print_footer("list_passwd.cgi", $text{'passwd_return'},
62         "", $text{'index_return'});
63