Code

Updated Device handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Sep 2010 13:27:17 +0000 (13:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Sep 2010 13:27:17 +0000 (13:27 +0000)
-Do not display anything if there occured an error

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19837 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc

index 9aa0b028a33df35e2c44d49b0329e5cc065c1270..b885f495dd075441618a3874925cf9c6da904b50 100644 (file)
@@ -55,7 +55,9 @@ class DeviceConfig extends management
         }
         if(!$root){
             echo 'No root found!';
+        $this->rebuildListing();
             return;
+            $this->is_account = FALSE;
         }
 
         $this->is_account = TRUE;
@@ -107,6 +109,25 @@ class DeviceConfig extends management
      */
     function renderList()
     {
+        // Do we represent a valid account
+        if (!$this->is_account){
+            $str = "<img alt=\"\" src=\"images/small-error.png\" align=\"middle\">&nbsp;<b>".
+                msgPool::noValidExtension("GOsa")."</b>";
+            return($str);
+        }
+
+        // Collect item container list to be able to render the fake-base selector
+        if(!$this->itemContainerSelector){
+            $this->itemContainerSelector = new releaseSelector(
+                    $this->getContainerList(), 
+                    $this->base, 
+                    $this->currentItemValues['root']['base']);
+        }else{
+            $this->itemContainerSelector->setBases($this->getContainerList());
+        }
+        $this->itemContainerSelector->update(true);
+        $this->itemContainerSelector->setBase($this->base);
+
         $tpl = $this->TemplateEngine->render();
         session::set('DEVICE_ITEMS', $this->currentItemValues);
         $this->rebuildListing();
@@ -141,18 +162,6 @@ class DeviceConfig extends management
      */
     function rebuildListing()
     {
-        // Collect item container list to be able to render the fake-base selector
-        if(!$this->itemContainerSelector){
-            $this->itemContainerSelector = new releaseSelector(
-                    $this->getContainerList(), 
-                    $this->base, 
-                    $this->currentItemValues['root']['base']);
-        }else{
-            $this->itemContainerSelector->setBases($this->getContainerList());
-        }
-        $this->itemContainerSelector->update(true);
-        $this->itemContainerSelector->setBase($this->base);
-
         // Build filter
         if (session::global_is_set(get_class($this)."_filter")){
             $filter= session::global_get(get_class($this)."_filter");