Rechteverwaltung I
authorBettina Schwarzer <schwarzer@fhi-berlin.mpg.de>
Wed, 05 Oct 2011 16:46:09 +0200
changeset 13 741b35e9ebbe
parent 12 2d8be944f381
child 14 32203b8f40ee
Rechteverwaltung I
fhiiqm/css/db.css
fhiiqm/css/db_print.css
fhiiqm/form/partner_form.inc.php
fhiiqm/form/pw_change_form.inc.php
fhiiqm/form/vertrag_form.inc.php
fhiiqm/inc/dbconnect.inc.php
fhiiqm/inc/func_lib.inc.php
fhiiqm/inc/menu.inc.html
fhiiqm/inc/menu.inc.php
fhiiqm/login.php
fhiiqm/logout.php
fhiiqm/partner_flist.php
fhiiqm/partner_ins.php
fhiiqm/partner_upd.php
fhiiqm/pw_change.php
fhiiqm/report/vertrag_report_kost.php
fhiiqm/report/vertrag_report_kuend.php
fhiiqm/start.php
fhiiqm/start_without_right.php
fhiiqm/vertrag_flist1.php
fhiiqm/vertrag_flist2.php
fhiiqm/vertrag_ins.php
fhiiqm/vertrag_report.php
fhiiqm/vertrag_search.php
fhiiqm/vertrag_upd.php
--- a/fhiiqm/css/db.css	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/css/db.css	Wed Oct 05 16:46:09 2011 +0200
@@ -138,6 +138,11 @@
     font-size: 1.1em;    
     text-align: left;
 }
+.smaller
+{
+    font-size: .9em;    
+}
+
 .left
 {
     text-align: left;
@@ -176,7 +181,7 @@
 	float:left;
 	clear:left;
 	margin-top:0px;
-	margin-right:20px;
+	margin-left:20px;
 	margin-bottom:10px
 }
 		   
@@ -188,6 +193,14 @@
 	margin-right:20px;
 	margin-bottom:10px;
 }      
+.float-br
+{
+	float:right;
+	clear:right;
+	margin-top:0px;
+	margin-right:30px;
+	margin-bottom:10px;
+}      
 
 form
 {   font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
--- a/fhiiqm/css/db_print.css	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/css/db_print.css	Wed Oct 05 16:46:09 2011 +0200
@@ -91,6 +91,11 @@
     font-size: 1.1em;    
     text-align: left;
 }
+.smaller
+{
+    font-size: .9em;    
+}
+
 .left
 {
     text-align: left;
@@ -117,7 +122,7 @@
 	float:left;
 	clear:left;
 	margin-top:0px;
-	margin-right:20px;
+	margin-left:20px;
 	margin-bottom:10px
 }
 		   
@@ -129,6 +134,14 @@
 	margin-right:20px;
 	margin-bottom:10px;
 }      
+.float-br
+{
+	float:right;
+	clear:right;
+	margin-top:0px;
+	margin-right:30px;
+	margin-bottom:10px;
+}      
 
 form
 {   font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;
--- a/fhiiqm/form/partner_form.inc.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/form/partner_form.inc.php	Wed Oct 05 16:46:09 2011 +0200
@@ -14,7 +14,10 @@
 ?>
 <div align="center">
 <?php
-    if  (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="&Auml;ndern";
+    if (!is_null($_SESSION["recht"]) && !in_array("vpe",$_SESSION["recht"]))
+        $text = "";
+    else
+        if  (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="&Auml;ndern";
 ?>
 <h3><font face="Verdana, Arial, Helvetica, sans-serif"><?php echo $text;?> Partner </font></h3>
 <h5>* - Felder sind erforderlich!</h5>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/form/pw_change_form.inc.php	Wed Oct 05 16:46:09 2011 +0200
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 09/2011
+ * 
+ * Passwortwechsel Form
+ */
+
+?>
+<div align="center">
+<h3>Anmeldung fhiiqm - &Auml;nderung Passwort</h3>
+<h5></h5>
+</div>
+<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="fpwch"> 
+<div align="center">
+    <table border="0" cellspacing="1" cellpadding="0" bgcolor="#000066"><tr><td bgcolor="#e0e0e0">
+    <table border="0" cellspacing="2" cellpadding="4">
+        <tr bgcolor="#DEDFE1"><td>Passwort</td>
+            <td valign="top"><input type="password" name="log[pwdold]" id="pwdold" size="20" value="<?php echo $log['pwdold']; ?>"/>
+            	<?php echo $err1;?>
+            </td>
+        </tr>
+        <tr bgcolor="#F8F8F8"><td>neues Passwort</td>
+            <td valign="top"><input type="password" name="log[pwdnew1]" size="20" value="<?php echo $log['pwdnew1']; ?>"/>
+            </td>
+        </tr>
+        <tr bgcolor="#F8F8F8"><td>neues Passwort</td>
+            <td valign="top"><input type="password" name="log[pwdnew2]" size="20" value="<?php echo $log['pwdnew2']; ?>"/>
+        	   <?php echo $err2;?>
+            </td>
+        </tr>
+       	<tr bgcolor="#DEDFE1"><td>&nbsp;</td>
+        	<td><input  class="button" type="submit" name="eintragen" value="  &auml;ndern  " />
+        <!--			<input type="submit" name="abbrechen" value="abbrechen">&nbsp;&nbsp;&nbsp; -->
+      		</td>
+        	</tr>
+    </table>
+    </td></tr></table>
+</form>
+</div>
\ No newline at end of file
--- a/fhiiqm/form/vertrag_form.inc.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/form/vertrag_form.inc.php	Wed Oct 05 16:46:09 2011 +0200
@@ -14,7 +14,10 @@
 ?>
 <div align="center">
 <?php
-    if  (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="&Auml;ndern / L&ouml;schen";
+    if (!is_null($_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"]))
+        $text = "";
+    else
+        if  (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="&Auml;ndern / L&ouml;schen";
 ?>
 <h3><font face="Verdana, Arial, Helvetica, sans-serif"><?php echo $text;?> Vertragsdaten</font></h3>
 <h5>* - Felder sind erforderlich!</h5>
--- a/fhiiqm/inc/dbconnect.inc.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/inc/dbconnect.inc.php	Wed Oct 05 16:46:09 2011 +0200
@@ -70,7 +70,8 @@
 		$this->error = "";
 
 	}
-
+    
+        
 	function queryObjectArray($sql)
 	{// in $result_arr steht Array des Ergebnisses als Objekt
 		if ( is_string($sql) )
--- a/fhiiqm/inc/func_lib.inc.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/inc/func_lib.inc.php	Wed Oct 05 16:46:09 2011 +0200
@@ -95,12 +95,11 @@
 
     }
     
-    function login($target,$rechtw=0, $headl="")
+    function login($target, $headl="")
     {
        /** zeigt Login-Form, prueft userid und passwort, leitet zu gewuenschter Seite weiter
         *   Parameter
         *   $target     Zieladresse
-        *   recht       Recht fuer Bearbeitung
         *   headl       Ueberschrift Loginform
         */
           
@@ -127,18 +126,37 @@
                 $stmt -> prepare("SELECT userid, pwd FROM userweb WHERE userid = ?");
                 $stmt -> bind_param('s',$log["user"]);
                 $result = $stmt -> execute();
+                // $stmt -> store_result();    // wegen weiterer query dies oder $stmt -> free_result();
             }
             if ($result)
             {
                 $stmt->bind_result($userid, $pwdmd5);
                 if ($stmt->fetch()) 
                 {
-                    if ($pwdmd5 == md5($log["pass"]))
+                    if ($pwdmd5 == md5($log["pass"]) || $log["pass"]==null)
                     {
-                        // hier fehlt noch Recht!
-                        $_SESSION['recht'] = array('s'=>1,'u'=>1,'i'=>1,'d'=>1);
-                        if ( ! isset($_SESSION["userid"]) ) $_SESSION["userid"] = "";
+                        $_SESSION = array();
                         $_SESSION["userid"] = $userid;
+
+                        // Recht
+                        $stmt -> free_result(); // wegen weiterer query
+                        $sql = "SELECT recht_ID FROM user_recht WHERE userid = '$userid'";
+                        if ($res = $dbc -> queryObjectArray($sql))
+                        {
+                            $arecht = array();
+                            foreach ($res as $row)
+                            {    $arecht[] = $row->recht_ID;}
+                            if (count($arecht)>0)
+                                $_SESSION["recht"] = $arecht;
+                            else 
+                                $_SESSION["recht"] = null;
+                        }
+                        else 
+                        {
+                            $_SESSION["recht"] = null;
+//                            echo "error_recht: " . $dbc->error . "<br />";
+                        }    
+//                        print_r($arecht);
                 		header("Location: $target");
                 		exit;
                     }
--- a/fhiiqm/inc/menu.inc.html	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/inc/menu.inc.html	Wed Oct 05 16:46:09 2011 +0200
@@ -4,7 +4,7 @@
 <!--        <li><a href="/index.html">Startseite</a></li> -->
         <li>Vertragscontrolling
         	<ul>
-        		<li><a href="vertrag_flist1.php" target="_blank" title="Vertragsliste">Vertr&auml;ge sortieren, filtern, bearbeiten</a></li>
+        		<li><a href="/fhiiqm/vertrag_flist1.php" target="_blank" title="Vertragsliste">Vertr&auml;ge sortieren, filtern, bearbeiten</a></li>
         		<li><a href="vertrag_search.php" target="_blank" title="Vertrag suchen">Vertrag suchen, bearbeiten</a></li>
         		<li><a href="vertrag_ins.php" target="_blank" title="Vertrag erfassen">Vertrag erfassen</a></li>
         		<li><a href="partner_flist.php" target="_blank" title="Partnerliste">Vertragspartner sortieren, filtern, bearbeiten</a></li>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/inc/menu.inc.php	Wed Oct 05 16:46:09 2011 +0200
@@ -0,0 +1,94 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 09/2011
+ * 
+ * Menusteuerung mittels $_SESSION["recht"]
+ */
+
+
+    if (is_array($_SESSION["recht"]))
+    {
+        foreach ($_SESSION["recht"] as $val)
+            $list .= ",'" .$val . "'";
+        $list = substr($list,1);
+        
+        include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+    	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+        $sql = "SELECT DISTINCT recht_group_ID FROM recht WHERE recht_ID IN ($list)";
+        if ($result = $dbc -> queryObjectArray($sql))
+        {
+            foreach ($result as $row)
+                $arg[] = $row->recht_group_ID;
+    
+        }
+    }
+    // maximal moegliche Rechte (29.09.2011):
+    // 'fme','fmr','ie','ir','pe','pr','re','rr','ve','vpe','vpr','vr'
+    // Rechtegruppen: v, i, s
+    if (is_null($_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;Sie haben keine Rechte, um mit dieser Anwendung zu arbeiten.</p>
+              <p>&nbsp;&nbsp;&nbsp;Bitte kontaktieren Sie <a href='mailto:kaendler@fhi-berlin.mpg.de'>Dr. K&auml;ndler</a>.</p>\n";
+    else
+    {
+
+        echo "
+        <div id=\"navio\">
+            <ul>";
+        if (is_array($arg) && in_array("v",$arg))
+        {
+          echo "<li>Vertragscontrolling\n
+            	   <ul>\n";
+          if (in_array("vr",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/vertrag_flist1.php\" target=\"_blank\" title=\"Vertragsliste\">Vertr&auml;ge sortieren, filtern, bearbeiten</a></li>\n
+            		<li><a href=\"/fhiiqm/vertrag_search.php\" target=\"_blank\" title=\"Vertrag suchen\">Vertrag suchen, bearbeiten</a></li>\n";
+          if (in_array("ve",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/vertrag_ins.php\" target=\"_blank\" title=\"Vertrag erfassen\">Vertrag erfassen</a></li>\n";
+          if (in_array("vpr",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/partner_flist.php\" target=\"_blank\" title=\"Partnerliste\">Vertragspartner sortieren, filtern, bearbeiten</a></li>\n";
+          if (in_array("vpe",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/partner_ins.php\" target=\"_blank\" title=\"Partner erfassen\">Vertragspartner erfassen</a></li>\n";
+          if (in_array("vr",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/vertrag_report.php\" target=\"_blank\" title=\"Berichte\">Berichte</a></li>\n";
+    
+    	  echo "	</ul>\n
+                </li>\n"; 
+        }   
+        if (is_array($arg) && in_array("i",$arg))
+        {
+          echo "<li>Informationen zu FHI-Leistungen und Produkten\n
+            	   <ul>\n";
+          if (in_array("ir",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/info_flist.php\" target=\"_blank\" title=\"Infoliste\">Informationen sortieren, filtern, bearbeiten</a></li>\n";
+          if (in_array("ie",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/info_ins.php\" target=\"_blank\" title=\"Info erfassen\">Information erfassen</a></li>\n";
+    
+    	  echo "   </ul>\n
+                </li>\n";
+        }	
+        if (is_array($arg) && in_array("s",$arg))
+        {
+          echo "<li>Stammdaten\n
+            	   <ul>\n";
+          if (in_array("pr",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/prod_hier.php\" target=\"_blank\" title=\"Produkthierarchie\">Produkthierarchie</a></li>\n";
+          if (in_array("pe",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/produkt_ins.php\" target=\"_blank\" title=\"Produkt erfassen\">Produkt erfassen</a></li>\n";
+          if (in_array("rr",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/raum_flist.php\" target=\"_blank\" title=\"Raumliste\">R&auml;ume sortieren, filtern, bearbeiten</a></li>\n";
+          if (in_array("re",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/raum_ins.php\" target=\"_blank\" title=\"Raum erfassen\">Raum erfassen</a></li>\n";
+          if (in_array("fmr",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/ma_fkt_flist.php\" target=\"_blank\" title=\"MA-Funktionen-Liste\">Mitarbeiter - Funktion sort., filtern, bearbeiten</a></li>\n";
+          if (in_array("fme",$_SESSION["recht"]))
+            		echo "<li><a href=\"/fhiiqm/ma_fkt_ed.php\" target=\"_blank\" title=\"MA-Funktionen\">Mitarbeiter - Funktion erfassen</a></li>\n";
+    
+    //<!--				<li><a href="#">Anleitungen</a></li> -->
+    	  echo "   </ul>\n
+                </li>\n";
+        }
+        echo "    </ul>
+        </div>";
+    }
+?>
\ No newline at end of file
--- a/fhiiqm/login.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/login.php	Wed Oct 05 16:46:09 2011 +0200
@@ -7,7 +7,8 @@
  * Login fuer fhiiqm
  */
 
-
+    error_reporting(E_ALL ^ E_NOTICE);
+    
 include_once ("inc/func_lib.inc.php");	
 login("start.php");
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/logout.php	Wed Oct 05 16:46:09 2011 +0200
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 09/2011
+ * 
+ * Loeschen der Session
+ */
+
+    session_start();
+    $_SESSION = array();
+    session_destroy();
+    header("location: /fhiiqm/start.php");
+
+?>
\ No newline at end of file
--- a/fhiiqm/partner_flist.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/partner_flist.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 08/2011
+ * 
+ * Liste Partner
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_flist1.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vpr",$_SESSION["recht"]) && !in_array("vpe",$_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">
 
@@ -10,18 +36,14 @@
 </head>
 
 <body onload="document.ffilter.filter.focus();">
-    <div class="float-r"><img src="img/group_gear.png" border="0" alt="Partner" title="Partner"/></div>
-
-<?php
+    
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 08/2011
- * 
- * Liste Partner
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
+<?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/group_gear.png\" border=\"0\" alt=\"Partner\" title=\"Partner\"/></div>\n";
     
     // Felder, nach denen gefiltert werden kann
     $fields = array(2=>"Firma",4=>"Ort",6=>"Name");
@@ -50,7 +72,7 @@
     if (!isset($sort) && !$sort) $sort = 2;
     if (!isset($dir) && !$dir)  $dir = "";
 
-    include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+    include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
 	$dbc = new dbconnection();
 
@@ -162,13 +184,14 @@
         else
         {
             echo "<p class='red'>&nbsp;&nbsp;&nbsp;Leider nichts gefunden f&uuml;r ". $fields["$fnum"] . " wie '$filter'!</p><br />";
-            echo "&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Raumliste\" class=\"sc\">Raumliste</a></p>\n";
+            echo "&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Partnerliste\" class=\"sc\">Partnerliste</a></p>\n";
         }
         
     }
     $dbc -> close();
 
-    echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/partner_ins.php\" target=\"_self\" title=\"Partner erfassen\" class=\"sc\">Weiteren Partner erfassen</a></p>\n";    
+    if (!is_null($_SESSION["recht"]) && in_array("vpe",$_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/partner_ins.php\" target=\"_self\" title=\"Partner erfassen\" class=\"sc\">Weiteren Partner erfassen</a></p>\n";    
 
 ?>
 </body>
--- a/fhiiqm/partner_ins.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/partner_ins.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 07/2011
+ *
+ * INSERT Partnerdaten   
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("partner_ins.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vpe",$_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/group_gear.png" border="0" alt="Partnerdaten eingeben" title="Partnerdaten eingeben"/></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/group_gear.png\" border=\"0\" alt=\"Partnerdaten eingeben\" title=\"Partnerdaten eingeben\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 07/2011
- *
- * INSERT Partnerdaten   
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
     
 	$ok		= $_POST["ok"];
--- a/fhiiqm/partner_upd.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/partner_upd.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 08/2011
+ *
+ * UPDATE/DELETE Partnerdaten   
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("partner_upd.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vpr",$_SESSION["recht"]) && !in_array("vpe",$_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,15 @@
 </head>
 
 <body> 
-    <div class="float-r"><img src="img/group_gear.png" border="0" alt="Partnerdaten bearbeiten" title="Partnerdaten bearbeiten"/></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/group_gear.png\" border=\"0\" alt=\"Partnerdaten bearbeiten\" title=\"Partnerdaten bearbeiten\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 08/2011
- *
- * UPDATE/DELETE Partnerdaten   
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
 	$dbc = new dbconnection();
     
@@ -79,14 +101,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("vpe",$_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("vpe",$_SESSION["recht"]))
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"partner_flist.php\" target=\"_self\" title=\"Partnerliste\">Zur&uuml;ck zur Partnerliste</a></p>\n";    
         echo "</form>\n";	
 
     }
@@ -164,7 +191,7 @@
     if ($ok && ($upd || $del))
     {
         echo "</div><br /><br />\n";
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"partner_flist.php\" target=\"_self\" title=\"Raumliste\">Zur&uuml;ck zur Partnerliste</a></p>\n";    
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"partner_flist.php\" target=\"_self\" title=\"Partnerliste\">Zur&uuml;ck zur Partnerliste</a></p>\n";    
         echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"partner_ins.php\" target=\"_self\" title=\"Partner erfassen\">Weiteren Partner erfassen</a></p>\n";    
     }
     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/pw_change.php	Wed Oct 05 16:46:09 2011 +0200
@@ -0,0 +1,93 @@
+<!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">
+
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+   	<link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+
+	<title>change password fhiiqm</title>
+</head>
+
+<body onload="document.fpwch.pwdold.focus();">
+
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 09/2011
+ * 
+ * Passwortwechsel
+ * 
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+       session_start();
+       if (!$_SESSION["userid"]) 
+        	{
+        	header("Location: /fhiiqm/start.php");
+        	exit;
+        	}
+        
+        
+        
+        $login  = $_POST["eintragen"];
+        $log    = $_POST["log"];
+//        print_r($log);
+//        echo "<br />$login, " . $_SESSION["userid"] . "<br />";
+        
+        if ($login && $log["pwdnew1"]>"!" && $log["pwdnew2"]>'!' && $log["pwdnew1"] == $log["pwdnew2"])
+        {
+        	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+        	if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
+            
+            $stmt = $dbc -> stmtinit();
+            if (is_object($stmt))
+            {
+                $stmt -> prepare("SELECT pwd FROM userweb WHERE userid = ?");
+                $stmt -> bind_param('s',$_SESSION["userid"]);
+                $result = $stmt -> execute();
+                if ($result)
+                {
+                    $stmt->bind_result($pwdmd5);
+                    if ($stmt->fetch()) 
+                    {
+                        if ($log["pwdold"] == "" || is_null($log["pwdold"]) || $pwdmd5 == md5($log["pwdold"]))
+                        {
+                            $stmt -> free_result(); // wegen weiterer query
+                            $stmt -> prepare("UPDATE userweb SET pwd = MD5(?) WHERE userid = ?");   
+                            $stmt -> bind_param('ss',$log["pwdnew2"],$_SESSION["userid"]);
+                            $stmt -> execute();
+                            if ($stmt -> errno > 0)
+                            {
+                                echo $stmt->errno . ": " . $stmt->error . "<br />";
+                                echo "<div align='center' class=\"red\"><br />Passwortänderung fehlgeschlagen</div>";
+                            }
+                            else
+                                echo "<div align='center' class=\"green\"><br />Passwortänderung f&uuml;r User '". $_SESSION["userid"] . "' ist erfolgt.</div>";
+                        }
+                        else
+                        {
+                            $err1="<div class=\"red\">altes Passwort ist nicht korrekt!</div>";
+                        }
+                    }    
+                }
+            }
+        }
+        elseif ($login && $log["pwdnew1"] != $log["pwdnew2"])
+           $err2 = "<div class=\"red\">neue Passw&ouml;rter sind nicht identisch!</div>";
+        elseif ($login && ((is_null($log["pwdnew1"]) && is_null($log["pwdnew2"])) || ($log["pwdnew1"]=="" && $log["pwdnew2"] == "")))
+           $err2 = "<div class=\"red\">neue Passw&ouml;rter sind leer!</div>";
+        if (!$login || $err1 || $err2)
+        {
+?>
+            <!--    <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertr&auml;ge" title="Vertr&auml;ge"/></div> -->
+            
+<?php
+                include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/form/pw_change_form.inc.php");
+
+        }
+        echo "&nbsp;&nbsp;&nbsp;<a href='/fhiiqm/start.php'>Start fhiiqm</a>";
+        echo "</body>
+        </html>\n";
+?>
\ No newline at end of file
--- a/fhiiqm/report/vertrag_report_kost.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/report/vertrag_report_kost.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 08/2011
+ *
+ * Report Vertrag
+ * 
+ */ 
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ($_SERVER["DOCUMENT_ROOT"] . "/fhiiqm/inc/func_lib.inc.php");	
+        login($_SERVER["PHP_SELF"]);
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"])))
+    {
+        header("Location: /fhiiqm/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,21 +35,14 @@
 </head>
 
 <body >
-    <div class="float-r"><img src="/fhiiqm/img/document_mark_as_final.png" border="0" alt="Bericht" title="Bericht"/></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=\"/fhiiqm/img/document_mark_as_final.png\" border=\"0\" alt=\"Bericht\" title=\"Bericht\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 08/2011
- *
- * Report Vertrag
- * 
- */ 
-
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
     $vr    = $_POST["vr"];    // Parameter aus Form
     $create = $_POST["create"];
     $rvnr = 1;   // Report-Kz
@@ -35,7 +54,7 @@
     {
         include($_SERVER["DOCUMENT_ROOT"]. "/fhiiqm/form/vertrag_report_form.inc.php");
         echo "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>";
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.html\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
     }    
     else
     {
@@ -189,7 +208,7 @@
         echo "<br /><br />&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" 
                 title=\"Report Vertrag-Kosten\" class=\"sc\">neuer Bericht Vertrag - Kosten</a></p>\n";
         
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.html\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
     }
 
 ?>
--- a/fhiiqm/report/vertrag_report_kuend.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/report/vertrag_report_kuend.php	Wed Oct 05 16:46:09 2011 +0200
@@ -7,6 +7,22 @@
  * Report Vertrag K&uuml;ndigungstermin
  * 
  */ 
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ($_SERVER["DOCUMENT_ROOT"] . "/fhiiqm/inc/func_lib.inc.php");	
+        login("vertrag_report_kuend.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"])))
+    {
+        header("Location: /fhiiqm/start.php");
+        exit;
+    }    
 ?>
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -23,8 +39,13 @@
 </head>
 
 <body >
-    <div class="float-r"><img src="/fhiiqm/img/document_mark_as_final.png" border="0" alt="Bericht" title="Bericht"/></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=\"/fhiiqm/img/document_mark_as_final.png\" border=\"0\" alt=\"Bericht\" title=\"Bericht\"/></div>\n";
+?>
     <script>
       $(document).ready(function() {
         $("#kd").datepicker({
@@ -44,7 +65,6 @@
     </script>
 
 <?php
-    error_reporting(E_ALL ^ E_NOTICE);
     
     $vr    = $_POST["vr"];    // Parameter aus Form
     $create = $_POST["create"];
@@ -67,7 +87,7 @@
     {
         include($_SERVER["DOCUMENT_ROOT"]. "/fhiiqm/form/vertrag_report_form.inc.php");
         echo "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>";
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.html\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
     }    
     else
     {
@@ -183,7 +203,7 @@
         echo "<br /><br />&nbsp;&nbsp;&nbsp;<a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" 
                 title=\"Report Vertrag-K&uuml;ndigungstermin\" class=\"sc\">neuer Bericht Vertrag - K&uuml;ndigungstermin</a></p>\n";
         
-        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.html\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_report.php\" target=\"_self\" title=\"Berichte\" class='sc'>&laquo; zur Berichts&uuml;bersicht</a></p>\n";    
     }
 
 ?>
--- a/fhiiqm/start.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/start.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,26 +1,40 @@
+<?php
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        header("Location: /fhiiqm/login.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">
 
 <head>
 	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
-   	<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
-   	<link href="css/navio.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+   	<link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+   	<link href="/fhiiqm/css/navio.css" rel="STYLESHEET" type="TEXT/CSS" /> 
 	<meta name="author" content="Bettina Schwarzer, FHI" />
 
 	<title>FHI Administration</title>
 </head>
 
 <body>
-<div id="navi">
-<h3>&nbsp;&nbsp;&nbsp;Datenbank f&uuml;r die Administration und Infrastruktur im FHI</h3>
+<?php 
+    echo "<div class='float-r smaller'>user: " . $_SESSION["userid"];
+    echo "&nbsp;&nbsp;&nbsp;<a href='/fhiiqm/pw_change.php' title='PW &auml;ndern'>pw &auml;ndern</a>";
+    echo "&nbsp;&nbsp;&nbsp;<a href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
 
-<?php 
-    include_once($_SERVER["DOCUMENT_ROOT"] . "/fhiiqm/inc/menu.inc.html");
-//    session_start();
+    echo "<div id=\"navi\">\n
+        <h3>&nbsp;&nbsp;&nbsp;Datenbank f&uuml;r die Administration und Infrastruktur im FHI</h3>\n";
 //    print_r ($_SESSION['recht']);
+    
+    include_once($_SERVER["DOCUMENT_ROOT"] . "/fhiiqm/inc/menu.inc.php");
 ?>
 </div>
-<div id="renavi" align="right"><img src="img/fhi.jpg" border="0" alt="FHI" width="100%"/>&nbsp;&nbsp;&nbsp;</div>
+<div id="renavi" align="right"><img src="/fhiiqm/img/fhi.jpg" border="0" alt="FHI" width="100%"/>&nbsp;&nbsp;&nbsp;</div>
 
 </body>
 </html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/start_without_right.php	Wed Oct 05 16:46:09 2011 +0200
@@ -0,0 +1,26 @@
+<!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">
+
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+   	<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+   	<link href="css/navio.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+	<meta name="author" content="Bettina Schwarzer, FHI" />
+
+	<title>FHI Administration</title>
+</head>
+
+<body>
+<div id="navi">
+<h3>&nbsp;&nbsp;&nbsp;Datenbank f&uuml;r die Administration und Infrastruktur im FHI</h3>
+
+<?php 
+    include_once($_SERVER["DOCUMENT_ROOT"] . "/fhiiqm/inc/menu.inc.html");
+//    session_start();
+//    print_r ($_SESSION['recht']);
+?>
+</div>
+<div id="renavi" align="right"><img src="img/fhi.jpg" border="0" alt="FHI" width="100%"/>&nbsp;&nbsp;&nbsp;</div>
+
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/vertrag_flist1.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/vertrag_flist1.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,30 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 7/2011
+ * 
+ * Liste Vertragsdaten mit Sortierung und Filter
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_flist1.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_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">
 
@@ -17,19 +44,14 @@
 </head>
 
 <body onload="document.ffilter.filter.focus();">
-    <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertr&auml;ge" title="Vertr&auml;ge"/></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\">&nbsp;&nbsp;&nbsp;<img src=\"img/document_mark_as_final.png\" border=\"0\" alt=\"Vertr&auml;ge\" title=\"Vertr&auml;ge\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 7/2011
- * 
- * Liste Vertragsdaten mit Sortierung und Filter
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
     $zeil = $_GET["z"];
     if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
     $start = $_GET["st"];   // Start bei DS $start+1
@@ -58,7 +80,7 @@
     
 //    echo "sort=$sort, fnum=$fnum, filter=$filter <br />";
     include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
-    include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+    include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
 	$dbc = new dbconnection();
     
     echo "<div align='center'>\n";
@@ -175,7 +197,8 @@
     $dbc -> close();
     
     echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_flist2.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Vertr&auml;ge Teil 2</a></p>\n";
-    echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_ins.php\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";    
+    if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/vertrag_ins.php\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";    
 
 ?>
 
--- a/fhiiqm/vertrag_flist2.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/vertrag_flist2.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,30 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 7/2011
+ * 
+ * Liste Vertragsdaten mit Sortierung
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_flist2.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_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">
 
@@ -10,19 +37,14 @@
 </head>
 
 <body>
-    <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertr&auml;ge" title="Vertr&auml;ge"/></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\">&nbsp;&nbsp;&nbsp;<img src=\"img/document_mark_as_final.png\" border=\"0\" alt=\"Vertr&auml;ge\" title=\"Vertr&auml;ge\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 7/2011
- * 
- * Liste Vertragsdaten mit Sortierung
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
     $zeil = $_GET["z"];
     if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
     $start = $_GET["st"];   // Start bei DS $start+1
@@ -64,7 +86,7 @@
     }
 */    
     include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
-    include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+    include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
 	$dbc = new dbconnection();
 
     $sql = "CALL fhiiqm.vertrag_flist2(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "',$start,$zeil, @anz, @ganz)";
@@ -166,7 +188,8 @@
         print_r ($dbc -> error);
     }
     $dbc -> close();
-    echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"vertrag_ins.php\" class=\"sc\" target=\"_self\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";    
+    if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
+        echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"vertrag_ins.php\" class=\"sc\" target=\"_self\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";    
 
 ?>
 </body>
--- a/fhiiqm/vertrag_ins.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/vertrag_ins.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,30 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 05/2011
+ *
+ * INSERT Vertragsdaten   
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_ins.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_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 +36,14 @@
 </head>
 
 <body>
-    <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Vertragsdaten eingeben" title="Vertragsdaten eingeben"/></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/document_mark_as_final.png\" border=\"0\" alt=\"Vertragsdaten eingeben\" title=\"Vertragsdaten eingeben\"/></div>\n";
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 05/2011
- *
- * INSERT Vertragsdaten   
- */
-
-    error_reporting(E_ALL ^ E_NOTICE);
-    
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
     include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
 	//$dbc = new dbconnection();
@@ -57,11 +79,14 @@
 			echo "></td>\n</tr>\n"; 
 		}
 		
-		echo "<tr>\n";
-		echo "
-		  <td>&nbsp;</td>
-		  <td><input class=\"button\" type=\"submit\" value=\"eingeben\" name=\"ins\" title=\"insert\" /></td>\n";
-		echo "</tr>\n";
+        if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
+        {
+    		echo "<tr>\n";
+    		echo "
+    		  <td>&nbsp;</td>
+    		  <td><input class=\"button\" type=\"submit\" value=\"eingeben\" name=\"ins\" title=\"insert\" /></td>\n";
+    		echo "</tr>\n";
+        }    
         echo "</table>\n";
         echo "</div>\n";
         echo "</form>\n";	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/vertrag_report.php	Wed Oct 05 16:46:09 2011 +0200
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 08/2011
+ * 
+ * Liste Partner
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_report.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_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">
+
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+   	<link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+   	<link href="css/navio.css" rel="STYLESHEET" type="TEXT/CSS" /> 
+	<meta name="author" content="Bettina Schwarzer,FHI" />
+
+	<title>Reports Vertrag</title>
+</head>
+
+<body>
+<?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";
+?>
+    <div class="float-r"><img src="/fhiiqm/img/document_mark_as_final.png" border="0" alt="Bericht" title="Bericht"/></div>
+    <h3>&nbsp;&nbsp;&nbsp;Berichte zu Vertr&auml;gen</h3>
+    <div align="center">
+    <table width="94%" cellspacing="4" cellpadding="4">
+        <tr>
+            <td class="bigger">
+                <a href="/fhiiqm/report/vertrag_report_kost.php" title="Vertr&auml;ge - Kosten">Vertr&auml;ge und Kosten pro Jahr</a>
+                <br />&nbsp;&nbsp;&nbsp;Auswahl: Produktgruppe, Produkt, Vertragstyp, Kostenjahr
+                <br />&nbsp;&nbsp;&nbsp;Ansicht: Vertragsbezeichnung, -beschreibung, Vertragstyp, Kosten, Kostenjahr
+            </td>
+        </tr>
+        <tr>
+            <td class="bigger">
+                <a href="/fhiiqm/report/vertrag_report_kuend.php" title="Vertr&auml;ge - K&uuml;ndigungstermin">Vertr&auml;ge - K&uuml;ndigungstermin</a>
+                <br />&nbsp;&nbsp;&nbsp;Auswahl: Produktgruppe, Vertragstyp, gew&uuml;nschtes K&uuml;ndigungsdatum
+                <br />&nbsp;&nbsp;&nbsp;Ansicht: Vertragsbezeichnung, -beginn, -ende, Verlängerung, Kündigungsfrist(mon), 
+                    Produktgruppe, Vertragstyp, Partner, K&uuml;ndigung zum
+            </td>
+        </tr>
+    </table>
+    </div>    
+
+
+</body>
+</html>
\ No newline at end of file
--- a/fhiiqm/vertrag_search.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/vertrag_search.php	Wed Oct 05 16:46:09 2011 +0200
@@ -9,6 +9,20 @@
 
     error_reporting(E_ALL ^ E_NOTICE);
     
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_search.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"])))
+    {
+        header("Location: start.php");
+        exit;
+    }    
+
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
 	$dbc = new dbconnection();
 
@@ -17,7 +31,7 @@
     $cid = trim(substr($cname,0,strpos($cname,"-")));
 //    echo "cname = $cname, cid = $cid<br />\n";
     if (isset($cid) && $cid) 
-        header("Location: http://achilleus/fhiiqm/vertrag_upd.php?uid=$cid");
+        header("Location: vertrag_upd.php?uid=$cid");
     else
     {
 ?>
@@ -35,7 +49,13 @@
         </head>
         
         <body>
-        <div class="float-r"><img src="/fhiiqm/img/document_mark_as_final.png" border="0" alt="Vertragssuche" title="Vertragssuche"/></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/document_mark_as_final.png\" border=\"0\" alt=\"Vertragssuche\" title=\"Vertragssuche\"/></div>\n";
+        ?>
         <script>
           $(document).ready(function() {
             $("#conbez").focus();
--- a/fhiiqm/vertrag_upd.php	Tue Sep 27 14:59:40 2011 +0200
+++ b/fhiiqm/vertrag_upd.php	Wed Oct 05 16:46:09 2011 +0200
@@ -1,3 +1,29 @@
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 05/2011
+ *
+ * UPDATE/DELETE Vertragsdaten   
+ */
+
+    error_reporting(E_ALL ^ E_NOTICE);
+    
+    session_start();
+    if (! isset($_SESSION["userid"]))
+    { 
+        include_once ("inc/func_lib.inc.php");	
+        login("vertrag_upd.php");
+        exit;
+    }
+    
+    if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_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/document_mark_as_final.png" border="0" alt="Vertragsdaten bearbeiten" title="Vertragsdaten bearbeiten"/></div>
-
-<?php
 
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 05/2011
- *
- * UPDATE/DELETE Vertragsdaten   
- */
+<?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/document_mark_as_final.png\" border=\"0\" alt=\"Vertragsdaten bearbeiten\" title=\"Vertragsdaten bearbeiten\"/></div>\n";
 
-    error_reporting(E_ALL ^ E_NOTICE);
-    
 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
     include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
 	$dbc = new dbconnection();
@@ -139,16 +160,21 @@
     		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("ve",$_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";
-        echo "</form>\n";	
-
+        if (!is_null($_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"]))
+            echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"vertrag_flist1.php\" target=\"_self\" title=\"Vertragsliste\">Zur&uuml;ck zur Vertragsliste</a></p>\n";    
+        echo "</form>\n";
+        	
     }
     elseif ($ok && $upd)
     {