This commit is contained in:
2026-08-18 19:43:40 +02:00
parent 6fb5cc5c35
commit febf0f9ae5
2 changed files with 7 additions and 1 deletions

View File

@@ -282,6 +282,10 @@ export default (router, tpl) => {
totals: await lib.countf0cks(),
session: req.session,
manual_approval: getManualApproval(),
min_tags: getMinTags(),
trusted_uploads: getTrustedUploads(),
registration_open: getRegistrationOpen(),
registration_web_toggle_enabled: cfg.websrv.open_registration_web_toggle !== false,
log_user_ips: getLogUserIps(),
hash_user_ips: getHashUserIps(),
enable_cleanup: getEnableCleanup(),

View File

@@ -1595,7 +1595,8 @@ process.on('uncaughtException', err => {
if (!data.url) data.url = activeReq.url;
data.user_strict_bool = (activeReq.session && activeReq.session.strict_mode) ? true : false;
data.user_logged_in_bool = !!activeReq.session;
data.csrf_token = activeReq.session?.csrf_token || '';
data.csrf_token = activeReq.session?.csrf_token || data.csrf_token || '';
globals.csrf_token = data.csrf_token;
data.max_file_size = lib.formatSize(cfg.main.maxfilesize * (activeReq.session?.admin ? cfg.main.adminmultiplier : 1));
data.max_file_size_bytes = Math.floor(cfg.main.maxfilesize * (activeReq.session?.admin ? cfg.main.adminmultiplier : 1));
data.web_url_upload = data.web_url_upload !== undefined ? data.web_url_upload : !!cfg.websrv.web_url_upload;
@@ -1604,6 +1605,7 @@ process.on('uncaughtException', err => {
data.theme = data.theme || cfg.websrv.theme || 'f0ck';
data.user_strict_bool = false;
data.user_logged_in_bool = false;
globals.csrf_token = data.csrf_token || '';
}
return originalRender.call(tpl, view, data, (data.url && data.url !== req?.url) ? undefined : req);