]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix "Undefined index: user_uid" on login page 14337/head
authorJoas Schilling <coding@schilljs.com>
Fri, 22 Feb 2019 07:33:32 +0000 (08:33 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 22 Feb 2019 07:33:32 +0000 (08:33 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/TemplateLayout.php

index 74578afe861cbd48c289bcc2b23a6d1c8a03d553..f23ec97119f5b3db70674370f1fa43902484a319 100644 (file)
@@ -67,7 +67,7 @@ class TemplateLayout extends \OC_Template {
                }
 
                // Decide which page we show
-               if($renderAs == 'user') {
+               if($renderAs === 'user') {
                        parent::__construct( 'core', 'layout.user' );
                        if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) {
                                $this->assign('bodyid', 'body-settings');
@@ -115,10 +115,12 @@ class TemplateLayout extends \OC_Template {
                                $this->assign('themingInvertMenu', false);
                        }
 
-               } else if ($renderAs == 'error') {
+               } else if ($renderAs === 'error') {
                        parent::__construct('core', 'layout.guest', '', false);
                        $this->assign('bodyid', 'body-login');
-               } else if ($renderAs == 'guest') {
+                       $this->assign('user_displayname', '');
+                       $this->assign('user_uid', '');
+               } else if ($renderAs === 'guest') {
                        parent::__construct('core', 'layout.guest');
                        \OC_Util::addStyle('guest');
                        $this->assign('bodyid', 'body-login');
@@ -126,7 +128,7 @@ class TemplateLayout extends \OC_Template {
                        $userDisplayName = \OC_User::getDisplayName();
                        $this->assign('user_displayname', $userDisplayName);
                        $this->assign('user_uid', \OC_User::getUser());
-               } else if ($renderAs == 'public') {
+               } else if ($renderAs === 'public') {
                        parent::__construct('core', 'layout.public');
                        $this->assign( 'appid', $appId );
                        $this->assign('bodyid', 'body-public');