From 6add11dc5f93be86894658214ce210833b2f3e02 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 13 Mar 2006 06:27:06 +0000 Subject: [PATCH] Fixed problem with not existen objectClass goFaxAccount && userslist 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 | 26 ++++++++++++++++--- .../gofax/faxaccount/class_gofaxAccount.inc | 4 +-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index c622ffbd2..d3b3b46e4 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -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 diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc index ee1bca3e6..e82755001 100644 --- a/plugins/gofax/faxaccount/class_gofaxAccount.inc +++ b/plugins/gofax/faxaccount/class_gofaxAccount.inc @@ -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; } } -- 2.30.2