Code

Added a chek to prevent instantiation of broken tabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 May 2010 08:15:34 +0000 (08:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 May 2010 08:15:34 +0000 (08:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18745 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_management.inc

index 66bdc4cf2b73a201e86ef9ecc36b881d2bb39540..837688dc568a9d1ec7fd65e6a998384eb2aa5445 100644 (file)
@@ -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{