summaryrefslogtreecommitdiffstats
path: root/lib/private/api.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-29 23:07:27 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-29 23:07:27 +0100
commit3d42e402c5f1956bc72ac5accc268f519d66c3e9 (patch)
treec2a033c6e28c10e26c144dfacac334fe19c4afab /lib/private/api.php
parentde57e36b6b6ad7b947bb601f0824902401ec4fbe (diff)
downloadnextcloud-server-3d42e402c5f1956bc72ac5accc268f519d66c3e9.tar.gz
nextcloud-server-3d42e402c5f1956bc72ac5accc268f519d66c3e9.zip
http header OCS-ApiRequest: true is required in case of session based OCS API calls
Diffstat (limited to 'lib/private/api.php')
-rw-r--r--lib/private/api.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index 26091657b31..0576f3e3f93 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -250,7 +250,8 @@ class OC_API {
// reuse existing login
$loggedIn = OC_User::isLoggedIn();
- if ($loggedIn === true) {
+ $ocsApiRequest = isset($_SERVER['OCS_APIREQUEST']) ? $_SERVER['OCS_APIREQUEST'] === 'true' : false;
+ if ($loggedIn === true && $ocsApiRequest) {
return OC_User::getUser();
}