Code

More speed optimizations
[gosa.git] / plugins / admin / systems / class_printGeneric.inc
index 70530282075707dded4487383d3e2f9853725207..cc57c88fad2638ebd49c0f83a1ec0b2a62be2866 100644 (file)
@@ -661,6 +661,8 @@ class printgeneric extends plugin
 
     if($this->BelongsTo == "Workstation"){
       $this->dn= preg_replace("/ou=workstations,/","ou=printers,",$this->dn);
+      $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
+      $this->netConfigDNS->macAddress = $mac;
     }
     
     if(!$this->is_account) return;
@@ -708,8 +710,14 @@ class printgeneric extends plugin
     }else{
       $method="http://";
     }
-  
-    $this->attrs['gotoPrinterPPD'] = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->gotoPrinterPPD);
+
+    /* Only save ppd path, if the path is not empty (no ppd selected )*/ 
+    if(!empty($this->gotoPrinterPPD)) {
+      $this->attrs['gotoPrinterPPD'] = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->gotoPrinterPPD);
+    }else{
+      $this->attrs['gotoPrinterPPD'] = array();
+    }
+
 
     /* Append printer user 
      */
@@ -772,6 +780,7 @@ class printgeneric extends plugin
     }
     show_ldap_error($ldap->get_error(), _("Saving printer failed"));
 
+
     $this->netConfigDNS->cn = $this->cn;
     $this->netConfigDNS->dn = $this->dn;
     $this->netConfigDNS->save($this->dn);