]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix isLoggedIn() check for user '0'
authorJoas Schilling <nickvergessen@gmx.de>
Mon, 4 Aug 2014 12:47:14 +0000 (14:47 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 6 Aug 2014 08:24:05 +0000 (10:24 +0200)
Fix #9972

Conflicts:
lib/private/user/session.php

lib/private/user.php
lib/private/user/session.php

index a8431af97fdac628dc81946efd7cfd3a9c7af46a..5efe205ced9d66e8c0a3592f1d072bbb47da4b69 100644 (file)
@@ -337,7 +337,7 @@ class OC_User {
         * Checks if the user is logged in
         */
        public static function isLoggedIn() {
-               if (\OC::$session->get('user_id') && self::$incognitoMode === false) {
+               if (\OC::$session->get('user_id') !== null && self::$incognitoMode === false) {
                        return self::userExists(\OC::$session->get('user_id'));
                }
                return false;
index 3e0d7ab596777a3135b0bfb52220c05060424a18..92f2c8edc175a4d0cfd273a024232de0326f51ab 100644 (file)
@@ -106,7 +106,7 @@ class Session implements IUserSession, Emitter {
                        return $this->activeUser;
                } else {
                        $uid = $this->getSession()->get('user_id');
-                       if ($uid) {
+                       if ($uid !== null) {
                                $this->activeUser = $this->manager->get($uid);
                                return $this->activeUser;
                        } else {