]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix structure of user export zip
authorTom Needham <needham.thomas@gmail.com>
Tue, 13 Mar 2012 17:08:20 +0000 (17:08 +0000)
committerTom Needham <needham.thomas@gmail.com>
Tue, 13 Mar 2012 17:08:20 +0000 (17:08 +0000)
apps/user_migrate/settings.php

index edad7357a2ae0ad1822d22ec80ac48aefd3746e2..00f46660cf50a4810d7e59cd3e669fec5567a427 100644 (file)
@@ -53,15 +53,11 @@ if (isset($_POST['user_export'])) {
        
        // Migrate the app info
        $info = json_encode( OC_Migrate::export( $user ) );
-       $infofile = $exportdir . '/exportinfo.json';
-       if( !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");
+       $infofile = OC::$SERVERROOT . '/data/' . $user . '/exportinfo.json';
+       file_put_contents( $infofile, $info );
 
-       // Add the data dir
-       zipAddDir(OC::$SERVERROOT . "/data/" . $user, $zip, true, "files/");
+       // Add the data dir (which includes migration.db and exportinfo.json)
+       zipAddDir(OC::$SERVERROOT . "/data/" . $user, $zip, true, "/");
        
        // Save the zip
     $zip->close();