From db5aa62b7faa2685f29215d4d08e13d28fd481a1 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 15 Dec 2008 04:22:20 -0500
Subject: [PATCH] - Added a global system settings storage in ini format. - Updated the user and database prefixes to use this storage.

---
 interface/web/mail/mail_get_edit.php |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/interface/web/mail/mail_get_edit.php b/interface/web/mail/mail_get_edit.php
index c17ae06..ec9aeb9 100644
--- a/interface/web/mail/mail_get_edit.php
+++ b/interface/web/mail/mail_get_edit.php
@@ -92,13 +92,21 @@
 		} // end if user is not admin
 		
 		// Set the server ID according to the selected destination
-		$tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE email = '".addslashes($this->dataRecord["destination"])."'");
+		$tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["destination"])."'");
 		$this->dataRecord["server_id"] = $tmp["server_id"];
 		unset($tmp);
 		
 		parent::onSubmit();
 	}
 	
+	function onAfterInsert() {
+		global $app;
+		
+		$tmp = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["destination"])."'");
+		$app->db->query("update mail_get SET sys_groupid = ".$tmp['sys_groupid']." WHERE mailget_id = ".$this->id);
+		
+	}
+	
 }
 
 $page = new page_action;

--
Gitblit v1.9.1