--- a/web/event_process.php Tue Jan 14 10:49:12 2014 +0100
+++ b/web/event_process.php Tue Jan 14 15:06:41 2014 +0100
@@ -10,7 +10,7 @@
function create_zip($zip_path,$zip_folder, $config_values, $files) {
$zip = new ZipArchive;
- if($zip->open($zip_path, ZipArchive::CREATE) === FALSE) {
+ if($zip->open($zip_path, ZipArchive::CREATE | ZipArchive::OVERWRITE) === FALSE) {
return FALSE;
}
$config_content = "<?php\n\$config = array(\n 'rep' => basename(__DIR__),\n";
@@ -27,14 +27,14 @@
}
$config_content .= ");\n";
- $zip->addEmptyDir($event_title);
- $zip->addFromString("$event_title/config.php", $config_content);
- $zip->addFromString("$event_title/index.php", "<?php\n// Permanent redirection\n\nheader(\"HTTP/1.1 301 Moved Permanently\");\nheader(\"Location: client.php\");\nexit();");
+ $zip->addEmptyDir($zip_folder);
+ $zip->addFromString("$zip_folder/config.php", $config_content);
+ $zip->addFromString("$zip_folder/index.php", "<?php\n// Permanent redirection\n\nheader(\"HTTP/1.1 301 Moved Permanently\");\nheader(\"Location: client.php\");\nexit();");
- $zip->addEmptyDir("$event_title/images");
+ $zip->addEmptyDir("$zip_folder/images");
foreach ($files as $key => $file_desc) {
if($file_desc['size']>0) {
- $zip->addFile($file_desc['tmp_name'], "$event_title/images/".sanitize_filename($file_desc['name']));
+ $zip->addFile($file_desc['tmp_name'], "$zip_folder/images/".sanitize_filename($file_desc['name']));
}
}