From: hickert Date: Mon, 15 Oct 2007 08:28:23 +0000 (+0000) Subject: Save plug id in cookie too X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d828dc420b85fb0fb3c8542fdc912a86ce839e46;p=gosa.git Save plug id in cookie too git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7546 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/index.php b/html/index.php index 5f8850dbe..ddece7ad4 100644 --- a/html/index.php +++ b/html/index.php @@ -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."&global_check=1"); + }else{ header ("Location: main.php?global_check=1"); - exit; } + exit; } } } diff --git a/html/main.php b/html/main.php index be42f673a..da788e67e 100644 --- a/html/main.php +++ b/html/main.php @@ -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... */