From d667e30904af386a0ce78fcb35039ce313f8deae Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 12 Aug 2015 21:10:24 +0200 Subject: Rename vhosts_php_edit.tmp to vhosts_php_edit.php --- config/vhosts/vhosts_php_edit.php | 324 ++++++++++++++++++++++++++++++++++++++ config/vhosts/vhosts_php_edit.tmp | 324 -------------------------------------- 2 files changed, 324 insertions(+), 324 deletions(-) create mode 100644 config/vhosts/vhosts_php_edit.php delete mode 100644 config/vhosts/vhosts_php_edit.tmp (limited to 'config') diff --git a/config/vhosts/vhosts_php_edit.php b/config/vhosts/vhosts_php_edit.php new file mode 100644 index 00000000..8760686e --- /dev/null +++ b/config/vhosts/vhosts_php_edit.php @@ -0,0 +1,324 @@ + 0) { + $y++; + } + if ($_GET['id'] == $x) { + $id = $x; //return the id + $host = $rowhelper['host']; + $ipaddress = $rowhelper['ipaddress']; + $port = $rowhelper['port']; + $directory = $rowhelper['directory']; + if (strlen($rowhelper['certificate']) > 0) { + $ssl = true; + $ssl_id = $y; + } + else { + $ssl = false; + } + } + + $x++; + } + + //delete vhosts entry + unset($a_vhosts[$_GET['id']]); + + //delete the SSL files and service + if ($ssl) { + unlink_if_exists("/var/etc/lighty-vhosts-".$ipaddress."-".$port."-ssl.conf"); + unlink_if_exists("/var/etc/cert-vhosts-".$ipaddress."-".$port.".pem"); + unlink_if_exists("/usr/local/etc/rc.d/vhosts-".$ipaddress."-".$port."-ssl.sh"); + $service_id = get_service_id ($a_service, 'rcfile', "vhosts-".$ipaddress."-".$port."-ssl.sh"); + if (is_int($service_id)) { + exec("kill `cat /var/run/lighty-vhosts-".$ipaddress."-".$port."-ssl.pid`"); + unset($config['installedpackages']['service'][$service_id]); + } + } + + write_config(); + header("Location: vhosts_php.php"); + exit; + } + } +} + +if (isset($id) && $a_vhosts[$id]) { + $pconfig['host'] = $a_vhosts[$id]['host']; + $pconfig['ipaddress'] = $a_vhosts[$id]['ipaddress']; + $pconfig['port'] = $a_vhosts[$id]['port']; + $pconfig['directory'] = $a_vhosts[$id]['directory']; + if (strlen($a_vhosts[$id]['certificate']) > 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(); + vhosts_sync_package(); + + header("Location: vhosts_php.php"); + exit; + } +} + +include("head.inc"); + +?> + + + + + +

vHosts: Edit

+ + + +
+ + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Host + +
+ Required. If the host is intended for internal you can use the DNS forwarder to set a host name that is valid inside the local network. default: vhost01.local +
IP Address + +
+ Required. Make sure the IP and Port combination does not conflict with the local system. example: 192.168.0.1 +
Port + +
+ Make sure the IP and Port combination does not conflict with the local system. default: 8001 +
Directory + +
+ This vHosts directory is located in /usr/local/vhosts. The default directory is the host name. +
+ example: vhost01.local +
Certificate + +
+ Paste a signed certificate in X.509 PEM format here. Create certificates automatically. +
Key + +
+ Paste an RSA private key in PEM format here. +
Enabled + \n"; + echo " \n"; + switch (htmlspecialchars($pconfig['enabled'])) { + case "true": + echo " \n"; + echo " \n"; + break; + case "false": + echo " \n"; + echo " \n"; + break; + default: + echo " \n"; + echo " \n"; + } + echo " \n"; + ?> +
Description + +
Enter the description here.
+
  + + + + +
+
+ +
+
+
+
+
+
+ +
+ +
+ + + + diff --git a/config/vhosts/vhosts_php_edit.tmp b/config/vhosts/vhosts_php_edit.tmp deleted file mode 100644 index 8760686e..00000000 --- a/config/vhosts/vhosts_php_edit.tmp +++ /dev/null @@ -1,324 +0,0 @@ - 0) { - $y++; - } - if ($_GET['id'] == $x) { - $id = $x; //return the id - $host = $rowhelper['host']; - $ipaddress = $rowhelper['ipaddress']; - $port = $rowhelper['port']; - $directory = $rowhelper['directory']; - if (strlen($rowhelper['certificate']) > 0) { - $ssl = true; - $ssl_id = $y; - } - else { - $ssl = false; - } - } - - $x++; - } - - //delete vhosts entry - unset($a_vhosts[$_GET['id']]); - - //delete the SSL files and service - if ($ssl) { - unlink_if_exists("/var/etc/lighty-vhosts-".$ipaddress."-".$port."-ssl.conf"); - unlink_if_exists("/var/etc/cert-vhosts-".$ipaddress."-".$port.".pem"); - unlink_if_exists("/usr/local/etc/rc.d/vhosts-".$ipaddress."-".$port."-ssl.sh"); - $service_id = get_service_id ($a_service, 'rcfile', "vhosts-".$ipaddress."-".$port."-ssl.sh"); - if (is_int($service_id)) { - exec("kill `cat /var/run/lighty-vhosts-".$ipaddress."-".$port."-ssl.pid`"); - unset($config['installedpackages']['service'][$service_id]); - } - } - - write_config(); - header("Location: vhosts_php.php"); - exit; - } - } -} - -if (isset($id) && $a_vhosts[$id]) { - $pconfig['host'] = $a_vhosts[$id]['host']; - $pconfig['ipaddress'] = $a_vhosts[$id]['ipaddress']; - $pconfig['port'] = $a_vhosts[$id]['port']; - $pconfig['directory'] = $a_vhosts[$id]['directory']; - if (strlen($a_vhosts[$id]['certificate']) > 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(); - vhosts_sync_package(); - - header("Location: vhosts_php.php"); - exit; - } -} - -include("head.inc"); - -?> - - - - - -

vHosts: Edit

- - - -
- - -
- -
- - - - -
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Host - -
- Required. If the host is intended for internal you can use the DNS forwarder to set a host name that is valid inside the local network. default: vhost01.local -
IP Address - -
- Required. Make sure the IP and Port combination does not conflict with the local system. example: 192.168.0.1 -
Port - -
- Make sure the IP and Port combination does not conflict with the local system. default: 8001 -
Directory - -
- This vHosts directory is located in /usr/local/vhosts. The default directory is the host name. -
- example: vhost01.local -
Certificate - -
- Paste a signed certificate in X.509 PEM format here. Create certificates automatically. -
Key - -
- Paste an RSA private key in PEM format here. -
Enabled - \n"; - echo " \n"; - switch (htmlspecialchars($pconfig['enabled'])) { - case "true": - echo " \n"; - echo " \n"; - break; - case "false": - echo " \n"; - echo " \n"; - break; - default: - echo " \n"; - echo " \n"; - } - echo " \n"; - ?> -
Description - -
Enter the description here.
-
  - - - - -
-
- -
-
-
-
-
-
- -
- -
- - - - -- cgit v1.2.3