From 2f98c873fab666b0297e540b5c816a72fe945855 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Feb 2019 14:50:06 +0100 Subject: Fix OC.getCurrentUser() on guest pages Signed-off-by: Joas Schilling --- lib/private/TemplateLayout.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 284f14c5db4..60fc82efbc6 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -122,6 +122,10 @@ class TemplateLayout extends \OC_Template { parent::__construct('core', 'layout.guest'); \OC_Util::addStyle('guest'); $this->assign('bodyid', 'body-login'); + + $userDisplayName = \OC_User::getDisplayName(); + $this->assign('user_displayname', $userDisplayName); + $this->assign('user_uid', \OC_User::getUser()); } else if ($renderAs == 'public') { parent::__construct('core', 'layout.public'); $this->assign( 'appid', $appId ); -- cgit v1.2.3