http header OCS-ApiRequest: true is required in case of session based OCS API calls

This commit is contained in:
Thomas Müller 2013-10-29 23:07:27 +01:00
parent de57e36b6b
commit 3d42e402c5
1 changed files with 2 additions and 1 deletions

View File

@ -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();
}