]> source.dussan.org Git - nextcloud-server.git/commitdiff
Decode json response for admin exports
authorTom Needham <needham.thomas@gmail.com>
Sun, 8 Apr 2012 19:08:17 +0000 (19:08 +0000)
committerTom Needham <needham.thomas@gmail.com>
Sun, 8 Apr 2012 19:08:17 +0000 (19:08 +0000)
apps/admin_migrate/settings.php

index 981d5f4ca63f921b68130caf009a479843852d11..94bf6052a6b6017a9adbb7b2559b67d2acc2669b 100644 (file)
@@ -28,10 +28,12 @@ OC_Util::checkAppEnabled('admin_migrate');
 // Export?
 if (isset($_POST['admin_export'])) {
        // Create the export zip
-       if( !$path = OC_Migrate::export( null, $_POST['export_type'] ) ){
+       $response = json_decode( OC_Migrate::export( null, $_POST['export_type'] ) );
+       if( !$response->success ){
                // Error
                die('error');   
        } else {
+               $path = $response->data;
                // Download it
                header("Content-Type: application/zip");
                header("Content-Disposition: attachment; filename=" . basename($path));