Handle hostnames with upper-case letters
[webmin.git] / jabber / edit_filter.cgi
1 #!/usr/local/bin/perl
2 # edit_filter.cgi
3 # Display allowed user filter options
4
5 require './jabber-lib.pl';
6 &ui_print_header(undef, $text{'filter_title'}, "", "filter");
7
8 $conf = &get_jabber_config();
9 $session = &find_by_tag("service", "id", "sessions", $conf);
10 $jsm = &find("jsm", $session);
11 $filter = &find("filter", $jsm);
12
13 print "<form action=save_filter.cgi>\n";
14 print "<table border width=100%>\n";
15 print "<tr $tb> <td><b>$text{'filter_header'}</b></td> </tr>\n";
16 print "<tr $cb> <td><table width=100%>\n";
17
18 print "<tr> <td><b>$text{'filter_max'}</b></td>\n";
19 printf "<td><input name=max size=6 value='%s'></td> </tr>\n",
20         &find_value("max_size", $filter);
21
22 $allow = &find("allow", $filter);
23
24 $conds = &find("conditions", $allow);
25 print "<tr> <td valign=top><b>$text{'filter_conds'}</b></td> <td>\n";
26 foreach $c (@filter_conds) {
27         $cx = &find($c, $conds);
28         printf "<input type=checkbox name=%s value=1 %s> %s\n",
29                 "cond_$c", $cx ? "checked" : "", $c;
30         }
31 print "</td> </tr>\n";
32
33 $acts = &find("actions", $allow);
34 print "<tr> <td valign=top><b>$text{'filter_acts'}</b></td> <td>\n";
35 foreach $c (@filter_acts) {
36         $cx = &find($c, $acts);
37         printf "<input type=checkbox name=%s value=1 %s> %s\n",
38                 "act_$c", $cx ? "checked" : "", $c;
39         }
40 print "</td> </tr>\n";
41
42 print "</table></td></tr></table>\n";
43 print "<input type=submit value='$text{'save'}'></form>\n";
44
45 &ui_print_footer("", $text{'index_return'});
46