From: cajus Date: Tue, 31 Jan 2006 09:42:40 +0000 (+0000) Subject: Speed up for group id generation X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=827f6e53d5b36d9841c580f5da0551496d4c8654;p=gosa.git Speed up for group id generation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2608 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index 3557ccf66..2dde3c6ec 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -673,7 +673,12 @@ class group extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd ($this->config->current['BASE']); - $ldap->search ("($attrib=*)",array($attrib)); + if (preg_match('/gidNumber/i', $attrib)){ + $oc= "posixGroup"; + } else { + $oc= "posixAccount"; + } + $ldap->search ("(&(objectClass=$oc)($attrib=*))", array("$attrib")); /* Get list of ids */ while ($attrs= $ldap->fetch()){ diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 72d5ce1cb..be868c57d 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -1048,7 +1048,12 @@ class posixAccount extends plugin $ldap= $this->config->get_ldap_link(); $ldap->cd ($this->config->current['BASE']); - $ldap->search ("($attrib=*)", array("$attrib")); + if (preg_match('/gidNumber/i', $attrib)){ + $oc= "posixGroup"; + } else { + $oc= "posixAccount"; + } + $ldap->search ("(&(objectClass=$oc)($attrib=*))", array("$attrib")); /* Get list of ids */ while ($attrs= $ldap->fetch()){