summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-10-31 18:37:59 +0100
committerLukas Reschke <lukas@statuscode.ch>2012-10-31 18:37:59 +0100
commit7a7f12a0c126522cb067de692af0950d46bf15fc (patch)
tree1364f5ec500ead1ac29adde4cc72e5174a7a29ed /core/ajax
parentac784baef689ca5c0f22c8acdce8e13f6d918101 (diff)
downloadnextcloud-server-7a7f12a0c126522cb067de692af0950d46bf15fc.tar.gz
nextcloud-server-7a7f12a0c126522cb067de692af0950d46bf15fc.zip
Create only one CSRF token per session
Before, the CSRF token expired every hour. We had a script in place which should refresh the token but this don't worked in every case. (Laptop sleeping etc.) With this commit, the token will only get once created for every session so that the "Token expired" warning shouldn't appear.
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/requesttoken.php40
1 files changed, 0 insertions, 40 deletions
diff --git a/core/ajax/requesttoken.php b/core/ajax/requesttoken.php
deleted file mode 100644
index 9d43a722852..00000000000
--- a/core/ajax/requesttoken.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
-* ownCloud
-* @author Christian Reiner
-* @copyright 2011-2012 Christian Reiner <foss@christian-reiner.info>
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the license, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-* License along with this library.
-* If not, see <http://www.gnu.org/licenses/>.
-*
-*/
-
-/**
- * @file core/ajax/requesttoken.php
- * @brief Ajax method to retrieve a fresh request protection token for ajax calls
- * @return json: success/error state indicator including a fresh request token
- * @author Christian Reiner
- */
-
-// don't load apps or filesystem for this task
-$RUNTIME_NOAPPS = true;
-$RUNTIME_NOSETUPFS = true;
-
-// Sanity checks
-// using OCP\JSON::callCheck() below protects the token refreshing itself.
-//OCP\JSON::callCheck ( );
-OCP\JSON::checkLoggedIn ( );
-// hand out a fresh token
-OCP\JSON::success ( array ( 'token' => OCP\Util::callRegister() ) );
-?>