From 9d27e428fd34fe0ff64ef5ea21ea30d20907e3b9 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 31 Aug 2006 11:09:46 +0000 Subject: [PATCH] Fixed removing of newly added kiosk profiles git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4556 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_kioskManagementDialog.inc | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/plugins/personal/environment/class_kioskManagementDialog.inc b/plugins/personal/environment/class_kioskManagementDialog.inc index 33d577c28..217c7120c 100644 --- a/plugins/personal/environment/class_kioskManagementDialog.inc +++ b/plugins/personal/environment/class_kioskManagementDialog.inc @@ -58,16 +58,23 @@ class kioskManagementDialog extends plugin $only_once = false; $id = preg_replace("/^delkiosk_/","",$name); $id = preg_replace("/_.*$/","",$id); - - $filename = $this->baseDir."/".preg_replace("/^.*\//i","",base64_decode($id)); - - $res = unlink($filename); - if(!$res){ - if(!is_writeable($filename)){ - print_red(sprintf(_("Can't delete '%s'. Error was: permission denied."), $filename)); - } - if(!file_exists($filename)){ - print_red(sprintf(_("Can't delete '%s'. Errow was: file doesn't exist."), $filename)); + + $name = preg_replace("/^.*\//i","",base64_decode($id)); + + $filename = $this->baseDir."/".$name; + + if(isset($this->filesToAttach[$name])){ + unset($this->filesToAttach[$name]); + }else{ + + $res = @unlink($filename); + if(!$res){ + if(!is_writeable($filename)){ + print_red(sprintf(_("Can't delete '%s'. Error was: permission denied."), $filename)); + } + if(!file_exists($filename)){ + print_red(sprintf(_("Can't delete '%s'. Errow was: file doesn't exist."), $filename)); + } } } } -- 2.30.2