[Pkg-owncloud-commits] [owncloud] 06/11: [user_migrate] Add requesttoken
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:09:30 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.0.12
in repository owncloud.
commit de9befdda0195f598aea8afba9bdde2cc2310c50
Author: Lukas Reschke <lukas at statuscode.ch>
Date: Tue Feb 12 12:22:06 2013 +0100
[user_migrate] Add requesttoken
---
apps/user_migrate/ajax/export.php | 1 +
apps/user_migrate/js/export.js | 2 +-
apps/user_migrate/settings.php | 1 +
apps/user_migrate/templates/settings.php | 1 +
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/apps/user_migrate/ajax/export.php b/apps/user_migrate/ajax/export.php
index 07c35c7..e339b48 100644
--- a/apps/user_migrate/ajax/export.php
+++ b/apps/user_migrate/ajax/export.php
@@ -25,6 +25,7 @@
// Check if we are a user
OCP\JSON::checkLoggedIn();
+OCP\JSON::callCheck();
OCP\App::checkAppEnabled('user_migrate');
// Which operation
if( $_GET['operation']=='create' ){
diff --git a/apps/user_migrate/js/export.js b/apps/user_migrate/js/export.js
index aef45c4..4afc8b7 100644
--- a/apps/user_migrate/js/export.js
+++ b/apps/user_migrate/js/export.js
@@ -9,7 +9,7 @@ $(document).ready(function(){
function(result){
if(result.status == 'success'){
// Download the file
- window.location = OC.linkTo('user_migrate','ajax/export.php') + '?operation=download';
+ window.location = OC.linkTo('user_migrate','ajax/export.php') + '?operation=download&requesttoken=' + requesttoken;
$('.loading').hide();
$('#exportbtn').val(t('user_migrate', 'Export'));
} else {
diff --git a/apps/user_migrate/settings.php b/apps/user_migrate/settings.php
index 4772c27..f685b08 100644
--- a/apps/user_migrate/settings.php
+++ b/apps/user_migrate/settings.php
@@ -27,6 +27,7 @@ OC_Util::checkLoggedIn();
OCP\App::checkAppEnabled('user_migrate');
if (isset($_POST['user_import'])) {
+ OCP\JSON::callCheck();
$root = OC::$SERVERROOT . "/";
$importname = "owncloud_import_" . date("y-m-d_H-i-s");
diff --git a/apps/user_migrate/templates/settings.php b/apps/user_migrate/templates/settings.php
index 1718abe..351f974 100644
--- a/apps/user_migrate/templates/settings.php
+++ b/apps/user_migrate/templates/settings.php
@@ -14,6 +14,7 @@
</p>
<p><input type="file" id="owncloud_import" name="owncloud_import" style="width:180px;"><label for="owncloud_import"> <?php echo $l->t('ownCloud User Zip');?></label>
</p>
+ <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="submit" name="user_import" value="<?php echo $l->t('Import'); ?>" />
</fieldset>
</form>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list