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
}
// Someone is logged in
- if (OC_User::isLoggedIn()) {
+ if (\OC::$server->getUserSession()->isLoggedIn()) {
OC_App::loadApps();
OC_User::setupBackends();
OC_Util::setupFS();
* @return boolean
*/
function isLoggedIn() {
- return \OC_User::isLoggedIn();
+ return \OC::$server->getUserSession()->isLoggedIn();
}
/**
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());
}
// if the user is logged-in
- if (OC_User::isLoggedIn()) {
+ if (\OC::$server->getUserSession()->isLoggedIn()) {
// personal menu
$settings[] = array(
"id" => "personal",
*/
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);
*/
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);
// 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();
}
*/
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',
[
* @since 5.0.0
*/
public static function isLoggedIn() {
- return \OC_User::isLoggedIn();
+ return \OC::$server->getUserSession()->isLoggedIn();
}
/**