Code

Fixed filter, POST/GET wasn't catched correct.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Jul 2006 04:58:38 +0000 (04:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Jul 2006 04:58:38 +0000 (04:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4086 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/posix/class_posixAccount.inc

index b72840a3f6da714c7a64e5685f40bca7c8e7c3af..53ef503de3b3f2ca44bb13de75b1a45fd3c57abd 100644 (file)
@@ -390,16 +390,6 @@ class posixAccount extends plugin
     /* Manage group add dialog */
     if ($this->group_dialog){
 
-      /* Get Posts */ 
-      if(isset($_POST['depselect'])){
-        if(isset($_POST['regex'])){
-          $this->GroupRegex = $_POST['regex'];
-        }  
-        if(isset($_POST['guser'])){
-          $this->GroupUserRegex = $_POST['guser'];
-        }  
-      }
-
       /* Get global filter config */
       $this->reload();
 
@@ -681,13 +671,29 @@ class posixAccount extends plugin
         }
       }
     }
+
+    /* Get regex from alphabet */
+    if(isset($_GET['search'])){
+      $this->GroupRegex = $_GET['search']."*";
+    }
+
+    /* Check checkboxes and regexes */
     if(isset($_POST["PosixGroupDialogPosted"])){
       if(isset($_POST['SubSearch']) && ($_POST['SubSearch'])){
         $this->SubSearch = true;
       }else{
         $this->SubSearch = false;
       }
+    
+      if(isset($_POST['guser'])){
+        $this->GroupUserRegex = $_POST['guser'];
+      }
+      if(isset($_POST['regex'])){
+        $this->GroupRegex = $_POST['regex'];
+      }
     }
+    $this->GroupRegex = preg_replace("/\*\**/","*",$this->GroupRegex);
+    $this->GroupUserRegex = preg_replace("/\*\**/","*",$this->GroupUserRegex);
   }
 
 
@@ -1090,7 +1096,7 @@ class posixAccount extends plugin
 
     /* Get groups */
     if ($this->GroupUserRegex == '*'){
-      $filter = "(objectClass=posixGroup)";
+      $filter = "(&(objectClass=posixGroup)(cn=".$this->GroupRegex."))";
     } else {
       $filter= "(&(objectClass=posixGroup)(cn=".$this->GroupRegex.")(memberUid=".$this->GroupUserRegex."))";
     }