\n"; } # Show form to create a dir print &ui_form_start("create_dir.cgi", "post"); print &ui_hidden("virt", $in{'virt'}); print &ui_table_start($text{'virt_adddir'}, undef, 2); print &ui_table_row($text{'virt_type'}, &ui_select("type", undef, [ map { [ $_, $text{'virt_'.$_} ] } $httpd_modules{'core'} >= 2.0 ? ( "Directory", "Files", "Location", "Proxy" ) : $httpd_modules{'core'} >= 1.2 ? ( "Directory", "Files", "Location" ) : ( "Directory", "Location" ) ])); if ($httpd_modules{'core'} >= 1.2) { print &ui_table_row($text{'virt_regexp'}, &ui_radio("regexp", 0, [ [ 0, $text{'virt_exact'} ], [ 1, $text{'virt_re'} ] ])); } print &ui_table_row($text{'virt_path'}, &ui_textbox("path", undef, 50)); print &ui_table_end(); print &ui_form_end([ [ "", $text{'create'} ] ]); $d = &is_virtualmin_domain($v); if ($in{'virt'} && $access{'vaddr'} && !$d) { # Show form for changing virtual server print &ui_hr(); print &ui_form_start("save_vserv.cgi"); print &ui_hidden("virt", $in{'virt'}); print &ui_table_start($text{'virt_opts'}, undef, 2); $val = $v->{'value'}; if ($val =~ /\s/) { $addrs = $val; } if ($val =~ /^\[(\S+)\]:(\d+)$/) { # IPv6 address and port $addr = $1; $port = $2; } elsif ($val =~ /^\[(\S+)\]$/) { # IPv6 address $addr = $1; } elsif ($val =~ /^(\S+):(\d+)$/) { # IPv4 address or hostname and port $addr = $1; $port = $2; } else { # IPv4 address or hostname $addr = $val; } if ($addrs) { # Multiple addresses and ports print &ui_table_row($text{'vserv_addrs'}, &ui_textarea("addrs", join("\n", split(/\s+/, $addrs)), 4, 30)); } else { # Address and port print &ui_table_row($text{'vserv_addr'}, &ui_radio("addr_def", $addr eq "_default_" ? 1 : $addr eq "*" ? 2 : 0, [ [ 1, $text{'vserv_addr1'} ], [ 2, $text{'vserv_any'} ], [ 0, &ui_textbox("addr", $addr eq "*" || $addr eq "_default_" ? "" : $addr, 40) ] ])); print &ui_table_row($text{'vserv_port'}, &choice_input($port eq "*" ? 1 : $port > 0 ? 2 : 0, "port_mode", "0", "$text{'vserv_default'},0", "$text{'vserv_any'},1", ",2"). &ui_textbox("port", $port > 0 ? $port : "", 5)); } # Document directory $root = &find_directive_struct("DocumentRoot", $v->{'members'}); print &ui_table_row($text{'vserv_root'}, &opt_input($root->{'words'}->[0], "root", $text{'vserv_default'}, 50). &file_chooser_button("root", 1, 1)); print &ui_hidden("old_root", $root->{'words'}->[0]); # Server name $name = &find_directive("ServerName", $v->{'members'}); print &ui_table_row($text{'vserv_name'}, &opt_input($name, "name", $text{'vserv_default'}, 30)); print &ui_table_end(); print &ui_form_end([ [ undef, $text{'save'} ], [ "delete", $text{'delete'} ] ]); } elsif ($in{'virt'} && $access{'vaddr'} && $d) { print "",&text('vserv_virtualmin', $d->{'dom'}),"
\n"; } &ui_print_footer("", $text{'index_return'});