Code

Updated table summary
[gosa.git] / gosa-plugins / goto / admin / devices / class_deviceGeneric.inc
index b4a8ebe5a6e794693c5c6f43922722ea244d8573..1eeb6dd9396af5f2ab86dcff265d43ea43b623b0 100644 (file)
@@ -71,6 +71,7 @@ class deviceGeneric extends plugin
 
   public function execute()
   {
+    plugin::execute();
     $smarty = get_smarty();
     $smarty->assign("usePrototype", "true");
     $smarty->assign("base", $this->baseSelector->render());
@@ -112,6 +113,11 @@ class deviceGeneric extends plugin
     if(empty($this->vendor) || !$this->is_2byteHex($this->vendor)){
       $message[]= msgPool::invalid(_("Vendor-ID"),"","","0x1234");
     }
+
+    // Check if a wrong base was supplied
+    if(!$this->baseSelector->checkLastBaseUpdate()){
+      $message[]= msgPool::check_base();
+    }
   
     /* Check if entry already exists */ 
     if($this->cn != $this->orig_cn || $this->dn == "new"){
@@ -136,19 +142,20 @@ class deviceGeneric extends plugin
 
   public function save_object()
   {
-    /* Refresh base */
-    if ($this->acl_is_moveable($this->base)){
-      if (!$this->baseSelector->update()) {
-        msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG);
-      }
-      if ($this->base != $this->baseSelector->getBase()) {
-        $this->base= $this->baseSelector->getBase();
-        $this->is_modified= TRUE;
-      }
-    }
-
     if(isset($_POST['deviceGeneric_posted'])){
       plugin::save_object();
+
+      /* Refresh base */
+      if ($this->acl_is_moveable($this->base)){
+        if (!$this->baseSelector->update()) {
+          msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG);
+        }
+        if ($this->base != $this->baseSelector->getBase()) {
+          $this->base= $this->baseSelector->getBase();
+          $this->is_modified= TRUE;
+        }
+      }
+
     }
   }