fhiiqm/prod_hier.php
changeset 14 32203b8f40ee
parent 1 6288d5685bff
child 17 f990704af47b
--- a/fhiiqm/prod_hier.php	Wed Oct 05 16:46:09 2011 +0200
+++ b/fhiiqm/prod_hier.php	Fri Oct 07 11:37:29 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 06/2011
+ * 
+ * Suche und Anzeige Produkthierarchien
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("pr",$_SESSION["recht"]) && !in_array("pe",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+    
+?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
@@ -9,19 +35,14 @@
 </head>
 
 <body>
-    <div class="float-r"><img src="img/node-tree.png" border="0" alt="Produkte" title="Produkte"/></div>
-
+    
 <?php
+    echo "&nbsp;";  
+    echo "<div class=\"float-br smaller\" valign='top'>";
+    echo "&nbsp;&nbsp;&nbsp;user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+    echo "<div class=\"float-r\"><img src=\"img/node-tree.png\" border=\"0\" alt=\"Produkte\" title=\"Produkte\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 06/2011
- * 
- * Suche und Anzeige Produkthierarchien
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
     $prods = $_POST['prods'];
     $submit = $_POST['search'];
 
@@ -144,7 +165,8 @@
     		}
         echo "</div>\n";
         echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"prod_hier.php\" target=\"_self\" title=\"Produkthierarchie\">neue Suche Produkthierarchie</a></p>\n";    
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"produkt_ins.php\" target=\"_self\" title=\"Produkt erfassen\">Produkt erfassen</a></p>\n";    
+        if (!is_null($_SESSION["recht"]) && in_array("pe",$_SESSION["recht"]))
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"produkt_ins.php\" target=\"_self\" title=\"Produkt erfassen\">Produkt erfassen</a></p>\n";    
     }
 
 ?>