Code

Fixed filter reset, if group is added
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Aug 2005 08:57:22 +0000 (08:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 2 Aug 2005 08:57:22 +0000 (08:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1045 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_userManagement.inc
plugins/admin/users/headpage.tpl

index 7e8d1ea0f6e21186b3180e25a81501f7c43a7574..9e60df1662052f3229b90c2a1a4f63f1fdb2c3c3 100644 (file)
@@ -41,7 +41,7 @@ class userManagement extends plugin
     $this->ui= $ui;
 
     /* Get global filter config */
-    if (!is_global("userfilter")){
+    if (!isset($_SESSION["userfilter"])){
       $base= get_base_from_people($ui->dn);
       $userfilter= array( "mailusers"       => "checked",
           "unixusers"       => "checked",
@@ -53,7 +53,7 @@ class userManagement extends plugin
           "functionalusers" => "checked",
           "depselect"       => $base,
           "regex"           => "*");
-      register_global("userfilter", $userfilter);
+      $_SESSION["userfilter"] = $userfilter;
     }
   }
 
@@ -143,13 +143,11 @@ class userManagement extends plugin
 
     /* Save filter data if we are in the headpage */
     if (!isset($this->usertab)){
-      foreach( array("regex") as $type){
-        if (isset($_POST[$type])){
-          $userfilter[$type]= $_POST[$type];
-        }
+      if (isset($_POST['regexit'])){
+        $userfilter["regex"]= $_POST['regexit'];
       }
     }
-    if(isset($_POST['regex'])){
+    if(isset($_POST['regexit'])){
       foreach( array("functionalusers", "unixusers", "mailusers","sambausers", "proxyusers", "faxusers", "templates", "subsearch") as $type){
         if (isset($_POST[$type])) {
           $userfilter[$type]= "checked";
@@ -739,13 +737,14 @@ class userManagement extends plugin
     $smarty->assign("infoimage", get_template_path('images/info.png'));
     $smarty->assign("launchimage", get_template_path('images/launch.png'));
     $smarty->assign("deplist", $this->config->idepartments);
-    foreach( array("depselect", "regex", "functionalusers", "unixusers",
+    foreach( array("depselect",  "functionalusers", "unixusers",
           "mailusers", "sambausers", "proxyusers", 
           "faxusers", "templates", "subsearch") as $type){
 
       $smarty->assign("$type", $userfilter[$type]);
     }
 
+    $smarty->assign("regex", $userfilter["regex"]);
     /* Extend if we are not using javascript */
     $smarty->assign("apply", apply_filter());
     $smarty->assign("alphabet", generate_alphabet());
index 1c31477e4ad92dff8a50f40c2915ede4fd7ec3d6..22304bac080fea28653fb7523aad2377c8963da7 100644 (file)
@@ -46,7 +46,7 @@
         </tr>
     </table>
     <table summary="" width="100%" style="border-top:1px solid #B0B0B0;"><tr><td><img alt="Search" src="{$search_image}" align="middle" title="{t}Display users matching{/t}"></td>
-    <td><LABEL for='filter'>{t}Display users matching{/t}</LABEL></td><td><input id='filter' style='width:99%' type='text' name='regex' maxlength='20' value='{$regex}' title='{t}Regular expression for matching user names{/t}' onChange="mainform.submit()"></td></tr></table>
+    <td><LABEL for='filter'>{t}Display users matching{/t}</LABEL></td><td><input id='filter' style='width:99%' type='text' name='regexit' maxlength='20' value='{$regex}' title='{t}Regular expression for matching user names{/t}' onChange="mainform.submit()"></td></tr></table>
    {$apply}
    </div>
   </td>