summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f061ed)
raw | patch | inline | side by side (parent: 6f061ed)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 25 Jan 2006 09:03:08 +0000 (09:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 25 Jan 2006 09:03:08 +0000 (09:03 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2572 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_glpiAttachmentPool.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_glpiAttachmentPool.inc b/plugins/admin/systems/class_glpiAttachmentPool.inc
index bddbe307344d16f6f2e706c8beb1d9b7794146f9..896ed980bb6407af1f6a73f3dd47c8c22ab5e4d0 100644 (file)
print_red(_("Missing directory '/etc/gosa/glpi/' to store glpi uploads."));
}else{
$filen = "/etc/gosa/glpi/".$FILE['name'];
- $fh = fopen($filen,"w");
- if(!$fh){
- print_red(sprintf(_("Can't create file '%s'."),$filen));
+ if(file_exists($filen)){
+ print_red(_("There is already a file with the same name uploaded."));
}else{
- $str = file_get_contents($FILE['tmp_name']);
- fwrite($fh,$str,strlen($str));
- fclose($fh);
- $this->mime = $FILE['type'];
- $this->filename = $FILE['name'];
- }
+ $fh = fopen($filen,"w");
+ if(!$fh){
+ print_red(sprintf(_("Can't create file '%s'."),$filen));
+ }else{
+ $str = file_get_contents($FILE['tmp_name']);
+ fwrite($fh,$str,strlen($str));
+ fclose($fh);
+ $this->mime = $FILE['type'];
+ $this->filename = $FILE['name'];
+ }
+ } // File already exists
}
} // Check if any error occured
} // check if valid filename was uploaded