From: hickert Date: Thu, 7 Dec 2006 10:28:49 +0000 (+0000) Subject: Skip executing FAI repository if FAI is not active. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=30827656c010419d41e5249cee16edf2d01969b9;p=gosa.git Skip executing FAI repository if FAI is not active. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5334 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc index 4640786b8..1fc0458ef 100644 --- a/plugins/admin/systems/class_servRepository.inc +++ b/plugins/admin/systems/class_servRepository.inc @@ -20,12 +20,22 @@ class servrepository extends plugin /* Repositories */ var $repositories = array(); - var $FAIrepository = array(); + var $FAIrepository = array(); + + 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; + } + $ui = get_userinfo(); $tmp= get_permissions ($this->dn, $ui->subtreeACL); $this->acl= get_module_permission($tmp, "FAIclass", $this->dn); @@ -77,6 +87,11 @@ class servrepository extends plugin /* 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(); $display= ""; @@ -304,6 +319,9 @@ class servrepository extends plugin function remove_from_parent() { + + if(!$this->fai_activated) return; + /* Skip if not allowed */ $ui = get_userinfo(); $tmp= get_permissions ($this->dn, $ui->subtreeACL); @@ -350,7 +368,8 @@ class servrepository extends plugin /* Save to LDAP */ function save() { - + if(!$this->fai_activated) return; + /* Skip if not allowed */ $ui = get_userinfo(); $tmp= get_permissions ($this->dn, $ui->subtreeACL);