Code

Updated filtering again
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 13:25:25 +0000 (13:25 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 13:25:25 +0000 (13:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8355 594d385d-05f5-0310-b6e9-bd551577e9d8

21 files changed:
include/class_plugin.inc
plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/departments/class_departmentManagement.inc
plugins/admin/groups/class_groupGeneric.inc
plugins/admin/mimetypes/class_mimetypeGeneric.inc
plugins/admin/systems/class_componentGeneric.inc
plugins/admin/systems/class_phoneGeneric.inc
plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_servGeneric.inc
plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/class_terminalService.inc
plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/class_winGeneric.inc
plugins/admin/systems/class_workstationGeneric.inc
plugins/admin/systems/class_workstationService.inc
plugins/admin/systems/class_workstationStartup.inc
plugins/generic/references/class_reference.inc
plugins/gofon/conference/class_phoneConferenceManagment.inc
plugins/gofon/macro/class_gofonMacro.inc
plugins/personal/generic/class_user.inc
setup/class_setupStep_Migrate.inc

index 8e992dccc33c03b894848d7fe53767a16b168040..e84ddec657b4b875b855927b819211f7f6177b14 100644 (file)
@@ -691,7 +691,7 @@ class plugin
   {
     /* Rename dn in possible object groups */
     $ldap= $this->config->get_ldap_link();
-    $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::fix($src_dn).'))',
+    $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::prepare4filter($src_dn).'))',
         array('cn'));
     while ($attrs= $ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
index 8d9620bc719ca467509e6bef4f92cf8167f5b55e..33b0267a4a43f2ce828ce7b675c0a390e931cd61 100644 (file)
@@ -210,7 +210,7 @@ class application extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index 5c715a2c482d0a3550f7ae5d2cd1cb2e12db1c13..8822f8ef98abab9c73803a0fbd53aaa587b8557f 100644 (file)
@@ -359,7 +359,7 @@ class departmentManagement extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index a586a6695330fe92882abc801dc7958a9e8725cd..8c973636c0cdb3ec00a65c7c7308cdb87f0e391c 100644 (file)
@@ -519,7 +519,7 @@ class group extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index e3e4147ae31b6b3766f705993df55a61d99f6d39..719f419e393a7a077201f436e9fbf01cd0154edb 100644 (file)
@@ -477,7 +477,7 @@ class mimetype extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index 09ca79507a9c22c524a0961d8fc16f3f59908b52..7d1a9088cbd87c61041c3342f6270cfefb4fa9f7 100644 (file)
@@ -112,7 +112,7 @@ class componentGeneric extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index 0374211aec1af26666802a851a6ad6db25182412..88a4d728b9cadcfcdab92537c9c49686906f1bc0 100644 (file)
@@ -257,7 +257,7 @@ class phoneGeneric extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index 1345146e6cc60db8a5abbae64c5272fab669831e..d2f3b6beaf826d3b6f86b6043a7c1542441894fe 100644 (file)
@@ -589,7 +589,7 @@ class printgeneric extends plugin
 
       /* Delete references to object groups */
       $ldap->cd ($this->config->current['BASE']);
-      $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+      $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
       while ($ldap->fetch()){
         $og= new ogroup($this->config, $ldap->getDN());
         unset($og->member[$this->dn]);
index ca9ed1740a3798b87696fbabfbccb3d90d14b6a0..d17b6d92da1ca6c570df74e77a5630684aa0e50d 100644 (file)
@@ -210,7 +210,7 @@ class servgeneric extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index aa593d854fde9d879826e411e02c15fec262416c..8f09b5a1782d29b253a43b03dec987e4139e7630 100644 (file)
@@ -67,7 +67,7 @@ class termgeneric extends plugin
     if(!isset($this->parent->by_object['ogroup'])){
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->config->current['BASE']);
-      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))",array("cn"));
       $this->member_of_ogroup = $ldap->count() >= 1;
     }
 
index e38f27b14f1cb3e6fee0d3565ef971e48ab75d8d..86b22049bfd5334333b7f9b7ec59aaaf872ad8e7 100644 (file)
@@ -193,7 +193,7 @@ class termservice extends plugin
       /* Load hardware list */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
+    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))");
     if ($ldap->count() == 1){
       $map= array("gotoXResolution", "gotoXColordepth", "gotoXKbModel", "gotoXKbLayout",
                   "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport");
index f8f27fb61b229883ef5bdf23a57713e7ba306a9a..315cbdaa55fa9a0135245bf5808aded83940c1c8 100644 (file)
@@ -124,7 +124,7 @@ class termstartup extends plugin
      /* Load hardware list */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
+    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))");
     if ($ldap->count() == 1){
       $map= array("gotoLdapServer","gotoBootKernel");
       $attrs= $ldap->fetch();
index d73f766a809f32c3156dc92ea425755040600d5a..458478d76cfde24712fe9409762d06ab56e703b4 100644 (file)
@@ -139,7 +139,7 @@ class wingeneric extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index 7bac83ba5d6ff3a5dec65ace758523646d7f632d..68715759660287eabd6f063d5df7b4884b6d826b 100644 (file)
@@ -75,7 +75,7 @@ class workgeneric extends plugin
     if(!isset($this->parent->by_object['ogroup'])){
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->config->current['BASE']);
-      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".normalizeLdap(preg_replace('/\\\\/', '\\\\\\', LDAP::fix($this->dn)))."))",array("cn"));
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))",array("cn"));
       $this->member_of_ogroup = $ldap->count() >= 1;
     }
 
@@ -329,7 +329,7 @@ class workgeneric extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index d28da81585d24c54400bb6e7214666b9bad2bd19..9d5cb5414c8446f8ede5808404d220f95f697f9d 100644 (file)
@@ -176,7 +176,7 @@ class workservice extends plugin
     /* Load hardware list */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
+    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))");
     if ($ldap->count() == 1){
       $map= array("gotoXResolution", "gotoXColordepth", "gotoXKbModel", "gotoXKbLayout",
                   "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport");
index 0f47013a881e76eb534cea75ce53d47d1120e4e5..0874a2814a86ac9bb92c3b4b9d9ad98d41428691 100644 (file)
@@ -71,7 +71,7 @@ class workstartup extends plugin
     if(!isset($this->parent->by_object['ogroup'])){
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->config->current['BASE']);
-      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn","dn"));
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))",array("cn","dn"));
       if($ldap->count()){
         $this->member_of_ogroup = TRUE;
         $attrs = $ldap->fetch();
index 4edf6c07342b917eaea02318e6d56428aeb8fa61..14ece4541c06bdd9b8bf0eefffd2f4ab4ad76f58 100644 (file)
@@ -82,7 +82,7 @@ class reference extends plugin
   {
        $ldap= $this->config->get_ldap_link();
        $ldap->cd($this->config->current['BASE']);
-       $ldap->search("(|(member=".normalizeLdap(preg_replace('/\\\\/', '\\\\\\', LDAP::fix($this->dn))).")(memberUid=".$this->uid."))",array("memberUid","member","cn","description","objectClass"));
+       $ldap->search("(|(member=".LDAP::prepare4filter($this->dn).")(memberUid=".$this->uid."))",array("memberUid","member","cn","description","objectClass"));
        
        $cycle= array("F5F5F5", "ECECEC");
        $id= 0;
index a19bbe840cbcdf43127c9ea6e5fdf5e2833f305d..4fe04702422588690258aeb041095855eb8772ca 100644 (file)
@@ -291,7 +291,7 @@ class phoneConferenceManagment extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new conftab($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index b3ac8d45624d75026ceebec510e66b76017cdbb9..cce8bb427205f70c3a8e004947d9540a065b0cb5 100755 (executable)
@@ -454,7 +454,7 @@ class macro extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index f6147405de6a0b43f84ecb81bfc7fdc5d11884d4..41093363189083a9f33aed3143af20413af5aceb 100644 (file)
@@ -579,7 +579,7 @@ class user extends plugin
 
     /* Delete references to object groups */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
     while ($ldap->fetch()){
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
index 3fbf17ab8ca43853cc052237a6a96d235f58750d..1a82f6d1f8cc5528c84e70a2745808fd5432e381 100644 (file)
@@ -1090,7 +1090,7 @@ class Step_Migrate extends setup_step
 
 
           /* Check if there are references to this object */
-          $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
+          $ldap->search("(&(member=".LDAP::prepare4filter($dn).")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
           $refs = "";
           while($attrs = $ldap->fetch()){
             $ref_dn = $attrs['dn'];
@@ -1138,7 +1138,7 @@ class Step_Migrate extends setup_step
 
 
           /* Check if there are references to this object */
-          $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
+          $ldap->search("(&(member=".LDAP::prepare4filter($dn).")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
           $refs = "";
           while($attrs = $ldap->fetch()){
             $ref_dn = $attrs['dn'];
@@ -1185,7 +1185,7 @@ class Step_Migrate extends setup_step
           $this->outside_users[$b_dn]['ldif'] = _("User will be moved from").":<br>\t".$dn."<br>"._("to").":<br>\t".$d_dn;
 
           /* Check if there are references to this object */
-          $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
+          $ldap->search("(&(member=".LDAP::prepare4filter($dn).")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
           $refs = "";
           while($attrs = $ldap->fetch()){
             $ref_dn = $attrs['dn'];
@@ -1879,7 +1879,7 @@ class Step_Migrate extends setup_step
      /* Update object references in gosaGroupOfNames */
     $ogs_to_fix = array();
     $ldap->cd($cv['base']);
-    $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::fix($source).'))', array('cn','member'));
+    $ldap->search('(&(objectClass=gosaGroupOfNames)(member='.@LDAP::prepare4filter($source).'))', array('cn','member'));
     while ($attrs= $ldap->fetch()){
       $dn = $attrs['dn'];
       $attrs = $this->cleanup_array($attrs);