Handle hostnames with upper-case letters
[webmin.git] / pserver / list_passwd.cgi
1 #!/usr/local/bin/perl
2 # list_passwd.cgi
3 # Display all the cvs server users
4
5 require './pserver-lib.pl';
6 $access{'passwd'} || &error($text{'passwd_ecannot'});
7 &ui_print_header(undef, $text{'passwd_title'}, "");
8
9 print "$text{'passwd_desc'}<p>\n";
10 @passwd = &list_passwords();
11 @links = ( "<a href='edit_passwd.cgi?new=1'>$text{'passwd_add'}</a>" );
12 if (@passwd) {
13         print &ui_links_row(\@links);
14         print "<table border width=100%>\n";
15         print "<tr $tb> <td><b>$text{'passwd_header'}</b></td> </tr>\n";
16         print "<tr $cb> <td><table width=100%>\n";
17
18         $i = 0;
19         foreach $p (@passwd) {
20                 print "<tr>\n" if ($i%4 == 0);
21                 print "<td width=25%>\n";
22                 print "<a href='edit_passwd.cgi?idx=$p->{'index'}'>";
23                 print $p->{'user'};
24                 if ($p->{'unix'}) {
25                         print "</a> ($p->{'unix'})</td>";
26                         }
27                 else {
28                         print "</a></td>\n";
29                         }
30                 print "</tr>\n" if ($i%4 == 3);
31                 $i++;
32                 }
33         while($i++%4) { print "<td width=25%></td>\n"; }
34
35         print "</table></td></tr></table>\n";
36         }
37 else {
38         print "<b>$text{'passwd_none'}</b><p>\n";
39         }
40 print &ui_links_row(\@links);
41
42 print &ui_hr();
43 print "<form action=save_sync.cgi>\n";
44 print "$text{'passwd_sync'}<p>\n";
45 printf "<input type=checkbox name=sync_create value=1 %s> %s<br>\n",
46         $config{'sync_create'} ? "checked" : "", $text{'passwd_sync_create'};
47 print "&nbsp;" x 5,$text{'edit_unix'},"\n";
48 printf "<input type=radio name=sync_mode value=0 %s> %s\n",
49         $config{'sync_user'} ? "" : "checked", $text{'edit_unixdef'};
50 printf "<input type=radio name=sync_mode value=1 %s>\n",
51         $config{'sync_user'} ? "checked" : "";
52 print &unix_user_input("sync_user", $config{'sync_user'}),"<br>\n";
53 printf "<input type=checkbox name=sync_modify value=1 %s> %s<br>\n",
54         $config{'sync_modify'} ? "checked" : "", $text{'passwd_sync_modify'};
55 printf "<input type=checkbox name=sync_delete value=1 %s> %s<p>\n",
56         $config{'sync_delete'} ? "checked" : "", $text{'passwd_sync_delete'};
57
58 print "<input type=submit value='$text{'save'}'></form>\n";
59
60 &ui_print_footer("", $text{'index_return'});
61