From 02f09e6d5bbfd0eceb6a57abb75de8293e32be20 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 18 Oct 2010 03:30:40 -0400
Subject: [PATCH] Fixed bug in german language file.

---
 interface/web/dashboard/dashlets/limits.php |   48 +++++++++++++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/interface/web/dashboard/dashlets/limits.php b/interface/web/dashboard/dashlets/limits.php
index 95e85fd..7a7c00f 100644
--- a/interface/web/dashboard/dashlets/limits.php
+++ b/interface/web/dashboard/dashlets/limits.php
@@ -67,7 +67,7 @@
 		
 		$limits[] = array('field' => 'limit_web_aliasdomain',
 						  'db_table' => 'web_domain',
-						  'db_where' => "type = 'aliasdomain'");
+						  'db_where' => "type = 'alias'");
 		
 		$limits[] = array('field' => 'limit_ftp_user',
 						  'db_table' => 'ftp_user',
@@ -79,6 +79,10 @@
 		
 		$limits[] = array('field' => 'limit_dns_zone',
 						  'db_table' => 'dns_soa',
+						  'db_where' => "");
+
+		$limits[] = array('field' => 'limit_dns_slave_zone',
+						  'db_table' => 'dns_slave',
 						  'db_where' => "");
 
 		$limits[] = array('field' => 'limit_dns_record',
@@ -106,34 +110,40 @@
 		$tpl = new tpl;
 		$tpl->newTemplate("dashlets/templates/limits.htm");
 		
+		$wb = array();
 		$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_limits.lng';
-		include($lng_file);
+		if(is_file($lng_file)) include($lng_file);
 		$tpl->setVar($wb);
 		
 		if($app->auth->is_admin()) {
-			$user_is_admin = 1;
+			$user_is_admin = true;
 		} else {
-			$user_is_admin = 0;
+			$user_is_admin = false;
 		}
 		$tpl->setVar('is_admin',$user_is_admin);
 		
-		if($user_is_admin == 0) {
+		if($user_is_admin == false) {
 			$client_group_id = $_SESSION["s"]["user"]["default_group"];
 			$client = $app->db->queryOneRecord("SELECT * FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			$rows = array();
-			foreach($limits as $limit) {
-				$field = $limit['field'];
-				if($client[$field] != 0) {
-					$value = ($client[$field] == '-1')?$wb['unlimited_txt']:$client[$field];
-					$rows[] = array('field' => $field,
-									'field_txt' => $wb[$field.'_txt'],
-									'value' => $value,
-									'usage' => $this->_get_limit_usage($limit));
-				}
-			}
-			$tpl->setLoop('rows',$rows);
 		}
+		
+		$rows = array();
+		foreach($limits as $limit) {
+			$field = $limit['field'];
+			if($user_is_admin) {
+				$value = $wb['unlimited_txt'];
+			} else {
+				$value = $client[$field];
+			}
+			if($value != 0 || $value == $wb['unlimited_txt']) {
+				$value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value;
+				$rows[] = array('field' => $field,
+								'field_txt' => $wb[$field.'_txt'],
+								'value' => $value_formatted,
+								'usage' => $this->_get_limit_usage($limit));
+			}
+		}
+		$tpl->setLoop('rows',$rows);
 		
 		
 		return $tpl->grab();
@@ -160,4 +170,4 @@
 
 
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1