From a8de4aa68245465ae33b636ada31c8f9452a28b2 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 19 Dec 2010 13:35:42 +0000 Subject: [PATCH] hide profile options if no quotas can be read --- lam/lib/modules/quota.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lam/lib/modules/quota.inc b/lam/lib/modules/quota.inc index 2823c81c..6cd28ff9 100644 --- a/lam/lib/modules/quota.inc +++ b/lam/lib/modules/quota.inc @@ -453,6 +453,7 @@ class quota extends baseModule { */ function get_profileOptions() { $return = new htmlTable(); + $optionsAvailable = false; // get list of lamdaemon servers $lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers()); for ($s = 0; $s < sizeof($lamdaemonServers); $s++) { @@ -482,6 +483,7 @@ class quota extends baseModule { } $dirs = array_values($dirs); if (sizeof($dirs) < 1) continue; // stop if no quota directories were found + $optionsAvailable = true; $return->addElement(new htmlSubTitle($description), true); $return->addElement(new htmlOutputText(' ' . _('Mountpoint') . ' ', false)); $return->addElement(new htmlOutputText(' ' . _('Soft block limit') . ' ', false)); @@ -517,6 +519,9 @@ class quota extends baseModule { $return->addNewLine(); } } + if (!$optionsAvailable) { + return null; + } return $return; }