From 786e9477badbb3f06604a41569fe5ab354472280 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 7 Dec 2006 10:50:00 +0000 Subject: [PATCH] Added 1/2 FAI inactive Fixes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5336 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 8 ++++++++ plugins/admin/fai/class_faiSummaryTab.inc | 8 ++++++++ plugins/admin/groups/class_groupManagement.inc | 8 +++++++- plugins/admin/systems/class_servRepository.inc | 16 ++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/include/functions.inc b/include/functions.inc index b1deb986e..2cc2e8cf3 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -462,6 +462,7 @@ function ldap_expired_account($config, $userdn, $username) function add_lock ($object, $user) { global $config; + echo "ADDING.. -> ".$object."
"; /* Just a sanity check... */ if ($object == "" || $user == ""){ @@ -502,6 +503,13 @@ function del_lock ($object) { global $config; + if(isset($_POST['delete_lock'])){ + echo "REMOVING -> ".$object."
"; + }else{ + echo "SKIP REMOVING -> ".$object."
"; + return; + } + /* Sanity check */ if ($object == ""){ return; diff --git a/plugins/admin/fai/class_faiSummaryTab.inc b/plugins/admin/fai/class_faiSummaryTab.inc index ed3c20418..034f8cefe 100644 --- a/plugins/admin/fai/class_faiSummaryTab.inc +++ b/plugins/admin/fai/class_faiSummaryTab.inc @@ -168,6 +168,14 @@ class faiSummaryTab extends plugin{ /* This function calls all nescessary functions to generate the fai class summary tree */ function execute() { + + /* Skip this if fai is deactivated */ + $tmp = search_config($this->config->data,"faiManagement","CLASS"); + if(empty($tmp)){ + $str = "

"._("You can't use this plugin until FAI is activated.")."

"; + return $str; + } + /* Check if we must (re)init the this tab */ if(!$this->InitCalled){ $this->init(); diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index 0fab284e7..42f765582 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -453,8 +453,14 @@ class groupManagement extends plugin Search for the prepared filter ********************/ + /* Attributes to search for */ + $attrs = array("cn", "description", "gidNumber", "objectClass"); + /* If subsearch is activated search for subobjects too */ - $attrs = array("cn", "description", "gidNumber", "objectClass","FAIrelease"); + $tmp = search_config($this->config->data,"faiManagement","CLASS"); + if(!empty($tmp)){ + $attrs [] = "FAIrelease"; + } if ($SubSearch){ $res= get_list($filter, "groups", $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH); diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc index 7d7cedd6f..c84d4976c 100644 --- a/plugins/admin/systems/class_servRepository.inc +++ b/plugins/admin/systems/class_servRepository.inc @@ -27,11 +27,20 @@ class servrepository extends goService var $DisplayName = ""; var $StatusFlag = ""; + var $fai_activated = FALSE; function servrepository ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); + /* Skip this if fai is deactivated */ + $tmp = search_config($this->config->data,"faiManagement","CLASS"); + if(!empty($tmp)){ + $this->fai_activated = TRUE; + }else{ + return; + } + $this->DisplayName = _("Repository service"); $this->repositories = array(); @@ -81,6 +90,11 @@ class servrepository extends goService /* Call parent execute */ plugin::execute(); + if(!$this->fai_activated){ + $str = "

"._("You can't use this plugin until FAI is activated.")."

"; + return $str; + } + /* Fill templating stuff */ $smarty= get_smarty(); $smarty->assign("is_createable",$this->acl_is_createable()); @@ -294,6 +308,8 @@ class servrepository extends goService /* Save to LDAP */ function save() { + if(!$this->fai_activated) return; + plugin::save(); $arr = array(); -- 2.30.2