From: cajus Date: Tue, 15 Jan 2008 13:25:25 +0000 (+0000) Subject: Updated filtering again X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9bd5e2a21394fc3282170ab76e31a7bb632c9548;p=gosa.git Updated filtering again git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8355 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 8e992dccc..e84ddec65 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -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()); diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 8d9620bc7..33b0267a4 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -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]); diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 5c715a2c4..8822f8ef9 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -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]); diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index a586a6695..8c973636c 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -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]); diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc index e3e4147ae..719f419e3 100644 --- a/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 09ca79507..7d1a9088c 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 0374211ae..88a4d728b 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 1345146e6..d2f3b6bea 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index ca9ed1740..d17b6d92d 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index aa593d854..8f09b5a17 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -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; } diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index e38f27b14..86b22049b 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -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"); diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index f8f27fb61..315cbdaa5 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -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(); diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index d73f766a8..458478d76 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 7bac83ba5..687157596 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -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]); diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index d28da8158..9d5cb5414 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -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"); diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 0f47013a8..0874a2814 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -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(); diff --git a/plugins/generic/references/class_reference.inc b/plugins/generic/references/class_reference.inc index 4edf6c073..14ece4541 100644 --- a/plugins/generic/references/class_reference.inc +++ b/plugins/generic/references/class_reference.inc @@ -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; diff --git a/plugins/gofon/conference/class_phoneConferenceManagment.inc b/plugins/gofon/conference/class_phoneConferenceManagment.inc index a19bbe840..4fe047024 100644 --- a/plugins/gofon/conference/class_phoneConferenceManagment.inc +++ b/plugins/gofon/conference/class_phoneConferenceManagment.inc @@ -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]); diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index b3ac8d456..cce8bb427 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -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]); diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index f6147405d..410933631 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -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]); diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc index 3fbf17ab8..1a82f6d1f 100644 --- a/setup/class_setupStep_Migrate.inc +++ b/setup/class_setupStep_Migrate.inc @@ -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").":
\t".$dn."
"._("to").":
\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);