]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #12025 from annando/no-boot-src-module
[friendica.git] / src / App.php
index 003ff5658984e3b55685b18ddcdf52cbf0c59592..081767cfdb3382d105339c82b4bf6754e04558af 100644 (file)
@@ -33,6 +33,7 @@ use Friendica\Core\Config\ValueObject\Cache;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\L10n;
+use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Database\Database;
@@ -157,7 +158,7 @@ class App
 
        public function isLoggedIn(): bool
        {
-               return local_user() && $this->user_id && ($this->user_id == local_user());
+               return Session::getLocalUser() && $this->user_id && ($this->user_id == Session::getLocalUser());
        }
 
        /**
@@ -171,7 +172,7 @@ class App
 
                $adminlist = explode(',', str_replace(' ', '', $admin_email));
 
-               return local_user() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
+               return Session::getLocalUser() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
        }
 
        /**
@@ -495,11 +496,11 @@ class App
 
                $page_theme = null;
                // Find the theme that belongs to the user whose stuff we are looking at
-               if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) {
+               if (!empty($this->profile_owner) && ($this->profile_owner != Session::getLocalUser())) {
                        // Allow folks to override user themes and always use their own on their own site.
                        // This works only if the user is on the same server
                        $user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
-                       if ($this->database->isResult($user) && !local_user()) {
+                       if ($this->database->isResult($user) && !Session::getLocalUser()) {
                                $page_theme = $user['theme'];
                        }
                }
@@ -528,10 +529,10 @@ class App
 
                $page_mobile_theme = null;
                // Find the theme that belongs to the user whose stuff we are looking at
-               if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) {
+               if (!empty($this->profile_owner) && ($this->profile_owner != Session::getLocalUser())) {
                        // Allow folks to override user themes and always use their own on their own site.
                        // This works only if the user is on the same server
-                       if (!local_user()) {
+                       if (!Session::getLocalUser()) {
                                $page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
                        }
                }
@@ -628,14 +629,14 @@ class App
                        }
 
                        // ZRL
-                       if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !local_user()) {
+                       if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !Session::getLocalUser()) {
                                // Only continue when the given profile link seems valid
                                // Valid profile links contain a path with "/profile/" and no query parameters
                                if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') &&
                                        strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) {
                                        if ($this->session->get('visitor_home') != $_GET['zrl']) {
-                                               Core\Session::set('my_url', $_GET['zrl']);
-                                               Core\Session::set('authenticated', 0);
+                                               $this->session->set('my_url', $_GET['zrl']);
+                                               $this->session->set('authenticated', 0);
 
                                                $remote_contact = Contact::getByURL($_GET['zrl'], false, ['subscribe']);
                                                if (!empty($remote_contact['subscribe'])) {