From 827f6e53d5b36d9841c580f5da0551496d4c8654 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 31 Jan 2006 09:42:40 +0000 Subject: [PATCH] Speed up for group id generation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2608 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_groupGeneric.inc | 7 ++++++- plugins/personal/posix/class_posixAccount.inc | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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()){ -- 2.30.2