summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-10 15:10:19 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-10 15:10:19 +0100
commit3c5185edab2352ce0d825870ce2b4964a28a777b (patch)
tree70c97f1a89156e3d8531fabe903c63cab1eb2c72
parent0ffd32a1ae8c4b9da2434a0b5623c1fe6e910467 (diff)
parent25f523680ac1ed46470ea40277e578fd35ec02a7 (diff)
downloadnextcloud-server-3c5185edab2352ce0d825870ce2b4964a28a777b.tar.gz
nextcloud-server-3c5185edab2352ce0d825870ce2b4964a28a777b.zip
Merge pull request #7632 from owncloud/fix-7582-master
we first shall check if the current session is valid - otherwise the ses...
-rw-r--r--lib/private/api.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index 3f96196e6df..1537cc11dd0 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -270,6 +270,18 @@ class OC_API {
* @return string|false (username, or false on failure)
*/
private static function loginUser(){
+
+ // reuse existing login
+ $loggedIn = OC_User::isLoggedIn();
+ $ocsApiRequest = isset($_SERVER['HTTP_OCS_APIREQUEST']) ? $_SERVER['HTTP_OCS_APIREQUEST'] === 'true' : false;
+ if ($loggedIn === true && $ocsApiRequest) {
+
+ // initialize the user's filesystem
+ \OC_Util::setUpFS(\OC_User::getUser());
+
+ return OC_User::getUser();
+ }
+
// basic auth
$authUser = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : '';
$authPw = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
@@ -283,17 +295,6 @@ class OC_API {
return $authUser;
}
- // reuse existing login
- $loggedIn = OC_User::isLoggedIn();
- $ocsApiRequest = isset($_SERVER['HTTP_OCS_APIREQUEST']) ? $_SERVER['HTTP_OCS_APIREQUEST'] === 'true' : false;
- if ($loggedIn === true && $ocsApiRequest) {
-
- // initialize the user's filesystem
- \OC_Util::setUpFS(\OC_User::getUser());
-
- return OC_User::getUser();
- }
-
return false;
}