diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-03-14 16:43:06 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-03-14 16:43:06 +0000 |
commit | c9be325af2707b256f83cafbda3f7e3713f97876 (patch) | |
tree | e30c2979433275caa1db6b2cc90e39ed3ce60d5e /apps/user_migrate | |
parent | a310a81053c31205abd6d62491304705b1f565e2 (diff) | |
download | nextcloud-server-c9be325af2707b256f83cafbda3f7e3713f97876.tar.gz nextcloud-server-c9be325af2707b256f83cafbda3f7e3713f97876.zip |
Fix zip creation. Add param to cleanUp() method. Add defaults to createExportFile() method.
Diffstat (limited to 'apps/user_migrate')
-rw-r--r-- | apps/user_migrate/settings.php | 15 |
1 files changed, 7 insertions, 8 deletions
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(); |