From a6ca3c69680825b70d087fb8a1a00372b779b216 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Wed, 13 Mar 2013 19:26:15 -0400
Subject: [PATCH] - Fixed FS#2760 - Redirect on SSL enabled host redirects to http://.

---
 server/plugins-available/nginx_plugin.inc.php |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index 73fc849..d6ec88e 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -466,10 +466,10 @@
 				exec('chown --recursive --from='.escapeshellcmd($data['old']['system_user']).':'.escapeshellcmd($data['old']['system_group']).' '.escapeshellcmd($data['new']['system_user']).':'.escapeshellcmd($data['new']['system_group']).' '.$new_dir);
 
 				//* Change the home directory and group of the website user
-				$command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' && usermod';
+				$command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' ; usermod';
 				$command .= ' --home '.escapeshellcmd($data['new']['document_root']);
 				$command .= ' --gid '.escapeshellcmd($data['new']['system_group']);
-				$command .= ' '.escapeshellcmd($data['new']['system_user']);
+				$command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
 				exec($command);
 			}
 
@@ -705,7 +705,7 @@
 				if($web_config['add_web_users_to_sshusers_group'] == 'y') {
 					$command = 'usermod';
 					$command .= ' --groups sshusers';
-					$command .= ' '.escapeshellcmd($data['new']['system_user']);
+					$command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
 					$this->_exec($command);
 				}
 
@@ -1666,8 +1666,6 @@
 						}
 					}
 				}
-				
-
 			}
 			if(is_array($subdomain_hosts) && !empty($subdomain_hosts)){
 				$log_folders = array();
@@ -1686,10 +1684,12 @@
 		if($data['old']['type'] == 'vhost' || $data['old']['type'] == 'vhostsubdomain'){
 			if(is_array($log_folders) && !empty($log_folders)){
 				foreach($log_folders as $log_folder){
-					if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+					//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+					exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
 				}
 			} else {
-				if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+				//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+				exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
 			}
 		}
 		
@@ -1869,10 +1869,10 @@
             $vhost_logfile_dir = escapeshellcmd('/var/log/ispconfig/httpd/'.$data['old']['domain']);
             if($data['old']['domain'] != '' && !stristr($vhost_logfile_dir,'..')) exec('rm -rf '.$vhost_logfile_dir);
             $app->log('Removing website logfile directory: '.$vhost_logfile_dir,LOGLEVEL_DEBUG);
-            
+
             if($data['old']['type'] == 'vhost') {
                 //delete the web user
-                $command = 'killall -u '.escapeshellcmd($data['old']['system_user']).' && userdel';
+                $command = 'killall -u '.escapeshellcmd($data['old']['system_user']).' ; userdel';
                 $command .= ' '.escapeshellcmd($data['old']['system_user']);
                 exec($command);
                 if($nginx_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' '.$command);

--
Gitblit v1.9.1