Code

Save plug id in cookie too
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 15 Oct 2007 08:28:23 +0000 (08:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 15 Oct 2007 08:28:23 +0000 (08:28 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7546 594d385d-05f5-0310-b6e9-bd551577e9d8

html/index.php
html/main.php

index 5f8850dbece6625246f950f5e22e9d1fea87164e..ddece7ad4db52876130fce1a2f78677e4dacfd09 100644 (file)
@@ -295,7 +295,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
       /* Restore filter settings from cookie, if available 
        */
       if(isset($config->data['MAIN']['SAVE_FILTER']) && preg_match("/true/",$config->data['MAIN']['SAVE_FILTER'])){
-        $cookie_vars= array("MultiDialogFilters","CurrentMainBase");
+        $cookie_vars= array("MultiDialogFilters","CurrentMainBase","plug");
         foreach($cookie_vars as $var){
           if(isset($_COOKIE[$var])){
             $_SESSION[$var] = unserialize(base64_decode($_COOKIE[$var]));
@@ -303,6 +303,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
             $_SESSION[$var] = unserialize(base64_decode($HTTP_COOKIE_VARS[$var]));
           }
         }
+        if(isset($_COOKIE['plug'])){
+          $plug = $_COOKIE['plug'];
+        }elseif($HTTP_COOKIE_VARS['plug']){
+          $plug = $HTTP_COOKIE_VARS['plug'];
+        }
       }
 
       /* are we using accountexpiration */
@@ -326,18 +331,16 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
             }
           }
         }
-
-        /* Not account expired or password forced change go to main page */
-        new log("security","login","",array(),"User \"$username\" logged in successfully") ;
-        header ("Location: main.php?global_check=1");
-        exit;
-
-      } else {
-        /* Go to main page */
-        new log("security","login","",array(),"User \"$username\" logged in successfully") ;
+      }
+      /* Not account expired or password forced change go to main page */
+      new log("security","login","",array(),"User \"$username\" logged in successfully") ;
+      $plist= new pluglist($config, $ui);
+      if(isset($plug) && isset($plist->dirlist[$plug])){
+        header ("Location: main.php?plug=".$plug."&amp;global_check=1");
+      }else{
         header ("Location: main.php?global_check=1");
-        exit;
       }
+      exit;
     }
   }
 }
index be42f673adb53aaee3934352a44cd71c3f1eab9a..da788e67e42efe173aa283652c8ad0954b9574ea 100644 (file)
@@ -62,7 +62,6 @@ if (!isset($_SESSION['config'])){
   exit;
 } 
 
-
 /* Check for uniqe ip address */
 $ui= $_SESSION["ui"];
 if ($_SERVER['REMOTE_ADDR'] != $ui->ip){
@@ -412,6 +411,9 @@ if(isset($config->data['MAIN']['SAVE_FILTER']) && preg_match("/true/",$config->d
       @setcookie($var,base64_encode(serialize($_SESSION[$var])),time()+ 60*60*24*30);
     }
   }
+  if(isset($_GET['plug'])){
+    @setcookie("plug", $_GET['plug'],time()+ 60*60*24*30);
+  }
 }
 
 /* Show page... */