fhiiqm/raum_upd.php
changeset 14 32203b8f40ee
parent 1 6288d5685bff
child 16 3ebe66308a00
--- a/fhiiqm/raum_upd.php	Wed Oct 05 16:46:09 2011 +0200
+++ b/fhiiqm/raum_upd.php	Fri Oct 07 11:37:29 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 07/2011
+ *
+ * UPDATE(/DELETE) Raumdaten   
+ */
+
+    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("rr",$_SESSION["recht"]) && !in_array("re",$_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,18 +35,13 @@
 </head>
 
 <body> 
-    <div class="float-r"><img src="img/house.png" border="0" alt="Raumdaten bearbeiten" title="Raumdaten bearbeiten"/></div>
-
+    
 <?php
-
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 07/2011
- *
- * UPDATE(/DELETE) Raumdaten   
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
+    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/house.png\" border=\"0\" alt=\"Raumdaten bearbeiten\" title=\"Raumdaten bearbeiten\"/></div>\n";
     
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
 	$dbc = new dbconnection();
@@ -83,14 +104,19 @@
     		echo "></td>\n</tr>\n"; 
         }
 		
-		echo "<tr>\n";
-		echo "
-		  <td>&nbsp;</td>
-		  <td><input class=\"button\" type=\"submit\" value=\"&auml;ndern\" name=\"upd\" title=\"update\" />
-		  &nbsp;&nbsp;&nbsp;<input class=\"button\" type=\"submit\" value=\"l&ouml;schen\" name=\"del\" title=\"delete\" /></td>\n";
-		echo "</tr>\n";
+        if (!is_null($_SESSION["recht"]) && in_array("re", $_SESSION["recht"]))
+        {
+    		echo "<tr>\n";
+    		echo "
+    		  <td>&nbsp;</td>
+    		  <td><input class=\"button\" type=\"submit\" value=\"&auml;ndern\" name=\"upd\" title=\"update\" />
+    		  &nbsp;&nbsp;&nbsp;<input class=\"button\" type=\"submit\" value=\"l&ouml;schen\" name=\"del\" title=\"delete\" /></td>\n";
+    		echo "</tr>\n";
+        }
         echo "</table>\n";
         echo "</div>\n";
+        if (!is_null($_SESSION["recht"]) && !in_array("re", $_SESSION["recht"]))
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"raum_flist.php$liste\" target=\"_self\" title=\"Raumliste\">Zur&uuml;ck zur Raumliste</a></p>\n";    
         echo "</form>\n";	
 
     }