diff options
Diffstat (limited to 'lib')
29 files changed, 115 insertions, 261 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/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index f4f80ebdf16..c87bcce194f 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -696,6 +696,7 @@ return array( 'OC\\Repair\\NC11\\FixMountStorages' => $baseDir . '/lib/private/Repair/NC11/FixMountStorages.php', 'OC\\Repair\\NC11\\MoveAvatars' => $baseDir . '/lib/private/Repair/NC11/MoveAvatars.php', 'OC\\Repair\\NC11\\MoveAvatarsBackgroundJob' => $baseDir . '/lib/private/Repair/NC11/MoveAvatarsBackgroundJob.php', + 'OC\\Repair\\NC12\\UpdateLanguageCodes' => $baseDir . '/lib/private/Repair/NC12/UpdateLanguageCodes.php', 'OC\\Repair\\OldGroupMembershipShares' => $baseDir . '/lib/private/Repair/OldGroupMembershipShares.php', 'OC\\Repair\\RemoveRootShares' => $baseDir . '/lib/private/Repair/RemoveRootShares.php', 'OC\\Repair\\RepairInvalidShares' => $baseDir . '/lib/private/Repair/RepairInvalidShares.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 48923c9913e..eb7188b69b3 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -726,6 +726,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Repair\\NC11\\FixMountStorages' => __DIR__ . '/../../..' . '/lib/private/Repair/NC11/FixMountStorages.php', 'OC\\Repair\\NC11\\MoveAvatars' => __DIR__ . '/../../..' . '/lib/private/Repair/NC11/MoveAvatars.php', 'OC\\Repair\\NC11\\MoveAvatarsBackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/NC11/MoveAvatarsBackgroundJob.php', + 'OC\\Repair\\NC12\\UpdateLanguageCodes' => __DIR__ . '/../../..' . '/lib/private/Repair/NC12/UpdateLanguageCodes.php', 'OC\\Repair\\OldGroupMembershipShares' => __DIR__ . '/../../..' . '/lib/private/Repair/OldGroupMembershipShares.php', 'OC\\Repair\\RemoveRootShares' => __DIR__ . '/../../..' . '/lib/private/Repair/RemoveRootShares.php', 'OC\\Repair\\RepairInvalidShares' => __DIR__ . '/../../..' . '/lib/private/Repair/RepairInvalidShares.php', diff --git a/lib/l10n/bg_BG.js b/lib/l10n/bg.js index 2692a983790..2692a983790 100644 --- a/lib/l10n/bg_BG.js +++ b/lib/l10n/bg.js diff --git a/lib/l10n/bg_BG.json b/lib/l10n/bg.json index 279f13f1bc3..279f13f1bc3 100644 --- a/lib/l10n/bg_BG.json +++ b/lib/l10n/bg.json diff --git a/lib/l10n/cs_CZ.js b/lib/l10n/cs.js index ff0b5705cea..ff0b5705cea 100644 --- a/lib/l10n/cs_CZ.js +++ b/lib/l10n/cs.js diff --git a/lib/l10n/cs_CZ.json b/lib/l10n/cs.json index ae66663d49c..ae66663d49c 100644 --- a/lib/l10n/cs_CZ.json +++ b/lib/l10n/cs.json diff --git a/lib/l10n/hu_HU.js b/lib/l10n/hu.js index 1ca8068cf77..1ca8068cf77 100644 --- a/lib/l10n/hu_HU.js +++ b/lib/l10n/hu.js diff --git a/lib/l10n/hu_HU.json b/lib/l10n/hu.json index a3f22bc7d5b..a3f22bc7d5b 100644 --- a/lib/l10n/hu_HU.json +++ b/lib/l10n/hu.json diff --git a/lib/l10n/nb_NO.js b/lib/l10n/nb.js index 0fcaa03b246..0fcaa03b246 100644 --- a/lib/l10n/nb_NO.js +++ b/lib/l10n/nb.js diff --git a/lib/l10n/nb_NO.json b/lib/l10n/nb.json index 5e745167303..5e745167303 100644 --- a/lib/l10n/nb_NO.json +++ b/lib/l10n/nb.json diff --git a/lib/l10n/ru.js b/lib/l10n/ru.js index 869ec6055f2..e3b9fcb52bc 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -166,7 +166,7 @@ OC.L10N.register( "No app name specified" : "Не указано имя приложения", "App '%s' could not be installed!" : "Приложение '%s' не может быть установлено!", "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "Приложение \"%s\" не может быть установлено, так как следующие зависимости не выполнены: %s", - "a safe home for all your data" : "надежный дом для ваших файлов", + "a safe home for all your data" : "надежный дом для всех ваших данных", "File is currently busy, please try again later" : "Файл в данный момент используется, повторите попытку позже.", "Can't read file" : "Не удается прочитать файл", "Application is not enabled" : "Приложение не разрешено", diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index 92ea68f8ac7..7ac544fd9fe 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -164,7 +164,7 @@ "No app name specified" : "Не указано имя приложения", "App '%s' could not be installed!" : "Приложение '%s' не может быть установлено!", "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "Приложение \"%s\" не может быть установлено, так как следующие зависимости не выполнены: %s", - "a safe home for all your data" : "надежный дом для ваших файлов", + "a safe home for all your data" : "надежный дом для всех ваших данных", "File is currently busy, please try again later" : "Файл в данный момент используется, повторите попытку позже.", "Can't read file" : "Не удается прочитать файл", "Application is not enabled" : "Приложение не разрешено", diff --git a/lib/l10n/sk_SK.js b/lib/l10n/sk.js index e723baebea4..e723baebea4 100644 --- a/lib/l10n/sk_SK.js +++ b/lib/l10n/sk.js diff --git a/lib/l10n/sk_SK.json b/lib/l10n/sk.json index 7deb8eb8ad8..7deb8eb8ad8 100644 --- a/lib/l10n/sk_SK.json +++ b/lib/l10n/sk.json diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index ec36aab75d9..f1c6b460a92 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -53,6 +53,7 @@ use OCP\Federation\ICloudIdManager; use OCP\Files\IAppData; use OCP\Files\Mount\IMountManager; use OCP\RichObjectStrings\IValidator; +use OCP\Util; class DIContainer extends SimpleContainer implements IAppContainer { @@ -339,6 +340,14 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c->query('ServerContainer')->getWebRoot(); }); + $this->registerService('fromMailAddress', function() { + return Util::getDefaultEmailAddress('no-reply'); + }); + + $this->registerService('OC_Defaults', function ($c) { + return $c->getServer()->getThemingDefaults(); + }); + $this->registerService('OCP\Encryption\IManager', function ($c) { return $this->getServer()->getEncryptionManager(); }); @@ -505,7 +514,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/Repair.php b/lib/private/Repair.php index 6344db64e8e..e808774ec93 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -36,6 +36,7 @@ use OC\Repair\MoveUpdaterStepFile; use OC\Repair\NC11\CleanPreviews; use OC\Repair\NC11\FixMountStorages; use OC\Repair\NC11\MoveAvatars; +use OC\Repair\NC12\UpdateLanguageCodes; use OC\Repair\OldGroupMembershipShares; use OC\Repair\RemoveRootShares; use OC\Repair\SqliteAutoincrement; @@ -134,6 +135,7 @@ class Repair implements IOutput{ \OC::$server->getConfig() ), new FixMountStorages(\OC::$server->getDatabaseConnection()), + new UpdateLanguageCodes(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), ]; } diff --git a/lib/private/Repair/NC12/UpdateLanguageCodes.php b/lib/private/Repair/NC12/UpdateLanguageCodes.php new file mode 100644 index 00000000000..891473f51a7 --- /dev/null +++ b/lib/private/Repair/NC12/UpdateLanguageCodes.php @@ -0,0 +1,89 @@ +<?php +/** + * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de> + * + * @author Morris Jobke <hey@morrisjobke.de> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OC\Repair\NC12; + +use OCP\IConfig; +use OCP\IDBConnection; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; + +class UpdateLanguageCodes implements IRepairStep { + /** @var IDBConnection */ + private $connection; + + /** @var IConfig */ + private $config; + + /** + * @param IDBConnection $connection + * @param IConfig $config + */ + public function __construct(IDBConnection $connection, + IConfig $config) { + $this->connection = $connection; + $this->config = $config; + } + + /** + * {@inheritdoc} + */ + public function getName() { + return 'Repair language codes'; + } + + /** + * {@inheritdoc} + */ + public function run(IOutput $output) { + + $versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0'); + + if (version_compare($versionFromBeforeUpdate, '12.0.0.13', '>')) { + return; + } + + $languages = [ + 'bg_BG' => 'bg', + 'cs_CZ' => 'cs', + 'fi_FI' => 'fi', + 'hu_HU' => 'hu', + 'nb_NO' => 'nb', + 'sk_SK' => 'sk', + 'th_TH' => 'th', + ]; + + foreach ($languages as $oldCode => $newCode) { + $qb = $this->connection->getQueryBuilder(); + + $affectedRows = $qb->update('preferences') + ->set('configvalue', $qb->createNamedParameter($newCode)) + ->where($qb->expr()->eq('appid', $qb->createNamedParameter('core'))) + ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lang'))) + ->andWhere($qb->expr()->eq('configvalue', $qb->createNamedParameter($oldCode))) + ->execute(); + + $output->info('Changed ' . $affectedRows . ' setting(s) from "' . $oldCode . '" to "' . $newCode . '" in preferences table.'); + } + } +} diff --git a/lib/private/Share20/ProviderFactory.php b/lib/private/Share20/ProviderFactory.php index 79589739523..bbc6f4ffbd3 100644 --- a/lib/private/Share20/ProviderFactory.php +++ b/lib/private/Share20/ProviderFactory.php @@ -133,7 +133,7 @@ class ProviderFactory implements IProviderFactory { /** * Create the federated share provider * - * @return FederatedShareProvider + * @return ShareByMailProvider */ protected function getShareByMailProvider() { if ($this->shareByMailProvider === null) { 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/group/database.php b/lib/private/legacy/group/database.php deleted file mode 100644 index ddf9d29037e..00000000000 --- a/lib/private/legacy/group/database.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * Class OC_Group_Database - * @deprecated Since 9.1.0 use \OC\Group\Database - */ -class OC_Group_Database extends \OC\Group\Database { - -}
\ No newline at end of file diff --git a/lib/private/legacy/group/example.php b/lib/private/legacy/group/example.php deleted file mode 100644 index c800c54b8a0..00000000000 --- a/lib/private/legacy/group/example.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Bart Visscher <bartv@thisnet.nl> - * @author Felix Moeller <mail@felixmoeller.de> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Michael Gapczynski <GapczynskiM@gmail.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <robin@icewind.nl> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * abstract reference class for group management - * this class should only be used as a reference for method signatures and their descriptions - */ -abstract class OC_Group_Example { - /** - * Try to create a new group - * @param string $gid The name of the group to create - * @return bool - * - * Tries to create a new group. If the group name already exists, false will - * be returned. - */ - abstract public static function createGroup($gid); - - /** - * delete a group - * @param string $gid gid of the group to delete - * @return bool - * - * Deletes a group and removes it from the group_user-table - */ - abstract public static function deleteGroup($gid); - - /** - * is user in group? - * @param string $uid uid of the user - * @param string $gid gid of the group - * @return bool - * - * Checks whether the user is member of a group or not. - */ - abstract public static function inGroup($uid, $gid); - - /** - * Add a user to a group - * @param string $uid Name of the user to add to group - * @param string $gid Name of the group in which add the user - * @return bool - * - * Adds a user to a group. - */ - abstract public static function addToGroup($uid, $gid); - - /** - * Removes a user from a group - * @param string $uid Name of the user to remove from group - * @param string $gid Name of the group from which remove the user - * @return bool - * - * removes the user from a group. - */ - abstract public static function removeFromGroup($uid, $gid); - - /** - * Get all groups a user belongs to - * @param string $uid Name of the user - * @return array an array of group names - * - * This function fetches all groups a user belongs to. It does not check - * if the user exists at all. - */ - abstract public static function getUserGroups($uid); - - /** - * get a list of all groups - * @param string $search - * @param int $limit - * @param int $offset - * @return array an array of group names - */ - abstract public static function getGroups($search = '', $limit = -1, $offset = 0); - - /** - * Check if a group exists - * @param string $gid - * @return bool - */ - abstract public function groupExists($gid); - - /** - * get a list of all users in a group - * @param string $gid - * @param string $search - * @param int $limit - * @param int $offset - * @return array an array of user ids - */ - abstract public static function usersInGroup($gid, $search = '', $limit = -1, $offset = 0); -} diff --git a/lib/private/legacy/group/interface.php b/lib/private/legacy/group/interface.php deleted file mode 100644 index c3563b15776..00000000000 --- a/lib/private/legacy/group/interface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Arthur Schiwon <blizzz@arthur-schiwon.de> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Morris Jobke <hey@morrisjobke.de> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * Interface OC_Group_Interface - * @deprecated use the public \OCP\GroupInterface instead - */ -interface OC_Group_Interface extends \OCP\GroupInterface {} 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/ocs.php b/lib/private/legacy/ocs.php deleted file mode 100644 index a03cba7bc1a..00000000000 --- a/lib/private/legacy/ocs.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Bart Visscher <bartv@thisnet.nl> - * @author Frank Karlitschek <frank@karlitschek.de> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <robin@icewind.nl> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ -use OCP\API; - -/** - * Class to handle open collaboration services API requests - */ -class OC_OCS { - /** - * Called when a not existing OCS endpoint has been called - */ - public static function notFound() { - $format = \OC::$server->getRequest()->getParam('format', 'xml'); - $txt='Invalid query, please check the syntax. API specifications are here:' - .' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n"; - OC_API::respond(new OC_OCS_Result(null, API::RESPOND_NOT_FOUND, $txt), $format); - } - -} diff --git a/lib/private/legacy/ocs/person.php b/lib/private/legacy/ocs/person.php deleted file mode 100644 index bd01639a737..00000000000 --- a/lib/private/legacy/ocs/person.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * @deprecated Since 9.1.0 use \OC\OCS\Person - */ -class OC_OCS_Person extends \OC\OCS\Person { -} 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(); } /** |