<?php
require_once('inc/debug.php');
require_once('inc/security.php');
require_once('vhosts.php');
$title = "Subdomain bearbeiten";
$section = 'vhosts_vhosts';
require_role(ROLE_SYSTEMUSER);
$id = (int) $_GET['vhost'];
$vhost = empty_vhost();
if ($id != 0)
$vhost = get_vhost_details($id);
DEBUG($vhost);
if ($id == 0) {
output("<h3>Neue Subdomain anlegen</h3>");
$title = "Subdomain anlegen";
}
else {
output("<h3>Subdomain bearbeiten</h3>");
}
html_header("<script type=\"text/javascript\">
function selectedDomain() {
var selected;
selected=document.getElementById('domain').options.selectedIndex;
return document.getElementById('domain').options.item(selected).text;
}
function defaultDocumentRoot() {
var hostname;
if (document.getElementById('hostname').value == '')
hostname = selectedDomain();
else
hostname = document.getElementById('hostname').value + '.' + selectedDomain();
var default_docroot = hostname + '/htdocs';
useDefaultDocroot(default_docroot);
}
function useDefaultDocroot( default_docroot ) {
var do_it = (document.getElementById('use_default_docroot').checked == true);
var inputfield = document.getElementById('docroot');
inputfield.disabled = do_it;
if (do_it) {
document.getElementById('docroot').value = default_docroot;