Merge pull request #14308 from nextcloud/backport/14178/stable15
[stable15] Fix OC.getCurrentUser() on guest pages
This commit is contained in:
commit
52662fb928
|
@ -1,6 +1,10 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" >
|
<html class="ng-csp" data-placeholder-focus="false" lang="<?php p($_['language']); ?>" data-locale="<?php p($_['locale']); ?>" >
|
||||||
<head data-requesttoken="<?php p($_['requesttoken']); ?>">
|
<head
|
||||||
|
<?php if ($_['user_uid']) { ?>
|
||||||
|
data-user="<?php p($_['user_uid']); ?>" data-user-displayname="<?php p($_['user_displayname']); ?>"
|
||||||
|
<?php } ?>
|
||||||
|
data-requesttoken="<?php p($_['requesttoken']); ?>">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>
|
<title>
|
||||||
<?php p($theme->getTitle()); ?>
|
<?php p($theme->getTitle()); ?>
|
||||||
|
|
|
@ -122,6 +122,10 @@ class TemplateLayout extends \OC_Template {
|
||||||
parent::__construct('core', 'layout.guest');
|
parent::__construct('core', 'layout.guest');
|
||||||
\OC_Util::addStyle('guest');
|
\OC_Util::addStyle('guest');
|
||||||
$this->assign('bodyid', 'body-login');
|
$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') {
|
} else if ($renderAs == 'public') {
|
||||||
parent::__construct('core', 'layout.public');
|
parent::__construct('core', 'layout.public');
|
||||||
$this->assign( 'appid', $appId );
|
$this->assign( 'appid', $appId );
|
||||||
|
|
Loading…
Reference in New Issue