From a5fe2742b8e90e7bb2ee4a3a9df3ea64afd6eaff Mon Sep 17 00:00:00 2001 From: xaver <xaver@ispconfig3> Date: Fri, 09 Sep 2011 14:09:31 -0400 Subject: [PATCH] Fixed #1390 - Added 3ware controller (was my script i use 3ware) --- interface/web/client/tools.inc.php | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/interface/web/client/tools.inc.php b/interface/web/client/tools.inc.php index 9cbf8eb..a6cd525 100644 --- a/interface/web/client/tools.inc.php +++ b/interface/web/client/tools.inc.php @@ -28,7 +28,7 @@ */ function applyClientTemplates($clientId){ - global $app; + global $app,$page; /* * Get the master-template for the client */ @@ -44,7 +44,7 @@ $sql = "SELECT * FROM client_template WHERE template_id = " . intval($masterTemplateId); $limits = $app->db->queryOneRecord($sql); } else { - $limits = $this->dataRecord; + $limits = $page->dataRecord; } /* @@ -59,12 +59,17 @@ /* maybe the template is deleted in the meantime */ if (is_array($addLimits)){ foreach($addLimits as $k => $v){ - if ($limits[$k] > -1){ - if ($v == -1) { - $limits[$k] = -1; - } - else { - $limits[$k] += $v; + if($k == 'limit_cron_type') { + $limits[$k] = $v; + } elseif($k == 'limit_cron_frequency') { + if($v < $limits[$k]) $limits[$k] = $v; + } else { + if ($limits[$k] > -1){ + if ($v == -1) { + $limits[$k] = -1; + } else { + $limits[$k] += $v; + } } } } @@ -77,7 +82,7 @@ */ $update = ''; foreach($limits as $k => $v){ - if (strpos($k, 'limit') !== false){ + if (strpos($k, 'limit') !== false && !is_array($v)){ if ($update != '') $update .= ', '; $update .= '`' . $k . "`='" . $v . "'"; } -- Gitblit v1.9.1