diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-05-03 12:23:29 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-05-03 12:23:29 +0200 |
commit | 43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5 (patch) | |
tree | f4b191f0d039cb7de942554ea23df3fff9de7ad6 /apps/user_migrate | |
parent | 375ba986452b190745b9388be92737d7e5771673 (diff) | |
download | nextcloud-server-43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5.tar.gz nextcloud-server-43caa3b3b9cc9dbbf73ab2f6695a801a07a1dba5.zip |
ported oc_json
Diffstat (limited to 'apps/user_migrate')
-rwxr-xr-x | apps/user_migrate/ajax/export.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/user_migrate/ajax/export.php b/apps/user_migrate/ajax/export.php index ef8e331c68c..07c35c73470 100755 --- a/apps/user_migrate/ajax/export.php +++ b/apps/user_migrate/ajax/export.php @@ -24,33 +24,33 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('user_migrate'); // Which operation if( $_GET['operation']=='create' ){ $uid = !empty( $_POST['uid'] ) ? $_POST['uid'] : OCP\USER::getUser(); if( $uid != OCP\USER::getUser() ){ // Needs to be admin to export someone elses account - OC_JSON::error(); + OCP\JSON::error(); die(); } // Create the export zip $response = json_decode( OC_Migrate::export( $uid ) ); if( !$response->success ){ // Error - OC_JSON::error(); + OCP\JSON::error(); die(); } else { // Save path in session $_SESSION['ocuserexportpath'] = $response->data; } - OC_JSON::success(); + OCP\JSON::success(); die(); } else if( $_GET['operation']=='download' ){ // Download the export $path = isset( $_SESSION['ocuserexportpath'] ) ? $_SESSION['ocuserexportpath'] : false; if( !$path ){ - OC_JSON::error(); + OCP\JSON::error(); } header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=" . basename($path)); |