]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove deprecated OC_User::isLoggedIn 3682/head
authorSebastian Wessalowski <sebastian@wessalowski.org>
Thu, 2 Mar 2017 15:52:05 +0000 (16:52 +0100)
committerSebastian Wessalowski <sebastian@wessalowski.org>
Thu, 2 Mar 2017 21:59:39 +0000 (22:59 +0100)
Signed-off-by: Sebastian Wessalowski <sebastian@wessalowski.org>
lib/base.php
lib/private/AppFramework/DependencyInjection/DIContainer.php
lib/private/Cache/File.php
lib/private/legacy/app.php
lib/private/legacy/json.php
lib/private/legacy/util.php
lib/public/User.php

index c63efb359cc48b98ba650f65c6290da7e471b210..a4bb4f584f8d21098359d79a1c91a42fa9831f9b 100644 (file)
@@ -949,7 +949,7 @@ class OC {
                if (!self::checkUpgrade(false)
                        && !$systemConfig->getValue('maintenance', false)) {
                        // For logged-in users: Load everything
-                       if(OC_User::isLoggedIn()) {
+                       if(\OC::$server->getUserSession()->isLoggedIn()) {
                                OC_App::loadApps();
                        } else {
                                // For guests: Load only filesystem and logging
@@ -986,7 +986,7 @@ class OC {
                }
 
                // Someone is logged in
-               if (OC_User::isLoggedIn()) {
+               if (\OC::$server->getUserSession()->isLoggedIn()) {
                        OC_App::loadApps();
                        OC_User::setupBackends();
                        OC_Util::setupFS();
index ec36aab75d9a438eba09fc9b2146f4b0267d8f4b..1c695c6805e7564710a52be191d204e8344cf744 100644 (file)
@@ -505,7 +505,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
         * @return boolean
         */
        function isLoggedIn() {
-               return \OC_User::isLoggedIn();
+               return \OC::$server->getUserSession()->isLoggedIn();
        }
 
        /**
index 7d9b3e0680ec5c82605a71b0dd87747718433e4f..513ef10f9d327fe1d4875413c147360b1070d89f 100644 (file)
@@ -47,7 +47,7 @@ class File implements ICache {
                if (isset($this->storage)) {
                        return $this->storage;
                }
-               if (\OC_User::isLoggedIn()) {
+               if (\OC::$server->getUserSession()->isLoggedIn()) {
                        $rootView = new View();
                        $user = \OC::$server->getUserSession()->getUser();
                        Filesystem::initMountPoints($user->getUID());
index a475b895d9fdf601d551fa0562aa7676058ac569..d5af15bdc20815a33273f102d0e4c14ede102283 100644 (file)
@@ -488,7 +488,7 @@ class OC_App {
                }
 
                // if the user is logged-in
-               if (OC_User::isLoggedIn()) {
+               if (\OC::$server->getUserSession()->isLoggedIn()) {
                        // personal menu
                        $settings[] = array(
                                "id" => "personal",
@@ -1227,7 +1227,7 @@ class OC_App {
         */
        public static function getStorage($appId) {
                if (OC_App::isEnabled($appId)) { //sanity check
-                       if (OC_User::isLoggedIn()) {
+                       if (\OC::$server->getUserSession()->isLoggedIn()) {
                                $view = new \OC\Files\View('/' . OC_User::getUser());
                                if (!$view->file_exists($appId)) {
                                        $view->mkdir($appId);
index f386d03ab1bd315b29a6fc07e56d61ae9ffb67ef..0e598a68ee1de82717f3e5400a46b89121b8284e 100644 (file)
@@ -67,7 +67,7 @@ class OC_JSON{
         */
        public static function checkLoggedIn() {
                $twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager();
-               if( !OC_User::isLoggedIn()
+               if( !\OC::$server->getUserSession()->isLoggedIn()
                        || $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
                        $l = \OC::$server->getL10N('lib');
                        http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED);
index 5ef1130d361b3588797e8792c13ada128ff53c3e..82fb07eb95aa910b820a6b70acb400570a704475 100644 (file)
@@ -137,7 +137,7 @@ class OC_Util {
                // If we are not forced to load a specific user we load the one that is logged in
                if ($user === null) {
                        $user = '';
-               } else if ($user == "" && OC_User::isLoggedIn()) {
+               } else if ($user == "" && \OC::$server->getUserSession()->isLoggedIn()) {
                        $user = OC_User::getUser();
                }
 
@@ -971,7 +971,7 @@ class OC_Util {
         */
        public static function checkLoggedIn() {
                // Check if we are a user
-               if (!OC_User::isLoggedIn()) {
+               if (!\OC::$server->getUserSession()->isLoggedIn()) {
                        header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
                                                'core.login.showLoginForm',
                                                [
index 75ca6b6f757055126fbe6e7701584f70583a3440..64398a7f1f81842bc87a34770e245d7779d4adc1 100644 (file)
@@ -100,7 +100,7 @@ class User {
         * @since 5.0.0
         */
        public static function isLoggedIn() {
-               return \OC_User::isLoggedIn();
+               return \OC::$server->getUserSession()->isLoggedIn();
        }
 
        /**