3 # Display authentication options and list of proxy users
5 require './squid-lib.pl';
6 $access{'proxyauth'} || &error($text{'eauth_ecannot'});
7 &ui_print_header(undef, $text{'eauth_header'}, "", undef, 0, 0, 0, &restart_button());
10 print "<form action=save_auth.cgi>\n";
11 print "<table border width=100%>\n";
12 print "<tr $tb> <td><b>$text{'eauth_aopt'}</b></td> </tr>\n";
13 print "<tr $cb> <td><table>\n";
15 $v = &find_config("proxy_auth", $conf);
16 $authfile = $v->{'values'}->[0];
17 $authdom = $v->{'values'}->[1];
18 print "<tr> <td><b>$text{'eauth_puf'}</b></td> <td>\n";
19 printf "<input type=radio name=authfile_def value=1 %s> $text{'eauth_none'} \n",
20 $authfile ? "" : "checked";
21 printf "<input type=radio name=authfile_def value=0 %s>\n",
22 $authfile ? "checked" : "";
23 printf "<input name=authfile size=30 value=\"%s\">\n",
24 $authfile ? $authfile : "";
25 print &file_chooser_button("authfile"),"</td> </tr>\n";
28 print "<td><b>$text{'eauth_nologin'}</b></td> <td>\n";
29 printf "<input type=radio name=authdom_def value=1 %s> $text{'eauth_none'} \n",
30 $authdom ? "" : "checked";
31 printf "<input type=radio name=authdom_def value=0 %s>\n",
32 $authdom ? "checked" : "";
33 printf "<input name=authdom size=20 value=\"%s\"></td>\n",
34 $authdom ? $authdom : "";
37 print "</table></td></tr></table>\n";
38 print "<input type=submit value=$text{'eauth_buttsave'}></form>\n";
42 print $text{'eauth_msgaccess'};
44 @users = &list_auth_users($authfile);
46 print "<a href=\"edit_user.cgi?new=1\">$text{'eauth_addpuser'}</a><br>\n";
47 print "<table border width=100%>\n";
48 print "<tr $tb> <td><b>$text{'eauth_pusers'}</b></td> </tr>\n";
49 print "<tr $cb> <td><table width=100%>\n";
50 for($i=0; $i<@users; $i++) {
51 print "<tr>\n" if ($i%4 == 0);
52 print "<td width=25%><a href=\"edit_user.cgi?",
53 "index=$i\">$users[$i]->{'user'}</a></td>\n";
54 print "</tr>\n" if ($i%4 == 3);
56 while($i++%4) { print "<td width=25%></td>\n"; }
57 print "</table></td></tr></table>\n";
60 print "<b>$text{'eauth_nopusers'}</b> <p>\n";
62 print "<a href=\"edit_user.cgi?new=1\">$text{'eauth_addpuser'}</a><p>\n";
65 &ui_print_footer("", $text{'eauth_return'});