Handle hostnames with upper-case letters
[webmin.git] / squid / list_refresh.cgi
1 #!/usr/local/bin/perl
2 # list_refresh.cgi
3 # Display all refresh patterns
4
5 require './squid-lib.pl';
6 $access{'refresh'} || &error($text{'refresh_ecannot'});
7 &ui_print_header(undef, $text{'refresh_title'}, "", "list_refresh", 0, 0, 0, &restart_button());
8 $conf = &get_config();
9
10 @refresh = &find_config("refresh_pattern", $conf);
11 @links = ( &select_all_link("d"),
12            &select_invert_link("d"),
13            "<a href='edit_refresh.cgi?new=1'>$text{'refresh_add'}</a>" );
14 if (@refresh) {
15         print &ui_form_start("delete_refreshes.cgi", "post");
16         @tds = ( "width=5", undef, undef, undef, undef, "width=32" );
17         print &ui_links_row(\@links);
18         print &ui_columns_start([ "",
19                                   $text{'refresh_re'},
20                                   $text{'refresh_min'},
21                                   $text{'refresh_pc'},
22                                   $text{'refresh_max'},
23                                   $text{'eacl_move'} ], 100, 0, \@tds);
24         $hc = 0;
25         foreach $h (@refresh) {
26                 @v = @{$h->{'values'}};
27                 if ($v[0] eq "-i") {
28                         shift(@v);
29                         }
30                 local @cols;
31                 push(@cols, "<a href='edit_refresh.cgi?index=$h->{'index'}'>$v[0]</a>");
32                 push(@cols, @v[1..3]);
33                 local $mover;
34                 if ($hc != @refresh-1) {
35                         $mover .= "<a href=\"move_refresh.cgi?$hc+1\">".
36                                   "<img src=images/down.gif border=0></a>";
37                         }
38                 else {
39                         $mover .= "<img src=images/gap.gif>";
40                         }
41                 if ($hc != 0) {
42                         $mover .= "<a href=\"move_refresh.cgi?$hc+-1\">".
43                                   "<img src=images/up.gif border=0></a>";
44                         }
45                 else {
46                         $mover .= "<img src=images/gap.gif>";
47                         }
48                 push(@cols, $mover);
49                 print &ui_checked_columns_row(\@cols, \@tds, "d",$h->{'index'});
50                 $hc++;
51                 }
52         print &ui_columns_end();
53         print &ui_links_row(\@links);
54         print &ui_form_end([ [ "delete", $text{'refresh_delete'} ] ]);
55         }
56 else {
57         print "<p>$text{'refresh_none'}<p>\n";
58         print &ui_links_row([ $links[2] ]);
59         }
60
61 &ui_print_footer("", $text{'index_return'});
62