From: hickert Date: Mon, 17 Sep 2007 09:51:21 +0000 (+0000) Subject: Save current base and filter options in a cookie on client side X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c9595589e73f7e3e62b4032908bd3b3974514c2e;p=gosa.git Save current base and filter options in a cookie on client side git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7303 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/index.php b/html/index.php index 77c375bc9..f525d267c 100644 --- a/html/index.php +++ b/html/index.php @@ -280,6 +280,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){ $_SESSION['PHP4COMPATIBLE']= TRUE; } + /* Restore filter settings from cookie, if available + */ + $cookie_vars= array("MultiDialogFilters","CurrentMainBase"); + foreach($cookie_vars as $var){ + if(isset($_COOKIE[$var])){ + $_SESSION[$var] = unserialize(base64_decode($_COOKIE[$var])); + }elseif(isset($HTTP_COOKIE_VARS[$var])){ + $_SESSION[$var] = unserialize(base64_decode($HTTP_COOKIE_VARS[$var])); + } + } + /* are we using accountexpiration */ if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) && preg_match('/true/i', $config->data['MAIN']['ACCOUNT_EXPIRATION'])){ diff --git a/html/main.php b/html/main.php index 4dfe7477e..a2db883eb 100644 --- a/html/main.php +++ b/html/main.php @@ -383,6 +383,16 @@ $smarty->assign("focus", $focus); $display= $header.$smarty->fetch(get_template_path('framework.tpl')); +/* Save dialog filters and selected base in a cookie. + So we may be able to restore the filter an base settings on reload. +*/ +$cookie_vars = array("MultiDialogFilters","CurrentMainBase"); +foreach($cookie_vars as $var){ + if(isset($_SESSION[$var])){ + setcookie($var,base64_encode(serialize($_SESSION[$var])),time()+ 60*60*24*30); + } +} + /* Show page... */ echo $display;