<?php
require_once('inc/security.php');
require_once('modules/vhosts/include/vhosts.php');
require_once('class/domain.php');
$url = '';
$docroot = '';
if ($_POST['target'] == 'new')
{
check_form_token('webapp_install');
$vhost = empty_vhost();
$hostname = filter_input_hostname($_POST['hostname']);
$domainid = (int) $_POST['domain'];
$domainname = NULL;
if ($domainid != -1) {
$domain = new Domain( (int) $_POST['domain'] );
$domain->ensure_userdomain();
$domainid = $domain->id;
$domainname = $domain->fqdn;
}
DEBUG('Domain: '.$domainid.' / '.$domainname);
if (! isset($_POST['options']) || ! is_array($_POST['options']))
$_POST['options'] = array();
$aliaswww = in_array('aliaswww', $_POST['options']);
$vhost['is_dav'] = 0;
$vhost['is_svn'] = 0;
$vhost['is_webapp'] = 0;
$ssl = '';
switch ($_POST['ssl']) {
case 'http':
$ssl = 'http';
break;
case 'https':
$ssl = 'https';
break;
case 'forward':
$ssl = 'forward';
break;
/* Wenn etwas anderes kommt, ist das "beides". So einfach ist das. */
}
$logtype = '';
switch ($_POST['logtype']) {