Code

Added support for general check hooks
[gosa.git] / plugins / admin / systems / class_printGeneric.inc
index 6870431ba8cc71cb14c0b58a9adec9a3925df943..df9f7f12879878165062bdcb7a533e930683fa9c 100644 (file)
@@ -30,6 +30,7 @@ class printgeneric extends plugin
   var $AdminMemberKeys  =array();
 
   var $is_terminalBased = false; 
+  var $gotoUserPrinter ;
 
   var $PPDdialogToSave  = NULL;
  
@@ -39,9 +40,12 @@ class printgeneric extends plugin
   var $dialog           =NULL;
 
   var $netConfigDNS;
+  var $baseSelection    = false;
+
+  var $macAddress       = "";
 
   /* attribute list for save action */
-  var $attributes     = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","gotoUserPrinter");
+  var $attributes     = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","gotoUserPrinter", "macAddress");
   var $objectclasses  = array("top", "gotoPrinter");
 
   function printgeneric ($config, $dn= NULL)
@@ -253,6 +257,7 @@ class printgeneric extends plugin
         $once = false;
         $this->dialog = new baseSelectDialog($this->config);
         $this->dialog->setCurrentBase($this->base);
+        $this->baseSelection = true;
       }
     }
 
@@ -260,14 +265,17 @@ class printgeneric extends plugin
     if(is_object($this->dialog)){
       /* Must be called before save_object */
       $this->dialog->save_object();
-
-      if($this->dialog->isClosed()){
-        $this->dialog = false;
-      }elseif($this->dialog->isSelected()){
-        $this->base = $this->dialog->isSelected();
-        $this->dialog= false;
-      }else{
-        return($this->dialog->execute());
+      if($this->baseSelection){
+        if($this->dialog->isClosed()){
+          $this->dialog = false;
+          $this->baseSelection = false;
+        }elseif($this->dialog->isSelected()){
+          $this->base = $this->dialog->isSelected();
+          $this->dialog= false;
+          $this->baseSelection = false;
+        }else{
+          return($this->dialog->execute());
+        }
       }
     }
 
@@ -487,7 +495,9 @@ class printgeneric extends plugin
   /* Check supplied data */
   function check()
   {
-    $message= $this->netConfigDNS->check();
+    /* Call common method to give check the hook */
+    $message= plugin::check();
+    $message= array_merge($message, $this->netConfigDNS->check());
 
     if(isset($this->parent->by_name['workgeneric'])){
       if($this->parent->by_object['workgeneric']->cn == "wdefault"){