From c9be325af2707b256f83cafbda3f7e3713f97876 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Wed, 14 Mar 2012 16:43:06 +0000 Subject: Fix zip creation. Add param to cleanUp() method. Add defaults to createExportFile() method. --- apps/user_migrate/settings.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'apps') diff --git a/apps/user_migrate/settings.php b/apps/user_migrate/settings.php index 9fbb4da9e56..04aca51f518 100644 --- a/apps/user_migrate/settings.php +++ b/apps/user_migrate/settings.php @@ -26,22 +26,21 @@ OC_Util::checkAppEnabled('user_migrate'); if (isset($_POST['user_export'])) { // Create the export zip - $user = OC_User::getUser(); - $path = OC_Config::getValue( 'datadirectory' ) . '/' . OC_User::getUser() . '/'; - if( OC_Migrate::createExportFile( $user, $path ) ){ - // Download it then + if( !$path = OC_Migrate::createExportFile() ){ + // Error + die('error'); + } else { + // Download it header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=" . basename($path)); header("Content-Length: " . filesize($path)); @ob_end_clean(); readfile($path); - OC_Migrate::cleanUp(); - } else { - die('error'); + OC_Migrate::cleanUp( $path ); } } if( isset( $_POST['user_import'] ) ){ // TODO -}else { +} else { // fill template $tmpl = new OC_Template('user_migrate', 'settings'); return $tmpl->fetchPage(); -- cgit v1.2.3