Handle hostnames with upper-case letters
[webmin.git] / pap / edit_dialin.cgi
1 #!/usr/local/bin/perl
2 # edit_dialin.cgi
3 # Display a caller-ID number for editing
4
5 require './pap-lib.pl';
6 $access{'dialin'} || &error($text{'dialin_ecannot'});
7 &ReadParse();
8
9 if ($in{'new'}) {
10         &ui_print_header(undef, $text{'dialin_create'}, "");
11         }
12 else {
13         &ui_print_header(undef, $text{'dialin_edit'}, "");
14         @dialin = &parse_dialin_config();
15         $dialin = $dialin[$in{'idx'}];
16         }
17
18 print "<form action=save_dialin.cgi>\n";
19 print "<input type=hidden name=idx value='$in{'idx'}'>\n";
20 print "<input type=hidden name=new value='$in{'new'}'>\n";
21 print "<table border>\n";
22 print "<tr $tb> <td><b>$text{'dialin_header'}</b></td> </tr>\n";
23 print "<tr $cb> <td><table>\n";
24
25 $mode = $dialin->{'number'} eq 'all' ? 0 :
26         $dialin->{'number'} eq 'none' ? 1 : 2;
27 print "<tr> <td valign=top><b>$text{'dialin_number'}</b></td>\n";
28 printf "<td><input type=radio name=mode value=0 %s> %s<br>\n",
29         $mode == 0 ? "checked" : "", $text{'dialin_all'};
30 printf "<input type=radio name=mode value=1 %s> %s<br>\n",
31         $mode == 1 ? "checked" : "", $text{'dialin_none'};
32 printf "<input type=radio name=mode value=2 %s> %s\n",
33         $mode == 2 ? "checked" : "", $text{'dialin_match'};
34 printf "<input name=number size=15 value='%s'></td>\n",
35         $mode == 2 ? $dialin->{'number'} : undef;
36
37 print "<td valign=top><b>$text{'dialin_ad'}</b></td>\n";
38 printf "<td valign=top><input type=radio name=allow value=1 %s> %s\n",
39         $dialin->{'not'} ? "" : "checked", $text{'dialin_allow'};
40 printf "<input type=radio name=allow value=0 %s> %s</td> </tr>\n",
41         $dialin->{'not'} ? "checked" : "", $text{'dialin_deny'};
42
43 print "</table></td></tr></table>\n";
44 if ($in{'new'}) {
45         print "<input type=submit value='$text{'create'}'>\n";
46         }
47 else {
48         print "<input type=submit value='$text{'save'}'>\n";
49         print "<input type=submit name=delete value='$text{'delete'}'>\n";
50         }
51 print "</form>\n";
52
53 &ui_print_footer("list_dialin.cgi", $text{'dialin_return'});
54