Code

Fixed problem with not existen objectClass goFaxAccount && userslist
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Mar 2006 06:27:06 +0000 (06:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Mar 2006 06:27:06 +0000 (06:27 +0000)
All users will be dsiplayed everytime

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2840 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_userManagement.inc
plugins/gofax/faxaccount/class_gofaxAccount.inc

index c622ffbd27b65e9f6f0d72b849599c6840595c07..d3b3b46e4fe77cc10fc516c258ccb1e2045c3b57 100644 (file)
@@ -954,9 +954,29 @@ class userManagement extends plugin
       $samba= "sambaAccount";
     }
 
+
+    /* Sometimes not all users were displayed in the users list.
+       The problem was, that we search for an objectClass
+        which isn't used in every ldap-schema configuration.
+       Here we remove this class, if there is no result returned from 
+        our test search.
+    */
+    $ldap = $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+
+    $ldap->search("(objectClass=goFaxAccount)",array("cn","uid"));
+    if($ldap->fetch()){
+      $useFaxInFilter = true;
+      $FaxFilter = "(objectClass=goFaxAccount)";
+    } else {
+      $useFaxInFilter = false;
+      $FaxFilter = "";
+    }
+   
     $filter="";
     if ($userfilter['functionalusers'] == "checked"){
-      $filter.= "(&(objectClass=gosaAccount)(!(|(objectClass=posixAccount)(objectClass=gosaMailAccount)(objectClass=$samba)(objectClass=goFaxAccount)(objectClass=gosaProxyAccount))))";
+      $filter.= "(&(objectClass=gosaAccount)(!(|(objectClass=posixAccount)(objectClass=gosaMailAccount)(objectClass=$samba)".$FaxFilter."(objectClass=gosaProxyAccount))))";
     }
     if ($userfilter['unixusers'] == "checked"){
       $filter.= "(objectClass=posixAccount)";
@@ -970,10 +990,9 @@ class userManagement extends plugin
     if ($userfilter['proxyusers'] == "checked"){
       $filter.= "(objectClass=gosaProxyAccount)";
     }
-    if ($userfilter['faxusers'] == "checked"){
+    if (($userfilter['faxusers'] == "checked") && ($useFaxInFilter)){
       $filter.= "(objectClass=goFaxAccount)";
     }
-
     if ($userfilter['templates'] == "checked"){
       $filter= "(|(objectClass=gosaUserTemplate)(&(objectClass=gosaAccount)(|$filter)))";
     } else {
@@ -991,7 +1010,6 @@ class userManagement extends plugin
     }
 
 
-
     /* NEW LIST MANAGMENT
      * We also need to search for the departments
      * So we are able to navigate like in konquerer 
index ee1bca3e6ef6a9bd8acf8e5362430a4b95ddaba8..e8275500172ae60d7a2e41e0230253ca09a23484 100644 (file)
@@ -612,7 +612,7 @@ class gofaxAccount extends plugin
     }
 
     /* Adapt mail settings if needed */
-    if ($this->parent->by_object['mailAccount']->is_account){
+    if ((isset($this->parent->by_object['mailAccount']->is_account)) && ($this->parent->by_object['mailAccount']->is_account)){
       unset($this->attrs['mail']);
     }
 
@@ -708,7 +708,7 @@ $ldap->modify ($this->attrs);
 
       /* Check if mail account is active and correct the internal
          reference to represent the current status. */
-      if (isset($this->parent)&&($this->parent->by_object['mailAccount']->is_account)){
+      if (isset($this->parent->by_object['mailAccount']->is_account)&&($this->parent->by_object['mailAccount']->is_account)){
         $this->has_mailAccount= TRUE;
       }
     }