From bdbf075bfae8ce09fb65d6f1dd1e4887c8d81bca Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 28 Sep 2006 07:21:56 +0000 Subject: [PATCH] Fixed error : Creating a new printer without a ppd configuration -> save -> ldap-error git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4806 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_printGeneric.inc | 27 ++++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index cc57c88fa..3738b4f4a 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -686,6 +686,19 @@ class printgeneric extends plugin $this->PPDdialogToSave->save_ppd(); } + if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){ + $method="https://"; + }else{ + $method="http://"; + } + + /* If no ppd is selected, remove this attribute */ + if(!empty($this->gotoPrinterPPD)) { + $this->gotoPrinterPPD = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->gotoPrinterPPD); + }else{ + $this->gotoPrinterPPD = array(); + } + $dn= $this->dn; plugin::save(); $ldap= $this->config->get_ldap_link(); @@ -705,20 +718,6 @@ class printgeneric extends plugin $this->attrs= $attrs; } - if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){ - $method="https://"; - }else{ - $method="http://"; - } - - /* 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 */ $this->attrs['gotoUserPrinter']=array(); -- 2.30.2