Code

Updated filter
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 10:02:59 +0000 (10:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 10:02:59 +0000 (10:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16370 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_management.inc
gosa-core/include/class_userFilter.inc

index 4604eecbe2bed502cf9de24c2976224f055e1bb4..bd24cc5ec3b219e6b3293c61dad64452286be8d9 100644 (file)
@@ -178,9 +178,11 @@ class management
       $this->snapHandler->setSnapshotBases($bases);
     }
   
-    // Dummy filter editor 
-    $dummy = "<button type='submit' name='editFilter'>!!</button>";
-    $this->registerAction("editFilter", "editFilter");
+    // Add a dummy filter editing button.
+    if(userFilter::userFilteringAvailable()){
+      $dummy = "<button type='submit' name='editFilter'>!!</button>";
+      $this->registerAction("editFilter", "editFilter");
+    }
  
     // Display list
     return($dummy.$this->renderList());
index b193210ecdeb6c407503f835a410849098a393ee..4344ffdef1b876091734cc0e0b5f3234a8c63f00 100644 (file)
@@ -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.