From 249fc8b1c8022fabcf6d704b280aa6b33f05a21c Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 05 Oct 2010 15:03:52 -0400
Subject: [PATCH] Fixed: FS#1350 - Minor bugs in monitor and dashboard.

---
 install/update.php                              |    4 ++--
 interface/web/dashboard/dashboard.php           |   14 +++++++++++++-
 interface/web/sites/user_quota_stats.php        |    6 +++---
 interface/web/dashboard/lib/custom_menu.inc.php |    2 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/install/update.php b/install/update.php
index 6f39b23..5630c1d 100644
--- a/install/update.php
+++ b/install/update.php
@@ -198,14 +198,14 @@
  * (if this is done at client side, only this client is updated.
  * If this is done at server side, all clients are updated.
  */
-//if($conf['mysql']['master_slave_setup'] == 'y') {
+if($conf_old['dbmaster_user'] != '' or $conf_old['dbmaster_host'] != '') {
 	//** Update master database rights
 	$reconfigure_master_database_rights_answer = $inst->simple_query('Reconfigure Permissions in master database?', array('yes','no'),'no');
 
 	if($reconfigure_master_database_rights_answer == 'yes') {
 		$inst->grant_master_database_rights();
 	}
-//}
+}
 
 //** Shall the services be reconfigured during update
 $reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes','no'),'yes');
diff --git a/interface/web/dashboard/dashboard.php b/interface/web/dashboard/dashboard.php
index a874aff..0277058 100644
--- a/interface/web/dashboard/dashboard.php
+++ b/interface/web/dashboard/dashboard.php
@@ -92,7 +92,19 @@
 if($_SESSION["s"]["user"]["typ"] == 'admin') {
 	$new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt');
 	$new_version = trim($new_version);
-	if($new_version != ISPC_APP_VERSION) {
+	$this_version = explode(".",ISPC_APP_VERSION);
+	$this_fullversion = (($this_version[0] < 10) ? '0'.$this_version[0] : $this_version[0]) .
+			    (($this_version[1] < 10) ? '0'.$this_version[1] : $this_version[1]) .
+			    (($this_version[2] < 10) ? '0'.$this_version[2] : $this_version[2]) .
+			    (($this_version[3] < 10) ? (($this_version[3] < 1) ? '00' : '0'.$this_version[3]) : $this_version[3]);
+
+
+	$new_version = explode(".",$new_version);
+	$new_fullversion =  (($new_version[0] < 10) ? '0'.$new_version[0] : $new_version[0]) .
+			    (($new_version[1] < 10) ? '0'.$new_version[1] : $new_version[1]) .
+			    (($new_version[2] < 10) ? '0'.$new_version[2] : $new_version[2]) .
+			    (($new_version[3] < 10) ? (($new_version[3] < 1) ? '00' : '0'.$new_version[3]) : $new_version[3]);
+	if($new_fullversion > $this_fullversion) {
 		$info[] = array('info_msg' => 'There is a new Version of ISPConfig 3 available! <a href="http://www.ispconfig.org/ispconfig-3/download">See more...</a>');
 	}
 }
diff --git a/interface/web/dashboard/lib/custom_menu.inc.php b/interface/web/dashboard/lib/custom_menu.inc.php
index e75fc75..8dea3d0 100644
--- a/interface/web/dashboard/lib/custom_menu.inc.php
+++ b/interface/web/dashboard/lib/custom_menu.inc.php
@@ -40,7 +40,7 @@
 
 	if(!isset($_SESSION['s']['rss_news'])) {
 		
-		$app->simplepie->set_feed_url('http://www.ispconfig.org/atom');
+		$app->simplepie->set_feed_url($misc_config['dashboard_atom_url']);
 		$app->simplepie->enable_cache(false);
 		$app->simplepie->init();
 		$items = $app->simplepie->get_items();
diff --git a/interface/web/sites/user_quota_stats.php b/interface/web/sites/user_quota_stats.php
index ce2c3bc..2e28d0d 100644
--- a/interface/web/sites/user_quota_stats.php
+++ b/interface/web/sites/user_quota_stats.php
@@ -33,9 +33,9 @@
 		$rec['bgcolor'] = $this->DataRowColor;
 		$username = $rec['system_user'];
 		
-		$rec['used'] = $monitor_data['user'][$username]['used'];
-		$rec['soft'] = $monitor_data['user'][$username]['soft'];
-		$rec['hard'] = $monitor_data['user'][$username]['hard'];
+		$rec['used'] = (is_numeric($monitor_data['user'][$username]['used'])) ? round($monitor_data['user'][$username]['used']/1024) .'MB' : $monitor_data['user'][$username]['used'].'B';
+		$rec['soft'] = $monitor_data['user'][$username]['soft'].'B';
+		$rec['hard'] = $monitor_data['user'][$username]['hard'].'B';
 		
 		if($rec['soft'] == '0K') $rec['soft'] = $app->lng('unlimited');
 		if($rec['hard'] == '0K') $rec['hard'] = $app->lng('unlimited');

--
Gitblit v1.9.1