|
0) { $pconfig['certificate'] = base64_decode($a_vhosts[$id]['certificate']); } if (strlen($a_vhosts[$id]['privatekey']) > 0) { $pconfig['privatekey'] = base64_decode($a_vhosts[$id]['privatekey']); } $pconfig['enabled'] = $a_vhosts[$id]['enabled']; $pconfig['description'] = $a_vhosts[$id]['description']; } if ($_POST) { unset($input_errors); $pconfig = $_POST; if (!$input_errors) { $ent = array(); $ent['host'] = $_POST['host']; $ent['ipaddress'] = $_POST['ipaddress']; $ent['port'] = $_POST['port']; $ent['directory'] = $_POST['directory']; if (strlen($_POST['certificate']) > 0) { $ent['certificate'] = base64_encode($_POST['certificate']); } else { $ent['certificate'] = ''; } if (strlen($_POST['privatekey']) > 0) { $ent['privatekey'] = base64_encode($_POST['privatekey']); } else { $ent['privatekey'] = ''; } $ent['enabled'] = $_POST['enabled']; $ent['description'] = $_POST['description']; if (isset($id) && $a_vhosts[$id]) { //update $a_vhosts[$id] = $ent; } else { //add $a_vhosts[] = $ent; } write_config(); php_sync_package(); header("Location: vhosts_php.php"); exit; } } include("head.inc"); ?>
vHosts: Edit
|