From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 06 Aug 2015 03:18:44 -0400
Subject: [PATCH] - don't set password via remoting if field is empty

---
 interface/web/dashboard/dashlets/modules.php |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/interface/web/dashboard/dashlets/modules.php b/interface/web/dashboard/dashlets/modules.php
index 1b1d2ef..da1eb0b 100644
--- a/interface/web/dashboard/dashlets/modules.php
+++ b/interface/web/dashboard/dashlets/modules.php
@@ -28,19 +28,32 @@
 					include_once '../' . $mt.'/lib/module.conf.php';
 					/* We don't want to show the dashboard */
 					if ($mt != 'dashboard') {
+						if($mt == 'dns'){
+							$dns_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE dns_server = 1 AND active = 1");
+							if($dns_servers['cnt'] == 0) continue;
+						}
+						if($mt == 'mail'){
+							$mail_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE mail_server = 1 AND active = 1");
+							if($mail_servers['cnt'] == 0) continue;
+						}
+						if($mt == 'sites'){
+							$web_servers = $app->db->queryOneRecord("SELECT COUNT(*) as cnt FROM server WHERE web_server = 1 AND active = 1");
+							if($web_servers['cnt'] == 0) continue;
+						}
+					
 						$module_title = $app->lng($module['title']);
 						if(function_exists('mb_strlen')) {
 							if(mb_strlen($module_title, "UTF-8") > 8) $module_title = mb_substr($module_title, 0, 7, "UTF-8").'..';
 						} else {
 							if(strlen($module_title) > 8) $module_title = substr($module_title, 0, 7).'..';
 						}
-						$mod[] = array( 'modules_title'  => $module_title,
+						$mod[$module['order']] = array( 'modules_title'  => $module_title,
 							'modules_startpage' => $module['startpage'],
 							'modules_name'   => $module['name']);
 					}
 				}
 			}
-
+			ksort($mod);
 			$tpl->setloop('modules', $mod);
 		}
 

--
Gitblit v1.9.1