From 5bf2832cbf8dad673a58636100b9a91ec8a688f5 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 26 May 2010 08:15:34 +0000 Subject: [PATCH] Added a chek to prevent instantiation of broken tabs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18745 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_management.inc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 66bdc4cf2..837688dc5 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -698,11 +698,21 @@ class management if(empty($tabClass) || empty($tabType)){ trigger_error("We can't edit any object(s). 'tabClass' or 'tabType' is empty!"); }else{ + $tab = $tabClass; - $this->tabObject= new $tab($this->config,$this->config->data['TABS'][$tabType], $this->dn,$aclCategory); - @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Edit entry initiated!"); - $this->tabObject->set_acl_base($this->dn); - $this->tabObject->parent = &$this; + + // Check if the base plugin is available - it is mostly responsible for object creation and removal. + $first = $this->config->data['TABS'][$tabType][0]; + if(!class_available($first['CLASS'])){ + msg_dialog::display(_("Internal error"), + sprintf(_("Cannot instantiate tabbed-plugin, the base plugin (%s) is not available!"), $first['CLASS']), + ERROR_DIALOG); + }else{ + $this->tabObject= new $tab($this->config,$this->config->data['TABS'][$tabType], $this->dn,$aclCategory); + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Edit entry initiated!"); + $this->tabObject->set_acl_base($this->dn); + $this->tabObject->parent = &$this; + } } }else{ -- 2.30.2