Merge pull request #13502 from owncloud/streamline-authentication-in-newfile
Streamline CSRF and login check
This commit is contained in:
commit
108f3327e6
|
@ -3,9 +3,8 @@
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
global $eventSource;
|
global $eventSource;
|
||||||
|
|
||||||
if(!OC_User::isLoggedIn()) {
|
\OCP\JSON::checkLoggedIn();
|
||||||
exit;
|
\OCP\JSON::callCheck();
|
||||||
}
|
|
||||||
|
|
||||||
\OC::$server->getSession()->close();
|
\OC::$server->getSession()->close();
|
||||||
|
|
||||||
|
@ -17,8 +16,6 @@ $source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : '';
|
||||||
|
|
||||||
if($source) {
|
if($source) {
|
||||||
$eventSource = \OC::$server->createEventSource();
|
$eventSource = \OC::$server->createEventSource();
|
||||||
} else {
|
|
||||||
OC_JSON::callCheck();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function progress($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) {
|
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) {
|
if($result) {
|
||||||
$meta = \OC\Files\Filesystem::getFileInfo($target);
|
$meta = \OC\Files\Filesystem::getFileInfo($target);
|
||||||
|
|
Loading…
Reference in New Issue