From cf646e99be232c783dcbae86e329470674772749 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 23 Jan 2014 03:50:27 -0500
Subject: [PATCH] Merge remote-tracking branch 'origin/stable-3.0.5'
---
interface/lib/classes/client_templates.inc.php | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/interface/lib/classes/client_templates.inc.php b/interface/lib/classes/client_templates.inc.php
index bdf9b16..64beb9e 100644
--- a/interface/lib/classes/client_templates.inc.php
+++ b/interface/lib/classes/client_templates.inc.php
@@ -106,9 +106,10 @@
/*
* Get the master-template for the client
*/
- $sql = "SELECT template_master, template_additional FROM client WHERE client_id = " . $app->functions->intval($clientId);
+ $sql = "SELECT template_master, template_additional,limit_client FROM client WHERE client_id = " . $app->functions->intval($clientId);
$record = $app->db->queryOneRecord($sql);
$masterTemplateId = $record['template_master'];
+ $is_reseller = ($record['limit_client'] > 0)?true:false;
if($record['template_additional'] != '') {
// we have to call the update_client_templates function
@@ -222,6 +223,7 @@
* Write all back to the database
*/
$update = '';
+ if(!$is_reseller) unset($limits['limit_client']); // Only Resellers may have limit_client set in template to ensure that we do not convert a client to reseller accidently.
foreach($limits as $k => $v){
if ((strpos($k, 'limit') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){
if ($update != '') $update .= ', ';
--
Gitblit v1.9.1