Code

Added gosa.conf(ig) flag 'save_filter'.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 11:50:28 +0000 (11:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 11:50:28 +0000 (11:50 +0000)
if save_filter is 'true' the current filter settings will be stored in a seperate user cookie

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7304 594d385d-05f5-0310-b6e9-bd551577e9d8

contrib/gosa.conf
html/index.php
html/main.php
setup/class_setupStep_Config3.inc
setup/setup_config3.tpl

index a7a4f2637c32e5c7ec0ceffd7adbe42d417c6a1a..0de32e9a128c4905ade339ca66f2cd6478fd7542 100644 (file)
 {/if}
 {if $cv.optional.auto_network_hook_active}
                auto_network_hook="{$cv.optional.auto_network_hook} "
+{/if}
+{if $cv.optional.user_filter_cookie}
+               save_filter="true"
+{else}
+               save_filter="false"
 {/if}
                lang="{$cv.lang_selected}"
                theme="{$cv.theme}"
index f525d267cfc09398d6467fceec4ce2e7ad3f6bbc..2f7a401ae34ee8c69b541c26fb3b8fb154f74402 100644 (file)
@@ -282,12 +282,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
 
       /* 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]));
+      if(isset($config->data['MAIN']['SAVE_FILTER']) && preg_match("/true/",$config->data['MAIN']['SAVE_FILTER'])){
+        $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]));
+          }
         }
       }
 
index a2db883ebd2a9557158a695b2826565421b75a25..c56a231753b1217c5ad150f15d8a9256295c5f93 100644 (file)
@@ -386,10 +386,12 @@ $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);
+if(isset($config->data['MAIN']['SAVE_FILTER']) && preg_match("/true/",$config->data['MAIN']['SAVE_FILTER'])){
+  $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);
+    }
   }
 }
 
index 9148868ef95cd131e996bfec6dc7a0b17272de33..cb1d28c8ad91a3ba9726631f6dce1e718e3760af 100644 (file)
@@ -33,6 +33,7 @@ class Step_Config3 extends setup_step
               "forcessl" => false,
               "ldapstats" => false,
               "warnssl" => true,
+              "user_filter_cookie" => true,
               "ppd_path" => "/var/spool/ppd/",
               "ppd_path_active" => FALSE,
               "compile" =>  "/var/spool/gosa",
@@ -97,7 +98,7 @@ class Step_Config3 extends setup_step
         }
       }
       
-      foreach(array("list_summary","strict_units","noprimarygroup","forceglobals","forcessl","ldapstats","warnssl","compile","debuglevel","session_lifetime") as $name){
+      foreach(array("list_summary","strict_units","noprimarygroup","forceglobals","forcessl","ldapstats","user_filter_cookie","warnssl","compile","debuglevel","session_lifetime") as $name){
         if(isset($_POST[$name])){
           $this->optional[$name] = get_post($name);
         }
index 47c2a42301f7d59faf7ccd6a6e87d756612e9bb4..724bae7157a785a94d655e63680a843efe592522 100644 (file)
         </div>
     </div>
 
+    <div class='step4_container'>
+        <div class='step4_name'>
+            {t}Remember dialog filter settings{/t}
+        </div>
+        <div class='step4_value'>
+       
+            <select name="user_filter_cookie" size="1" title="">
+               {html_options options=$bool selected=$optional.user_filter_cookie}
+            </select>
+        </div>
+    </div>
+
     <div class='step4_container'>
         <div class='step4_name'>
             {t}Session lifetime{/t}