From a204303e5099dcb88e5e4760a09e7de9a96c4ea3 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Fri, 17 Oct 2014 08:05:51 -0400
Subject: [PATCH] moved "function send_notification_email" from 300-quota_notify.inc.php to monitor_tools.inc.php

---
 interface/web/sites/shell_user_edit.php |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php
index 24ef093..f0c8c36 100644
--- a/interface/web/sites/shell_user_edit.php
+++ b/interface/web/sites/shell_user_edit.php
@@ -82,7 +82,11 @@
 			$app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $shelluser_prefix));
 		}
 
-		$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $shelluser_prefix, $global_config['shelluser_prefix']));
+		if($this->dataRecord['username'] == "") {
+			$app->tpl->setVar("username_prefix", $shelluser_prefix);
+		} else {
+			$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $shelluser_prefix, $global_config['shelluser_prefix']));
+		}
 
 		if($this->id > 0) {
 			//* we are editing a existing record
@@ -158,15 +162,16 @@
 		global $app, $conf;
 
 		$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->dataRecord["parent_domain_id"]));
-		$server_id = $web["server_id"];
-		$dir = $web["document_root"];
-		$puser = $web["system_user"];
-		$pgroup = $web["system_group"];
+
+		$server_id = $app->functions->intval($web["server_id"]);
+		$dir = $app->db->quote($web["document_root"]);
+		$uid = $app->db->quote($web["system_user"]);
+		$gid = $app->db->quote($web["system_group"]);
 
 		// The FTP user shall be owned by the same group then the website
-		$sys_groupid = $web['sys_groupid'];
+		$sys_groupid = $app->functions->intval($web['sys_groupid']);
 
-		$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$puser', pgroup = '$pgroup', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id;
+		$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$uid', pgroup = '$gid', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id;
 		$app->db->query($sql);
 
 	}

--
Gitblit v1.9.1