UserSession class [3] - Refactor src/ files excluding Module/Model

This commit is contained in:
Philipp 2022-10-20 21:22:47 +02:00
parent a11c125f81
commit b3f9cef94a
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
23 changed files with 120 additions and 133 deletions

View file

@ -34,7 +34,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Lock\Capability\ICanLock;
use Friendica\Core\Session;
use Friendica\DI;
use Friendica\LegacyModule;
use Friendica\Module\HTTPException\MethodNotAllowed;
use Friendica\Module\HTTPException\PageNotFound;
@ -309,7 +309,7 @@ class Router
if (Addon::isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
//Check if module is an app and if public access to apps is allowed or not
$privateapps = $this->config->get('config', 'private_addons', false);
if (!Session::getLocalUser() && Hook::isAddonApp($moduleName) && $privateapps) {
if (!DI::userSession()->getLocalUserId() && Hook::isAddonApp($moduleName) && $privateapps) {
throw new MethodNotAllowedException($this->l10n->t("You must be logged in to use addons. "));
} else {
include_once "addon/{$moduleName}/{$moduleName}.php";