Code

For terminals and workstations in ou=incoming the printer tab was always enabled
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 Oct 2005 08:55:03 +0000 (08:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 Oct 2005 08:55:03 +0000 (08:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1600 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc

index 039be7bb61fc859d9ee13e79323a369f2d79d48e..e75ad359bd287bc676deb0eb691bb604c7d0343d 100644 (file)
@@ -63,13 +63,26 @@ class printgeneric extends plugin
      * else it is a standalone printer
      */
     if((isset($this->attrs['objectClass']))&&(in_array("gotoWorkstation",$this->attrs['objectClass']))){
-      $this->is_terminal = "true";   
-      $this->dn   = preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
-      $this->type = "station";
+      /* Fix for new Workstations */
+      if(preg_match("/ou=incoming/",$this->dn)){    
+        $this->is_terminal = "true";   
+        $this->dn   = preg_replace("/ou=incoming/","ou=printers",$this->dn);
+        $this->type = "station";
+      }else{
+        $this->is_terminal = "true";   
+        $this->dn   = preg_replace("/ou=workstations/","ou=printers",$this->dn);
+        $this->type = "station";
+      }
     }elseif((isset($this->attrs['objectClass']))&&(in_array("gotoTerminal",$this->attrs['objectClass']))){
-      $this->type = "terminal";
-      $this->is_terminal = "true";
-      $this->dn   = preg_replace("/ou=terminal/","ou=printer",$this->dn);
+      if(preg_match("/ou=incoming/",$this->dn)){    
+        $this->is_terminal = "true";   
+        $this->dn   = preg_replace("/ou=incoming/","ou=printers",$this->dn);
+        $this->type = "terminal";
+      }else{
+        $this->type = "terminal";
+        $this->is_terminal = "true";
+        $this->dn   = preg_replace("/ou=terminal/","ou=printers",$this->dn);
+      }
     }else{
       /* Save dn for later references */
       $this->orig_dn= $this->dn;
@@ -92,7 +105,6 @@ class printgeneric extends plugin
       }
     }
 
-   
     /* Prepare different member types 
      */ 
     foreach(array("AddUser"       =>"gotoUserPrinter",