From b283598a07dfdd4e54f01f514b1bf8ae891b3a1d Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Thu, 21 Nov 2013 05:03:47 -0500
Subject: [PATCH] interface/web/dns/dns_wizard.php
---
interface/web/vm/openvz_template_edit.php | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/interface/web/vm/openvz_template_edit.php b/interface/web/vm/openvz_template_edit.php
index 2c1247a..73d004e 100644
--- a/interface/web/vm/openvz_template_edit.php
+++ b/interface/web/vm/openvz_template_edit.php
@@ -38,39 +38,40 @@
* End Form configuration
******************************************/
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
+require_once '../../lib/config.inc.php';
+require_once '../../lib/app.inc.php';
//* Check permissions for module
$app->auth->check_module_permissions('vm');
+if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
// Loading classes
$app->uses('tpl,tform');
$app->load('tform_actions');
class page_action extends tform_actions {
-
+
function onAfterInsert() {
- global $app,$conf;
-
+ global $app, $conf;
+
$guar_ram = $this->dataRecord['ram']*256;
$burst_ram = $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);
}
-
+
function onAfterUpdate() {
- global $app,$conf;
-
+ global $app, $conf;
+
$guar_ram = $this->dataRecord['ram']*256;
$burst_ram = $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);
}
-
+
}
$page = new page_action;
$page->onLoad();
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1