From: hickert Date: Wed, 10 Mar 2010 10:02:59 +0000 (+0000) Subject: Updated filter X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b60260569bb5820d4ca65d2902925811ee4e36e2;p=gosa.git Updated filter git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16370 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 4604eecbe..bd24cc5ec 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -178,9 +178,11 @@ class management $this->snapHandler->setSnapshotBases($bases); } - // Dummy filter editor - $dummy = ""; - $this->registerAction("editFilter", "editFilter"); + // Add a dummy filter editing button. + if(userFilter::userFilteringAvailable()){ + $dummy = ""; + $this->registerAction("editFilter", "editFilter"); + } // Display list return($dummy.$this->renderList()); diff --git a/gosa-core/include/class_userFilter.inc b/gosa-core/include/class_userFilter.inc index b193210ec..4344ffdef 100644 --- a/gosa-core/include/class_userFilter.inc +++ b/gosa-core/include/class_userFilter.inc @@ -8,6 +8,21 @@ class userFilter extends plugin public $objectClass = array('gosaProperties'); public $attributes = array('gosaUserDefinedFilter'); public $gosaUserDefinedFilter = array(); + + + /*! \brief Returns true if we are able to read and write userFilters + * (schema has to be present, gosaProperties) + */ + static function userFilteringAvailable() + { + if(!session::is_set('userFilter::userFilteringAvailable')){ + global $config; + $ldap = $config->get_ldap_link(); + $ocs = $ldap->get_objectclasses(); + session::set('userFilter::userFilteringAvailable', isset($ocs['gosaProperties'])); + } + return(session::get('userFilter::userFilteringAvailable')); + } /*! \brief Initiates the filter editing dialog.