Code

Update PPD save path
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Apr 2008 12:02:00 +0000 (12:02 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Apr 2008 12:02:00 +0000 (12:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10298 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc

index a3d5bb282700f7c88c20fa5528de9e94745a02e9..b3b55725a6788ce3f8d8856fb02eb36e3ac0a0f7 100644 (file)
@@ -764,10 +764,19 @@ class printgeneric extends plugin
     }else{
       $method="http://";
     }
+   
+    /* Get servername */
+    $server = $_SERVER['SERVER_NAME'];
+    $server = "buildserv";
+    if(TESTS::is_ip($server)){  
+      $server_name = gethostbyaddr($server);
+    }else{
+      $server_name = gethostbyaddr(gethostbyname($server));
+    }
 
     /* If no ppd is selected, remove this attribute */
     if(!empty($this->gotoPrinterPPD) && $this->initially_was_account) {
-      $this->gotoPrinterPPD = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->gotoPrinterPPD);
+      $this->gotoPrinterPPD = $method.str_replace("//","/",$server_name."/ppd/".$this->gotoPrinterPPD);
     }else{
       $this->gotoPrinterPPD = array();
     }