From f4f981d8f98e4f74a8d69d05a31ab63e188ea808 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 15 Nov 2015 08:00:17 -0500
Subject: [PATCH] Added missing delimiter settings in reseller form file.

---
 interface/web/vm/openvz_template_edit.php |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/interface/web/vm/openvz_template_edit.php b/interface/web/vm/openvz_template_edit.php
index ec520d0..097e55b 100644
--- a/interface/web/vm/openvz_template_edit.php
+++ b/interface/web/vm/openvz_template_edit.php
@@ -54,10 +54,7 @@
 	function onAfterInsert() {
 		global $app, $conf;
 
-		$guar_ram = $app->functions->intval($this->dataRecord['ram']*256);
-		$burst_ram = $app->functions->intval($this->dataRecord['ram_burst']*256);
-		$sql = "UPDATE openvz_template SET shmpages = '$guar_ram:$guar_ram',vmguarpages = '$guar_ram:$guar_ram', oomguarpages = '$guar_ram:$guar_ram',privvmpages = '$burst_ram:$burst_ram' WHERE template_id = $this->id";
-		$app->db->query($sql);
+		$this->onAfterUpdate();
 	}
 
 	function onAfterUpdate() {
@@ -65,8 +62,8 @@
 
 		$guar_ram = $app->functions->intval($this->dataRecord['ram']*256);
 		$burst_ram = $app->functions->intval($this->dataRecord['ram_burst']*256);
-		$sql = "UPDATE openvz_template SET shmpages = '$guar_ram:$guar_ram',vmguarpages = '$guar_ram:$guar_ram', oomguarpages = '$guar_ram:$guar_ram',privvmpages = '$burst_ram:$burst_ram' WHERE template_id = $this->id";
-		$app->db->query($sql);
+		$sql = "UPDATE openvz_template SET shmpages = ?,vmguarpages = ?, oomguarpages = ?,privvmpages = ? WHERE template_id = ?";
+		$app->db->query($sql, $guar_ram . ':' . $guar_ram, $guar_ram . ':' . $guar_ram, $guar_ram . ':' . $guar_ram, $burst_ram . ':' . $burst_ram, $this->id);
 	}
 
 }

--
Gitblit v1.9.1