Handle hostnames with upper-case letters
[webmin.git] / proftpd / edit_dserv.cgi
1 #!/usr/local/bin/perl
2 # edit_dserv.cgi
3 # Edit <Directory> section details
4
5 require './proftpd-lib.pl';
6 &ReadParse();
7 if ($in{'global'}) {
8         $conf = &get_config();
9         $conf = &get_or_create_global($conf);
10         }
11 else {
12         ($conf, $v) = &get_virtual_config($in{'virt'});
13         }
14 if ($in{'anon'}) {
15         $anon = &find_directive_struct("Anonymous", $conf);
16         $conf = $anon->{'members'};
17         }
18 $d = $conf->[$in{'idx'}];
19 $dn = $d->{'words'}->[0];
20 $dconf = $d->{'members'};
21 $desc = $in{'global'} ? &text('dir_header5', $dn) :
22         $in{'anon'} ? &text('dir_header4', $dn) :
23         $in{'virt'} ?  &text('dir_header1', $dn, $v->{'words'}->[0]) :
24         &text('dir_header2', $dn);
25 &ui_print_header($desc, $text{'dserv_title'}, "",
26         undef, undef, undef, undef, &restart_button());
27
28 print "<form action=save_dserv.cgi>\n";
29 print "<input type=hidden name=virt value='$in{'virt'}'>\n";
30 print "<input type=hidden name=idx value='$in{'idx'}'>\n";
31 print "<input type=hidden name=anon value='$in{'anon'}'>\n";
32 print "<input type=hidden name=global value='$in{'global'}'>\n";
33 print "<table border>\n";
34 print "<tr $tb> <td><b>$text{'dserv_title'}</b></td> </tr>\n";
35 print "<tr $cb> <td><table>\n";
36
37 print "<tr> <td><b>$text{'dserv_dir'}</b></td>\n";
38 printf "<td><input name=dir size=40 value='%s'> %s</td> </tr>\n",
39         $d->{'value'}, &file_chooser_button("dir", 1);
40
41 print "<tr> <td colspan=2 align=right>\n";
42 print "<input type=submit value=\"$text{'save'}\">\n";
43 print "<input type=submit name=delete value=\"$text{'dserv_delete'}\">\n";
44 print "</td> </tr>\n";
45
46 print "</table> </td></tr></table><p>\n";
47 print "</form>\n";
48
49 if ($in{'global'}) {
50         &ui_print_footer("dir_index.cgi?global=$in{'global'}&idx=$in{'idx'}",
51                 $text{'dir_return'},
52                 "", $text{'index_return'});
53         }
54 elsif ($in{'anon'}) {
55         &ui_print_footer("dir_index.cgi?virt=$in{'virt'}&idx=$in{'idx'}&anon=$in{anon}",
56                 $text{'dir_return'},
57                 "anon_index.cgi?virt=$in{'virt'}", $text{'anon_return'},
58                 "virt_index.cgi?virt=$in{'virt'}", $text{'virt_return'},
59                 "", $text{'index_return'});
60         }
61 else {
62         &ui_print_footer("dir_index.cgi?virt=$in{'virt'}&idx=$in{'idx'}",
63                 $text{'dir_return'},
64                 "virt_index.cgi?virt=$in{'virt'}", $text{'virt_return'},
65                 "", $text{'index_return'});
66         }
67