From 5ca959fa688255a8de61f89fe2751eb4d24a6912 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Tue, 22 Mar 2016 09:22:07 -0400
Subject: [PATCH] fixed typo

---
 server/plugins-available/openvz_plugin.inc.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/server/plugins-available/openvz_plugin.inc.php b/server/plugins-available/openvz_plugin.inc.php
index a50c3de..5cc4bf6 100644
--- a/server/plugins-available/openvz_plugin.inc.php
+++ b/server/plugins-available/openvz_plugin.inc.php
@@ -85,7 +85,7 @@
 			return;
 		}
 
-		$tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ".$data['new']['ostemplate_id']);
+		$tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ?", $data['new']['ostemplate_id']);
 		$ostemplate = escapeshellcmd($tmp['template_file']);
 		unset($tmp);
 
@@ -121,6 +121,11 @@
 		file_put_contents('/etc/vz/conf/'.$veid.'.conf', $data['new']['config']);
 		$app->log("Writing new configuration for $veid", LOGLEVEL_DEBUG);
 
+		//* new diskspace for ploop-containers requieres "vzctl set"
+		if($data['new']['diskspace'] != $data['old']['diskspace']) {
+			exec("vzctl set ".$veid." --diskspace ".$data['new']['diskspace']."G --save");
+		}
+
 		//* Apply config changes to the VM
 		if($data['new']['active'] == 'y' && $data['old']['active'] == 'y') {
 			exec("vzctl restart $veid");

--
Gitblit v1.9.1