summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-03-03 09:23:42 +0100
committerGitHub <noreply@github.com>2017-03-03 09:23:42 +0100
commite648b8cb6d04bec8637b176e47663f7fb849f8b7 (patch)
tree67475b1a27883c210a79b4975c27d7f4963a35c7 /lib
parent8e9b119c5f5fdb574f2e2e2284fd506ed2257629 (diff)
parente399097e3a1abf720d50aaab240f0379aaf76997 (diff)
downloadnextcloud-server-e648b8cb6d04bec8637b176e47663f7fb849f8b7.tar.gz
nextcloud-server-e648b8cb6d04bec8637b176e47663f7fb849f8b7.zip
Merge pull request #3682 from whitekiba/master
Remove deprecated OC_User::isLoggedIn
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php4
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php2
-rw-r--r--lib/private/Cache/File.php2
-rw-r--r--lib/private/legacy/app.php4
-rw-r--r--lib/private/legacy/json.php2
-rw-r--r--lib/private/legacy/util.php4
-rw-r--r--lib/public/User.php2
7 files changed, 10 insertions, 10 deletions
diff --git a/lib/base.php b/lib/base.php
index c63efb359cc..a4bb4f584f8 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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();
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index ec36aab75d9..1c695c6805e 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -505,7 +505,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
* @return boolean
*/
function isLoggedIn() {
- return \OC_User::isLoggedIn();
+ return \OC::$server->getUserSession()->isLoggedIn();
}
/**
diff --git a/lib/private/Cache/File.php b/lib/private/Cache/File.php
index 7d9b3e0680e..513ef10f9d3 100644
--- a/lib/private/Cache/File.php
+++ b/lib/private/Cache/File.php
@@ -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());
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index a475b895d9f..d5af15bdc20 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -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);
diff --git a/lib/private/legacy/json.php b/lib/private/legacy/json.php
index f386d03ab1b..0e598a68ee1 100644
--- a/lib/private/legacy/json.php
+++ b/lib/private/legacy/json.php
@@ -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);
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 5ef1130d361..82fb07eb95a 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -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',
[
diff --git a/lib/public/User.php b/lib/public/User.php
index 75ca6b6f757..64398a7f1f8 100644
--- a/lib/public/User.php
+++ b/lib/public/User.php
@@ -100,7 +100,7 @@ class User {
* @since 5.0.0
*/
public static function isLoggedIn() {
- return \OC_User::isLoggedIn();
+ return \OC::$server->getUserSession()->isLoggedIn();
}
/**