summaryrefslogtreecommitdiffstats
path: root/apps/user_migrate/settings.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_migrate/settings.php')
-rw-r--r--apps/user_migrate/settings.php15
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();