aboutsummaryrefslogtreecommitdiffstats
path: root/config/vhosts
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-12-22 03:28:20 -0700
committermcrane <mctch@yahoo.com>2009-12-22 03:28:20 -0700
commit60145048a3f9fc1aaf983a9bec4637896763298e (patch)
tree3638bb8170ece53744f8cdf27264dbc790ab0c9c /config/vhosts
parentd6f2b1fc2e4584871bdd065ce5082cb1c8fbfc63 (diff)
downloadpfsense-packages-60145048a3f9fc1aaf983a9bec4637896763298e.tar.gz
pfsense-packages-60145048a3f9fc1aaf983a9bec4637896763298e.tar.bz2
pfsense-packages-60145048a3f9fc1aaf983a9bec4637896763298e.zip
vHosts package improve wording and fix ssl service uninstall and ssl related file removal when the ssl host is deleted.
Diffstat (limited to 'config/vhosts')
-rw-r--r--config/vhosts/vhosts.xml2
-rw-r--r--config/vhosts/vhosts_php.tmp43
-rw-r--r--config/vhosts/vhosts_php_edit.tmp45
3 files changed, 45 insertions, 45 deletions
diff --git a/config/vhosts/vhosts.xml b/config/vhosts/vhosts.xml
index d26a3cca..0b9cd769 100644
--- a/config/vhosts/vhosts.xml
+++ b/config/vhosts/vhosts.xml
@@ -41,7 +41,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>vHosts Settings</name>
- <version>0.5.1</version>
+ <version>0.6</version>
<title>Settings</title>
<include_file>/usr/local/pkg/vhosts.inc</include_file>
<menu>
diff --git a/config/vhosts/vhosts_php.tmp b/config/vhosts/vhosts_php.tmp
index 30fc09de..4b13383e 100644
--- a/config/vhosts/vhosts_php.tmp
+++ b/config/vhosts/vhosts_php.tmp
@@ -31,48 +31,7 @@ require("guiconfig.inc");
require("/usr/local/pkg/vhosts.inc");
$a_vhosts = &$config['installedpackages']['vhosts']['config'];
-$a_service = $config['installedpackages']['service'];
-
-if ($_GET['act'] == "del") {
- if ($_GET['type'] == 'php') {
- if ($a_vhosts[$_GET['id']]) {
- //get vhost info
- $x = 0;
- foreach($a_vhosts as $rowhelper) {
- if ($_GET['id'] == $x) {
- print_r ($rowhelper); exit;
- $id = $x; //return the id
- $host = $rowhelper['host'];
- $ipaddress = $rowhelper['ipaddress'];
- $port = $rowhelper['port'];
- $directory = $rowhelper['directory'];
- if (strlen($certificate) > 0) {
- $ssl = true;
- }
- else {
- $ssl = false;
- }
- }
- $x++;
- }
- //delete vhosts entry
- unset($a_vhosts[$_GET['id']]);
-
- //delete the SSL service
- if ($ssl) {
- unlink_if_exists("/var/etc/lighty-vhosts-".$ipaddress."-".$port."-ssl.conf");
- 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)) {
- unset($a_service[$service_id]);
- }
- }
- write_config();
- header("Location: vhosts_php.php");
- exit;
- }
- }
-}
+
include("head.inc");
diff --git a/config/vhosts/vhosts_php_edit.tmp b/config/vhosts/vhosts_php_edit.tmp
index 5fff46c8..d9635a94 100644
--- a/config/vhosts/vhosts_php_edit.tmp
+++ b/config/vhosts/vhosts_php_edit.tmp
@@ -38,12 +38,53 @@ if (isset($_POST['id'])) {
$id = $_POST['id'];
}
+$a_vhosts = &$config['installedpackages']['vhosts']['config'];
+$a_service = $config['installedpackages']['service'];
+
if ($_GET['act'] == "del") {
if ($_GET['type'] == 'php') {
if ($a_vhosts[$_GET['id']]) {
- unset($a_vhosts[$_GET['id']]);
+ //get vhost info
+ $x = 0;
+ $y = 0;
+ foreach($a_vhosts as $rowhelper) {
+ if (strlen($rowhelper['certificate']) > 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();
- php_sync_package();
header("Location: vhosts_php.php");
exit;
}