Whitespace and use ZM_DIR_EXPORT instead of ZM_DIR_TMP

This commit is contained in:
Isaac 2018-01-24 22:21:43 +01:00
parent fd2d2a0d77
commit e364a541d4
1 changed files with 29 additions and 30 deletions

View File

@ -18,9 +18,8 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
if ( !canView( 'Events' ) )
{
$view = "error";
if ( !canView( 'Events' ) ) {
$view = 'error';
return;
}
@ -28,13 +27,13 @@ $archivetype = $_REQUEST['type'];
if ( $archivetype ) {
switch ($archivetype) {
case "tar":
$mimetype = "gzip";
$file_ext = "tar.gz";
case 'tar':
$mimetype = 'gzip';
$file_ext = 'tar.gz';
break;
case "zip":
$mimetype = "zip";
$file_ext = "zip";
case 'zip':
$mimetype = 'zip';
$file_ext = 'zip';
break;
default:
$mimetype = NULL;
@ -43,7 +42,7 @@ if ( $archivetype ) {
if ( $mimetype ) {
$filename = "zmExport.$file_ext";
$filename_path = ZM_DIR_TEMP."/".$filename;
$filename_path = ZM_DIR_EXPORTS.'/'.$filename;
if ( is_readable($filename_path) ) {
header( "Content-type: application/$mimetype" );
header( "Content-Disposition: attachment; filename=$filename");