Handle hostnames with upper-case letters
[webmin.git] / squid / edit_nauth.cgi
1 #!/usr/local/bin/perl
2 # edit_nauth.cgi
3 # Display a list of proxy users
4
5 require './squid-lib.pl';
6 if ($config{'crypt_conf'} == 1) {
7         eval "use MD5";
8         if ($@) {
9                 &error(&text('eauth_nomd5', $module_name));
10                 }
11         }
12
13 $access{'proxyauth'} || &error($text{'eauth_ecannot'});
14 &ui_print_header(undef, $text{'eauth_header'}, "", undef, 0, 0, 0, &restart_button());
15 $conf = &get_config();
16 $authfile = &get_auth_file($conf);
17
18 print &text('eauth_nmsgaccess', "<tt>$authfile</tt>"),"<p>\n";
19 @users = &list_auth_users($authfile);
20 if (@users) {
21         print "<a href=\"edit_nuser.cgi?new=1\">$text{'eauth_addpuser'}</a><br>\n";
22         print "<table border width=100%>\n";
23         print "<tr $tb> <td><b>$text{'eauth_pusers'}</b></td> </tr>\n";
24         print "<tr $cb> <td><table width=100%>\n";
25         for($i=0; $i<@users; $i++) {
26                 local ($it, $unit) = $users[$i]->{'enabled'} ? ('', '') :
27                                         ('<i>', '</i>');
28                 print "<tr>\n" if ($i%4 == 0);
29                 print "<td width=25%><a href=\"edit_nuser.cgi?",
30                       "index=$i\">$it$users[$i]->{'user'}$unit</a></td>\n";
31                 print "</tr>\n" if ($i%4 == 3);
32                 }
33         while($i++%4) { print "<td width=25%></td>\n"; }
34         print "</table></td></tr></table>\n";
35         }
36 else {
37         print "<b>$text{'eauth_nopusers'}</b> <p>\n";
38         }
39 print "<a href=\"edit_nuser.cgi?new=1\">$text{'eauth_addpuser'}</a><p>\n";
40
41 &ui_print_footer("", $text{'eauth_return'});
42