summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d060538)
raw | patch | inline | side by side (parent: d060538)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 1 Dec 2006 07:17:20 +0000 (07:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 1 Dec 2006 07:17:20 +0000 (07:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5280 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_printGeneric.inc | patch | blob | history | |
plugins/admin/systems/class_printerPPDDialog.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index b38825df345393e46dc97c807b443f67d8d114a6..18a936bbf47345835d89e708adf7052ea0e7901a 100644 (file)
var $description = "";
var $labeledURI = "";
var $gotoPrinterPPD = "";
+ var $initial_PPD = "";
var $orig_dn = "";
var $UserMember ="";
$this->gotoPrinterPPD = preg_replace("/^http.*ppd\//i","",$this->gotoPrinterPPD);
}
+ $this->initial_PPD = $this->gotoPrinterPPD;
+
/* Prepare different member types */
foreach(array("AddUser" =>"gotoUserPrinter",
"AddGroup" =>"gotoGroupPrinter",
unset($og->member[$this->dn]);
$og->save ();
}
+
+ /* Remove previously selected ppd file.*/
+ if(!empty($this->initial_PPD)){
+ $tmp = new printerPPDDialog($this->config, $this->dn,$this->initial_PPD);
+ $tmp->removeModifiedPPD();
+ }
}
}
$this->PPDdialogToSave->save_ppd();
}
+ /* Remove previously selected ppd file.*/
+ if($this->initial_PPD != $this->gotoPrinterPPD){
+ if(!empty($this->initial_PPD)){
+ $tmp = new printerPPDDialog($this->config, $this->dn,$this->initial_PPD);
+ $tmp->removeModifiedPPD();
+ }
+ }
+
if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
$method="https://";
}else{
diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc
index 9296afe61985cfcd1585baae1e9ef623dcdb16c7..fd041b762aad8eed5f15933145a9b86a4de6b269 100644 (file)
}
return($str);
}
+
+ function removeModifiedPPD()
+ {
+ $path = $this->pathToPPD.$this->pathToModified.$this->selectedPPD['link'];
+
+ if(file_exists($path)){
+ if(is_writeable($path)){
+ if(!@unlink($path)){
+ print_red(sprintf(_("Removing old ppd file '%s' failed."),$path));
+ }
+ }else{
+ print_red(sprintf(_("Removing old ppd file '%s' failed. File is not accessible."),$path));
+ }
+ }else{
+ print_red(sprintf(_("Removing old ppd file '%s' failed. File does not exists or is not accessible."),$path));
+ }
+ }
function check()
{