index.php
changeset 82 c255196bc447
parent 79 0c0aa144356a
child 110 455405c757e1
--- a/index.php	Wed Mar 12 20:45:56 2008 +0000
+++ b/index.php	Tue Mar 25 22:45:31 2008 +0000
@@ -22,34 +22,41 @@
 //session_start();
 require_once("inc/toolkit.inc.php");
 include_once("inc/header.inc.php");
-?>
-   <h3><?php echo _('Welcome'); ?>, <?php echo $_SESSION["name"] ?></h3>
-   <ul>
-    <li><a href="search.php"><?php echo _('Search zones or records'); ?></a></li>
-    <li><a href="list_zones.php"><?php echo _('List all zones'); ?></a></li>
-<?php
-if (level(5))
-{
-?>
-    <li><a href="list_supermasters.php"><?php echo _('List all supermasters'); ?></a></li>
-    <li><a href="add_zone_master.php"><?php echo _('Add master zone'); ?></a></li>
-    <li><a href="add_zone_slave.php"><?php echo _('Add slave zone'); ?></a></li>
-    <li><a href="add_supermaster.php"><?php echo _('Add supermaster'); ?></a></li>
-<?php
+
+echo "     <h3>" . _('Welcome') . " " . $_SESSION["name"] . "</h3>\n";
+
+verify_permission(search) ? $perm_search = "1" : $perm_search = "0" ;
+verify_permission(zone_content_view_own) ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0" ;
+verify_permission(zone_content_view_other) ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0" ;
+verify_permission(supermaster_view) ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0" ;
+verify_permission(zone_master_add) ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0" ;
+verify_permission(zone_slave_add) ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0" ;
+verify_permission(supermaster_add) ? $perm_supermaster_add = "1" : $perm_supermaster_add = "0" ;
+
+echo "    <ul>\n";
+echo "    <li><a href=\"index.php\">" . _('Index') . "</a></li>\n";
+if ( $perm_search == "1" ) {
+	echo "    <li><a href=\"search.php\">" . _('Search zones or records') . "</a></li>\n";
 }
-?>
-    <li><a href="change_password.php"><?php echo _('Change password'); ?></a></li>
-<?php
-if (level(10))
-{
-?>
-    <li><a href="users.php"><?php echo _('User administration'); ?></a></li>
-<?php
+if ( $perm_view_zone_own == "1" || $perm_view_zone_other == "1" ) {
+	echo "    <li><a href=\"list_zones.php\">" . _('List all zones') . "</a></li>\n";
+}
+if ( $perm_supermaster_view ) {
+	echo "    <li><a href=\"list_supermasters.php\">" . _('List all supermasters') . "</a></li>\n";
+}
+if (  $perm_zone_master_add ) {
+	echo "    <li><a href=\"add_zone_master.php\">" . _('Add master zone') . "</a></li>\n";
 }
-?>
-    <li><a href="index.php?logout"><?php echo _('Logout'); ?></a></li>
-   </ul>
+if ( $perm_zone_slave_add ) { 
+	echo "    <li><a href=\"add_zone_slave.php\">" . _('Add slave zone') . "</a></li>\n";
+}
+if ( $supermaster_add ) { 
+	echo "    <li><a href=\"add_supermaster.php\">" . _('Add supermaster') . "</a></li>\n";
+}
+echo "    <li><a href=\"change_password.php\">" . _('Change password') . "</a></li>\n";
+echo "    <li><a href=\"users.php\">" . _('User administration') . "</a></li>\n";
+echo "    <li><a href=\"index.php?logout\">" . _('Logout') . "</a></li>\n";
+echo "   </ul>\n";
 
-<?php
 include_once("inc/footer.inc.php");
 ?>