3 # Display a menu for some specific virtual server, or the default server
5 require './proftpd-lib.pl';
7 ($conf, $v) = &get_virtual_config($in{'virt'});
8 $desc = $in{'virt'} eq '' ? $text{'virt_header2'} :
9 &text('virt_header1', $v->{'value'});
10 &ui_print_header($desc, $text{'virt_title'}, "",
11 undef, undef, undef, undef, &restart_button());
13 # Display header and icons
14 print "<h3>$text{'virt_opts'}</h3>\n";
15 $anon_icon = { "icon" => "images/anon.gif",
16 "name" => $text{'virt_anon'},
17 "link" => "anon_index.cgi?virt=$in{'virt'}" };
18 $virt_icon = { "icon" => "images/virt.gif",
19 "name" => $text{'virt_virt'},
20 "link" => "edit_vserv.cgi?virt=$in{'virt'}" };
21 $ed_icon = { "icon" => "images/edit.gif",
22 "name" => $text{'virt_edit'},
23 "link" => "manual_form.cgi?virt=$in{'virt'}" };
24 &config_icons("virtual", "edit_virt.cgi?virt=$in{'virt'}&",
25 $anon_icon, $in{'virt'} ? ( $virt_icon, $ed_icon ) : ( ) );
27 # Display per-directory/limit options
28 @dir = ( &find_directive_struct("Directory", $conf) ,
29 &find_directive_struct("Limit", $conf) );
32 print "<h3>$text{'virt_header'}</h3>\n";
34 if ($d->{'name'} eq 'Limit') {
35 push(@links, "limit_index.cgi?limit=".
36 &indexof($d, @$conf)."&virt=$in{'virt'}");
37 push(@titles, &text('virt_limit', $d->{'value'}));
38 push(@icons, "images/limit.gif");
41 push(@links, "dir_index.cgi?idx=".
42 &indexof($d, @$conf)."&virt=$in{'virt'}");
43 push(@titles, &text('virt_dir', $d->{'value'}));
44 push(@icons, "images/dir.gif");
47 &icons_table(\@links, \@titles, \@icons, 3);
50 print "<table width=100%><tr><td>\n";
52 print "<form action=create_dir.cgi>\n";
53 print "<input type=hidden name=virt value='$in{'virt'}'>\n";
54 print "<table border>\n";
55 print "<tr $tb> <td><b>$text{'virt_adddir'}</b></td> </tr>\n";
56 print "<tr $cb> <td><table>\n";
57 print "<tr> <td><b>$text{'virt_path'}</b></td>\n";
58 print "<td><input name=dir size=30>\n";
59 print "<input type=submit value=\"$text{'create'}\"></td> </tr>\n";
60 print "</table></td></tr></table></form>\n";
64 print "<form action=create_limit.cgi>\n";
65 print "<input type=hidden name=virt value='$in{'virt'}'>\n";
66 print "<table border>\n";
67 print "<tr $tb> <td><b>$text{'virt_addlimit'}</b></td> </tr>\n";
68 print "<tr $cb> <td><table>\n";
69 print "<tr> <td><b>$text{'virt_cmds'}</b></td>\n";
70 print "<td><input name=cmd size=20>\n";
71 print "<input type=submit value=\"$text{'create'}\"></td> </tr>\n";
72 print "</table></td></tr></table></form>\n";
74 print "</td></tr></table>\n";
76 &ui_print_footer("", $text{'index_return'});