From: Matthias Schmidt Date: Tue, 20 Apr 2021 14:07:46 +0000 (+0200) Subject: Initialize JS user before bootstrapping X-Git-Tag: 5.4.0_Alpha_1~72 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c3dbdabdf831ad777bfdc1f488ec5ec09c8fd57c;p=GitHub%2FWoltLab%2FWCF.git Initialize JS user before bootstrapping See #4123 --- diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 27d2649b7f..599f9f1ea6 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -166,6 +166,12 @@ window.addEventListener('pageshow', function(event) { {event name='javascriptLanguageImport'} }); + User.init( + {@$__wcf->user->userID}, + '{@$__wcf->user->username|encodeJS}', + {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if} + ); + BootstrapFrontend.setup({ backgroundQueue: { url: '{link controller="BackgroundQueuePerform"}{/link}', @@ -178,8 +184,6 @@ window.addEventListener('pageshow', function(event) { {/if} styleChanger: {if $__wcf->getStyleHandler()->showStyleChanger()}true{else}false{/if} }); - - User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}', {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if}); }); // prevent jQuery and other libraries from utilizing define() diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index fce0153c67..c6eeddd28b 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -148,13 +148,17 @@ {event name='javascriptLanguageImport'} }); + User.init( + {@$__wcf->user->userID}, + '{@$__wcf->user->username|encodeJS}', + {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if} + ); + AcpBootstrap.setup({ bootstrap: { enableMobileMenu: {if PACKAGE_ID && $__isLogin|empty}true{else}false{/if} } }); - - User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}', {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if}); });