<?php
require_once('inc/debug.php');
require_once('inc/security.php');
require_once('inc/javascript.php');
javascript();
require_once('vhosts.php');
require_once('certs.php');
$section = 'vhosts_vhosts';
require_role(ROLE_SYSTEMUSER);
$id = (isset($_GET['vhost']) ? (int) $_GET['vhost'] : 0);
$vhost = empty_vhost();
if ($id != 0) {
$vhost = get_vhost_details($id);
}
$have_v6 = false;
$server = ($vhost['server'] ?? $_SESSION['userinfo']['server']);
if (ipv6_possible($server)) {
$have_v6 = true;
}
DEBUG($vhost);
if ($id == 0) {
title("Neue Website anlegen");
} else {
title("Website bearbeiten");
}
$defaultdocroot = $vhost['domain'];
if (!$vhost['domain']) {
$defaultdocroot = $_SESSION['userinfo']['username'] . '.' . config('masterdomain');
}
if ($vhost['domain_id'] == -1) {
$defaultdocroot = $_SESSION['userinfo']['username'] . '.' . config('user_vhosts_domain');