Merge pull request #3682 from whitekiba/master
Remove deprecated OC_User::isLoggedIn
This commit is contained in:
commit
e648b8cb6d
7 changed files with 10 additions and 10 deletions
|
@ -949,7 +949,7 @@ class OC {
|
||||||
if (!self::checkUpgrade(false)
|
if (!self::checkUpgrade(false)
|
||||||
&& !$systemConfig->getValue('maintenance', false)) {
|
&& !$systemConfig->getValue('maintenance', false)) {
|
||||||
// For logged-in users: Load everything
|
// For logged-in users: Load everything
|
||||||
if(OC_User::isLoggedIn()) {
|
if(\OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
OC_App::loadApps();
|
OC_App::loadApps();
|
||||||
} else {
|
} else {
|
||||||
// For guests: Load only filesystem and logging
|
// For guests: Load only filesystem and logging
|
||||||
|
@ -986,7 +986,7 @@ class OC {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Someone is logged in
|
// Someone is logged in
|
||||||
if (OC_User::isLoggedIn()) {
|
if (\OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
OC_App::loadApps();
|
OC_App::loadApps();
|
||||||
OC_User::setupBackends();
|
OC_User::setupBackends();
|
||||||
OC_Util::setupFS();
|
OC_Util::setupFS();
|
||||||
|
|
|
@ -505,7 +505,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function isLoggedIn() {
|
function isLoggedIn() {
|
||||||
return \OC_User::isLoggedIn();
|
return \OC::$server->getUserSession()->isLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -47,7 +47,7 @@ class File implements ICache {
|
||||||
if (isset($this->storage)) {
|
if (isset($this->storage)) {
|
||||||
return $this->storage;
|
return $this->storage;
|
||||||
}
|
}
|
||||||
if (\OC_User::isLoggedIn()) {
|
if (\OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
$rootView = new View();
|
$rootView = new View();
|
||||||
$user = \OC::$server->getUserSession()->getUser();
|
$user = \OC::$server->getUserSession()->getUser();
|
||||||
Filesystem::initMountPoints($user->getUID());
|
Filesystem::initMountPoints($user->getUID());
|
||||||
|
|
|
@ -488,7 +488,7 @@ class OC_App {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the user is logged-in
|
// if the user is logged-in
|
||||||
if (OC_User::isLoggedIn()) {
|
if (\OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
// personal menu
|
// personal menu
|
||||||
$settings[] = array(
|
$settings[] = array(
|
||||||
"id" => "personal",
|
"id" => "personal",
|
||||||
|
@ -1227,7 +1227,7 @@ class OC_App {
|
||||||
*/
|
*/
|
||||||
public static function getStorage($appId) {
|
public static function getStorage($appId) {
|
||||||
if (OC_App::isEnabled($appId)) { //sanity check
|
if (OC_App::isEnabled($appId)) { //sanity check
|
||||||
if (OC_User::isLoggedIn()) {
|
if (\OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
$view = new \OC\Files\View('/' . OC_User::getUser());
|
$view = new \OC\Files\View('/' . OC_User::getUser());
|
||||||
if (!$view->file_exists($appId)) {
|
if (!$view->file_exists($appId)) {
|
||||||
$view->mkdir($appId);
|
$view->mkdir($appId);
|
||||||
|
|
|
@ -67,7 +67,7 @@ class OC_JSON{
|
||||||
*/
|
*/
|
||||||
public static function checkLoggedIn() {
|
public static function checkLoggedIn() {
|
||||||
$twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager();
|
$twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager();
|
||||||
if( !OC_User::isLoggedIn()
|
if( !\OC::$server->getUserSession()->isLoggedIn()
|
||||||
|| $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
|
|| $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
|
||||||
$l = \OC::$server->getL10N('lib');
|
$l = \OC::$server->getL10N('lib');
|
||||||
http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED);
|
http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED);
|
||||||
|
|
|
@ -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 we are not forced to load a specific user we load the one that is logged in
|
||||||
if ($user === null) {
|
if ($user === null) {
|
||||||
$user = '';
|
$user = '';
|
||||||
} else if ($user == "" && OC_User::isLoggedIn()) {
|
} else if ($user == "" && \OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
$user = OC_User::getUser();
|
$user = OC_User::getUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -971,7 +971,7 @@ class OC_Util {
|
||||||
*/
|
*/
|
||||||
public static function checkLoggedIn() {
|
public static function checkLoggedIn() {
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
if (!OC_User::isLoggedIn()) {
|
if (!\OC::$server->getUserSession()->isLoggedIn()) {
|
||||||
header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
|
header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
|
||||||
'core.login.showLoginForm',
|
'core.login.showLoginForm',
|
||||||
[
|
[
|
||||||
|
|
|
@ -100,7 +100,7 @@ class User {
|
||||||
* @since 5.0.0
|
* @since 5.0.0
|
||||||
*/
|
*/
|
||||||
public static function isLoggedIn() {
|
public static function isLoggedIn() {
|
||||||
return \OC_User::isLoggedIn();
|
return \OC::$server->getUserSession()->isLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue