Code

Update
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jan 2006 08:21:51 +0000 (08:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jan 2006 08:21:51 +0000 (08:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2546 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc

index c68fd3bbe0d522807376fa71b129437636d5b70a..ee8a25a8973e263b234fced8b5f13cd1b5c9e9fb 100644 (file)
@@ -168,6 +168,12 @@ class printgeneric extends plugin
 
     if(isset($this->parent->by_name['workgeneric'])){
 //      echo "workstation";
+      if($this->parent->by_object['workgeneric']->cn == "wdefault"){
+        $display= $this->show_header(_("Add printer extension"),
+            _("This is a workstation template, printer tab is disabled."),TRUE,TRUE);
+        $this->is_account= false;
+        return $display;
+      }
     }elseif(isset($this->parent->by_name['termgeneric'])){
       if($this->parent->by_object['termgeneric']->cn == "default"){
         $display= $this->show_header(_("Add printer extension"),
@@ -454,6 +460,17 @@ class printgeneric extends plugin
   function check()
   {
     $message= array();
+
+    if(isset($this->parent->by_name['workgeneric'])){
+      if($this->parent->by_object['workgeneric']->cn == "wdefault"){
+        return $message;
+      }
+    }elseif(isset($this->parent->by_name['termgeneric'])){
+      if($this->parent->by_object['termgeneric']->cn == "default"){
+        return $message;
+      }
+    }
+
     $this->dn= "cn=".$this->cn.",ou=printers,ou=systems,".$this->base;
 
     /* must: cn */
@@ -492,7 +509,16 @@ class printgeneric extends plugin
     if (!$this->is_account){
       return;
     }
-  
+    if(isset($this->parent->by_name['workgeneric'])){
+      if($this->parent->by_object['workgeneric']->cn == "wdefault"){
+        return;
+      }
+    }elseif(isset($this->parent->by_name['termgeneric'])){
+      if($this->parent->by_object['termgeneric']->cn == "default"){
+        return;
+      }
+    }
+
     if($this->PPDdialogToSave){
       $this->PPDdialogToSave->save_ppd();
     }