From: hickert Date: Thu, 31 Aug 2006 11:09:46 +0000 (+0000) Subject: Fixed removing of newly added kiosk profiles X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9d27e428fd34fe0ff64ef5ea21ea30d20907e3b9;p=gosa.git 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 --- 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)); + } } } }