summaryrefslogtreecommitdiffstats
path: root/apps/user_migrate
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-03-03 13:26:01 +0000
committerTom Needham <needham.thomas@gmail.com>2012-03-03 13:26:01 +0000
commit188a304625b8ddb597505f69bc34487806b5b18e (patch)
tree7e72331e51068c7b0ca10a10da08df48333a750c /apps/user_migrate
parent6906988b4ec795d5d33367cd192b47d061f1c906 (diff)
downloadnextcloud-server-188a304625b8ddb597505f69bc34487806b5b18e.tar.gz
nextcloud-server-188a304625b8ddb597505f69bc34487806b5b18e.zip
Replace db on import. Update user_migration export function.
Diffstat (limited to 'apps/user_migrate')
-rw-r--r--apps/user_migrate/settings.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/apps/user_migrate/settings.php b/apps/user_migrate/settings.php
index 7e3510d97ef..7c00dace3c2 100644
--- a/apps/user_migrate/settings.php
+++ b/apps/user_migrate/settings.php
@@ -49,23 +49,22 @@ if (isset($_POST['user_migrate'])) {
// adding owncloud system files
OC_Log::write('user_migrate',"Adding app data to user export file",OC_Log::INFO);
// Call to OC_Migrate for the xml file.
- //$appdatafile = $tempdir . "/appdata.xml";
- //$fh = fopen($appdatafile, 'w');
+ $appdatafile = $tempdir . "/appdata.xml";
+
$appdata = OC_Migrate::export(OC_User::getUser());
- //fwrite($fh, $appdata);
- //$zip->addFile($appdatafile, "appdata.xml");
- //fclose($fh);
+ file_put_contents($appdatafile, $appdata);
+ $zip->addFile($appdatafile, "appdata.xml");
+
}
$zip->close();
- //header("Content-Type: application/zip");
- //header("Content-Disposition: attachment; filename=" . basename($filename));
- //header("Content-Length: " . filesize($filename));
- //@ob_end_clean();
- echo htmlspecialchars($appdata);
- //readfile($filename);
+ header("Content-Type: application/zip");
+ header("Content-Disposition: attachment; filename=" . basename($filename));
+ header("Content-Length: " . filesize($filename));
+ readfile($filename);
unlink($filename);
+
} else {
// fill template
$tmpl = new OC_Template('user_migrate', 'settings');