]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Nav.php
Merge remote-tracking branch 'upstream/develop' into remote-rework
[friendica.git] / src / Content / Nav.php
index cb4564115aac2fc03bc4f6c63e4fc6ea2f599856..8140c5f3c13780a77da77160e95a264b7b4c86ef 100644 (file)
@@ -149,9 +149,13 @@ class Nav
                $nav['usermenu'] = [];
                $userinfo = null;
 
-               if (local_user()) {
+               if (Session::isAuthenticated()) {
                        $nav['logout'] = ['logout', L10n::t('Logout'), '', L10n::t('End this session')];
+               } else {
+                       $nav['login'] = ['login', L10n::t('Login'), ($a->module == 'login' ? 'selected' : ''), L10n::t('Sign in')];
+               }
 
+               if (local_user()) {
                        // user menu
                        $nav['usermenu'][] = ['profile/' . $a->user['nickname'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
                        $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
@@ -166,8 +170,6 @@ class Nav
                                'icon' => (DBA::isResult($contact) ? $a->removeBaseURL($contact['micro']) : 'images/person-48.jpg'),
                                'name' => $a->user['username'],
                        ];
-               } else {
-                       $nav['login'] = ['login', L10n::t('Login'), ($a->module == 'login' ? 'selected' : ''), L10n::t('Sign in')];
                }
 
                // "Home" should also take you home from an authenticated remote profile connection
@@ -180,7 +182,7 @@ class Nav
                        $nav['home'] = [$homelink, L10n::t('Home'), '', L10n::t('Home Page')];
                }
 
-               if (intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !local_user() && !remote_user()) {
+               if (intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !Session::isAuthenticated()) {
                        $nav['register'] = ['register', L10n::t('Register'), '', L10n::t('Create an account')];
                }