fix structure of user export zip

This commit is contained in:
Tom Needham 2012-03-13 17:08:20 +00:00
parent 111af7fed5
commit 7e3b35a57c
1 changed files with 4 additions and 8 deletions

View File

@ -53,15 +53,11 @@ if (isset($_POST['user_export'])) {
// Migrate the app info // Migrate the app info
$info = json_encode( OC_Migrate::export( $user ) ); $info = json_encode( OC_Migrate::export( $user ) );
$infofile = $exportdir . '/exportinfo.json'; $infofile = OC::$SERVERROOT . '/data/' . $user . '/exportinfo.json';
if( !file_put_contents( $infofile, $info ) ){ file_put_contents( $infofile, $info );
die('Failed to save the export info');
}
$zip->addFile( $infofile, "exportinfo.json");
$zip->addFile(OC::$SERVERROOT . '/data/' . $user . '/migration.db', "migration.db");
// Add the data dir // Add the data dir (which includes migration.db and exportinfo.json)
zipAddDir(OC::$SERVERROOT . "/data/" . $user, $zip, true, "files/"); zipAddDir(OC::$SERVERROOT . "/data/" . $user, $zip, true, "/");
// Save the zip // Save the zip
$zip->close(); $zip->close();