summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-02-22 14:50:14 +0100
committerGitHub <noreply@github.com>2019-02-22 14:50:14 +0100
commitd03dd0c087577eea376efb8e67c3a0fd3c7b2a32 (patch)
tree55c62476ec9dcc22bc446a1e8d40a604cfc25b35
parent69519252a96a9d9f54c94c8688a5ff9b4deaffd3 (diff)
parent5b22b1e6c8f1a2300949559125a8c31a9b3d1d15 (diff)
downloadnextcloud-server-d03dd0c087577eea376efb8e67c3a0fd3c7b2a32.tar.gz
nextcloud-server-d03dd0c087577eea376efb8e67c3a0fd3c7b2a32.zip
Merge pull request #14339 from nextcloud/backport/14337/stable15
[stable15] Fix "Undefined index: user_uid" on login page
-rw-r--r--lib/private/TemplateLayout.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 60fc82efbc6..1b017a527c2 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -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');