summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-02-07 13:27:46 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-02-07 13:27:46 +0100
commit108f3327e6aaca3f70064ec318d1b84e23ecf584 (patch)
treee8faf4acac1bfddcb51d23f6401be93a75bf0bcb /apps/files
parent77c0314503689503df4b6ea63f5572be24946076 (diff)
parente25a0303f4eeda88fd7d8b76ee3d41a6081dfb74 (diff)
downloadnextcloud-server-108f3327e6aaca3f70064ec318d1b84e23ecf584.tar.gz
nextcloud-server-108f3327e6aaca3f70064ec318d1b84e23ecf584.zip
Merge pull request #13502 from owncloud/streamline-authentication-in-newfile
Streamline CSRF and login check
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/newfile.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index 0eb144aca56..159a8b5d7a3 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -3,9 +3,8 @@
// Init owncloud
global $eventSource;
-if(!OC_User::isLoggedIn()) {
- exit;
-}
+\OCP\JSON::checkLoggedIn();
+\OCP\JSON::callCheck();
\OC::$server->getSession()->close();
@@ -17,8 +16,6 @@ $source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : '';
if($source) {
$eventSource = \OC::$server->createEventSource();
-} else {
- OC_JSON::callCheck();
}
function progress($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) {
@@ -138,7 +135,7 @@ if($source) {
}
}
}
- $result=\OC\Files\Filesystem::file_put_contents($target, $sourceStream);
+ $result = \OC\Files\Filesystem::file_put_contents($target, $sourceStream);
}
if($result) {
$meta = \OC\Files\Filesystem::getFileInfo($target);