Code

Speed up for group id generation
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 31 Jan 2006 09:42:40 +0000 (09:42 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 31 Jan 2006 09:42:40 +0000 (09:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2608 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupGeneric.inc
plugins/personal/posix/class_posixAccount.inc

index 3557ccf66055daef16c57f07564e53bbd4bcaab3..2dde3c6ecc37f415ea89c2f9f8e90565186d3386 100644 (file)
@@ -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()){
index 72d5ce1cb57574033e9a92638f97555e53bd313d..be868c57d0cfc1ef5ddeb11de7a9a12e29110a59 100644 (file)
@@ -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()){