Browse code

Zeige Links auf dem Startseite nur an, wenn das betreffende Modul aktiviert ist

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1363 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on05/05/2009 07:33:29
Showing2 changed files
... ...
@@ -146,6 +146,13 @@ function check_form_token($form_id, $formtoken = NULL)
146 146
 }
147 147
 
148 148
 
149
+function have_module($modname)
150
+{
151
+  global $config;
152
+  return in_array($modname, $config['modules']);
153
+}
154
+
155
+
149 156
 function encode_querystring($querystring)
150 157
 {
151 158
   global $debugmode;
... ...
@@ -52,25 +52,31 @@ output("<p>Auf der linken Seite sehen Sie ein Auswahlmenü mit den Funktionen, d
52 52
 
53 53
 output("<div class=\"overview\">");
54 54
 
55
-if ($_SESSION['role'] & ROLE_MAILACCOUNT || $_SESSION['role'] & ROLE_VMAIL_ACCOUNT) {
55
+# Modul "email"
56
+if (have_module('email') && ($_SESSION['role'] & ROLE_MAILACCOUNT || $_SESSION['role'] & ROLE_VMAIL_ACCOUNT)) {
56 57
   output("<div class=\"block\">".internal_link("../email/chpass", "<img src=\"{$prefix}images/pwchange.png\" alt=\"\" /> Passwort ändern ")."</div>");
57 58
 }
58 59
 
60
+# Modul "index", kann man nicht ausschalten
59 61
 if ($_SESSION['role'] & ROLE_CUSTOMER || $_SESSION['role'] & ROLE_SYSTEMUSER) {
60 62
   output("<div class=\"block\">".internal_link("chpass", "<img src=\"{$prefix}images/pwchange.png\" alt=\"\" /> Passwort ändern ")."</div>");
61 63
 }
62 64
 
63
-if ($_SESSION['role'] & ROLE_CUSTOMER) {
65
+# Modul "invoice"
66
+if (have_module('invoice') && $_SESSION['role'] & ROLE_CUSTOMER) {
64 67
   output("<div class=\"block\">".internal_link("../invoice/current", "<img src=\"{$prefix}images/invoice.png\" alt=\"\" /> Ihre Rechnungen ")."</div>");
65 68
 }
66 69
 
67 70
 if ($_SESSION['role'] & ROLE_SYSTEMUSER) {
68
-  output("<div class=\"block\">".internal_link("../email/vmail", "<img src=\"{$prefix}images/email.png\" alt=\"\" /> E-Mail-Adressen verwalten ")."</div>");
69
-  output("<div class=\"block\">".internal_link("../vhosts/vhosts", "<img src=\"{$prefix}images/webserver.png\" alt=\"\" /> Webserver-Einstellungen ")."</div>");
70
-  output("<div class=\"block\">".internal_link("../mysql/databases", "<img src=\"{$prefix}images/mysql.png\" alt=\"\" /> MySQL-Datenbanken ")."</div>");
71
+  if (have_module('email'))
72
+    output("<div class=\"block\">".internal_link("../email/vmail", "<img src=\"{$prefix}images/email.png\" alt=\"\" /> E-Mail-Adressen verwalten ")."</div>");
73
+  if (have_module('vhosts'))
74
+    output("<div class=\"block\">".internal_link("../vhosts/vhosts", "<img src=\"{$prefix}images/webserver.png\" alt=\"\" /> Webserver-Einstellungen ")."</div>");
75
+  if (have_module('mysql'))
76
+    output("<div class=\"block\">".internal_link("../mysql/databases", "<img src=\"{$prefix}images/mysql.png\" alt=\"\" /> MySQL-Datenbanken ")."</div>");
71 77
 }
72 78
  
73
-if ($_SESSION['role'] & ROLE_CUSTOMER) {
79
+if (have_module('jabber') && $_SESSION['role'] & ROLE_CUSTOMER) {
74 80
   output("<div class=\"block\">".internal_link("../jabber/accounts", "<img src=\"{$prefix}images/jabber.png\" alt=\"\" /> Jabber-Accounts ")."</div>");
75 81
 }
76 82