Code

Added some searchfilter attributes, this should be a little faster
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jan 2006 15:10:53 +0000 (15:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jan 2006 15:10:53 +0000 (15:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2469 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/groups/class_groupApplication.inc
plugins/admin/groups/class_groupGeneric.inc
plugins/admin/groups/class_groupMail.inc

index 58895c8eabd0283a5bf7e83a1084ac2220ecde25..a018486a7b785022facd6c1f126193001832bfef 100644 (file)
@@ -322,7 +322,7 @@ class application extends plugin
        /* Check for existing application */
        $ldap= $this->config->get_ldap_link();
        $ldap->cd($this->config->current["BASE"]);
-       $ldap->search("(&(objectClass=gosaApplication)(cn=$this->cn))");
+       $ldap->search("(&(objectClass=gosaApplication)(cn=$this->cn))",array("cn"));
        $ldap->fetch();
        if ($ldap->count() != 0 && $this->dn == "new"){
                $message[]= _("There's already an application with this 'Name'.");
index c899f0bff70e22847d848ea9c76660fc57f26132..05c1160e498545005e44e40f08e595ad7c17ed84 100644 (file)
@@ -387,7 +387,7 @@ class appgroup extends plugin
         /* We've got the appname, get parameters from ldap */
         $ldap= $this->config->get_ldap_link();
         $ldap->cd($this->config->current['BASE']);
-        $ldap->search("(&(objectClass=gosaApplication)(cn=$appname))");
+        $ldap->search("(&(objectClass=gosaApplication)(cn=$appname))",array("gosaApplicationParameter"));
         if ($ldap->count() != 1){
           print_red (_("The selected application name is not uniq. Please check your LDAP."));
         } else {
index 6cddc632133cc82092263961e789f481e12ecfdb..64a49bf18b315aad591092e7f9e8419c1a34ebef 100644 (file)
@@ -93,7 +93,7 @@ class group extends plugin
       $this->SID= preg_replace ("/-[^-]+$/", "", $this->sambaSID);
       $ldap= $this->config->get_ldap_link();
       $ldap->cd($this->config->current['BASE']);
-      $ldap->search ("(&(objectClass=sambaDomain)(sambaSID=$this->SID))");
+      $ldap->search ("(&(objectClass=sambaDomain)(sambaSID=$this->SID))",array("sambaAlgorithmicRidBase"));
       if ($ldap->count() != 0){
         $attrs= $ldap->fetch();
         $this->ridBase= $attrs['sambaAlgorithmicRidBase'][0];
@@ -521,7 +521,7 @@ class group extends plugin
           while(TRUE){
             $sid= $this->SID."-".($gidNumber*2 + $this->ridBase+1);
             $ldap->cd($this->config->current['BASE']);
-            $ldap->search("(sambaSID=$sid)");
+            $ldap->search("(sambaSID=$sid)",array("sambaSID"));
             if ($ldap->count() == 0){
               break;
             }
@@ -635,7 +635,7 @@ class group extends plugin
     /* Check for used 'cn' */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(&(|(objectClass=gosaGroupOfNames)(objectClass=posixGroup))(cn=$this->cn))");
+    $ldap->search("(&(|(objectClass=gosaGroupOfNames)(objectClass=posixGroup))(cn=$this->cn))",array("cn"));
     if ($ldap->count() != 0){
 
       /* New entry? */
@@ -673,7 +673,7 @@ class group extends plugin
     $ldap= $this->config->get_ldap_link();
 
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("($attrib=*)");
+    $ldap->search ("($attrib=*)",array($attrib));
 
     /* Get list of ids */
     while ($attrs= $ldap->fetch()){
index 750437be9a5360dd2335cc9588e83c05f919f474..ca5549fe3d17c70b42d9673b424b94db4e2d3b4c 100644 (file)
@@ -625,8 +625,7 @@ class mailgroup extends plugin
       $message[]= _("Please enter a valid email addres in 'Primary address' field.");
     }
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".
-        $this->mail."))(!(uid=".$this->cn."))(!(cn=".$this->cn.")))");
+    $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".$this->mail."))(!(uid=".$this->cn."))(!(cn=".$this->cn.")))",array("uid"));
     if ($ldap->count() != 0){
       $message[]= _("The primary address you've entered is already in use.");
     }
@@ -715,8 +714,7 @@ class mailgroup extends plugin
 
     /* Is this address already assigned in LDAP? */
     $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaMailAccount)(|(mail=$address)".
-        "(gosaMailAlternateAddress=$address)))");
+    $ldap->search ("(&(objectClass=gosaMailAccount)(|(mail=$address)"."(gosaMailAlternateAddress=$address)))",array("uid"));
 
     if ($ldap->count() > 0){
       $attrs= $ldap->fetch ();