mirror of
https://github.com/luxfi/pics.git
synced 2026-07-27 05:11:31 +00:00
Add missing locals for pages to render forceActionTwofactor
Refactor force twofactor field into an include
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const { Posts, Boards } = require(__dirname+'/../../db/')
|
||||
, config = require(__dirname+'/../../lib/misc/config.js')
|
||||
, { Permissions } = require(__dirname+'/../../lib/permission/permissions.js')
|
||||
, Permission = require(__dirname+'/../../lib/permission/permission.js');
|
||||
|
||||
module.exports = async (req, res, next) => {
|
||||
|
||||
const { forceActionTwofactor } = config.get;
|
||||
let boardReportCountMap = {}; //map of board to open report count
|
||||
let globalReportCount = 0; //number of open global reports
|
||||
let boardPermissions; //map of board perms
|
||||
@@ -54,6 +56,7 @@ module.exports = async (req, res, next) => {
|
||||
boardPermissions,
|
||||
boardReportCountMap,
|
||||
globalReportCount,
|
||||
forceActionTwofactor,
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const { Accounts } = require(__dirname+'/../../../db/')
|
||||
, config = require(__dirname+'/../../../lib/misc/config.js')
|
||||
, roleManager = require(__dirname+'/../../../lib/permission/rolemanager.js')
|
||||
, pageQueryConverter = require(__dirname+'/../../../lib/input/pagequeryconverter.js')
|
||||
, limit = 20;
|
||||
|
||||
module.exports = async (req, res, next) => {
|
||||
|
||||
const { forceActionTwofactor } = config.get;
|
||||
const { page, offset, queryString } = pageQueryConverter(req.query, limit);
|
||||
|
||||
let filter = {};
|
||||
@@ -50,6 +52,7 @@ module.exports = async (req, res, next) => {
|
||||
page,
|
||||
maxPage,
|
||||
roleNameMap: roleManager.roleNameMap,
|
||||
forceActionTwofactor,
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const config = require(__dirname+'/../../../lib/misc/config.js')
|
||||
@@ -8,6 +9,8 @@ const config = require(__dirname+'/../../../lib/misc/config.js')
|
||||
|
||||
module.exports = async (req, res) => {
|
||||
|
||||
const { forceActionTwofactor } = config.get;
|
||||
|
||||
res
|
||||
.set('Cache-Control', 'private, max-age=5')
|
||||
.render('globalmanagesettings', {
|
||||
@@ -20,6 +23,7 @@ module.exports = async (req, res) => {
|
||||
codeThemes,
|
||||
fontList,
|
||||
languages: i18n.getLocales(),
|
||||
forceActionTwofactor,
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
if forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
@@ -150,10 +150,7 @@ block content
|
||||
.label #{__("I'm sure")}
|
||||
label.postform-style.ph-5
|
||||
input(type='checkbox', name='confirm', value='true' required)
|
||||
if forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
include ../includes/forceactiontwofactor.pug
|
||||
input(type='submit', value=__('Resign'))
|
||||
|
||||
hr(size=1)
|
||||
@@ -165,9 +162,6 @@ block content
|
||||
.label #{__("I'm sure")}
|
||||
label.postform-style.ph-5
|
||||
input(type='checkbox', name='confirm', value='true' required)
|
||||
if forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
include ../includes/forceactiontwofactor.pug
|
||||
input(type='submit', value=__('Delete'))
|
||||
|
||||
|
||||
@@ -72,10 +72,7 @@ block content
|
||||
.pages.mv-5
|
||||
include ../includes/pages.pug
|
||||
h4.mv-5 #{__('Delete Selected')}:
|
||||
if forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
include ../includes/forceactiontwofactor.pug
|
||||
input(type='submit', value=__('Delete'))
|
||||
else
|
||||
p #{__('No results.')}
|
||||
|
||||
@@ -27,10 +27,7 @@ block content
|
||||
.sm#tab-11
|
||||
.tabbed-area
|
||||
include ../includes/globalmanagesettings.pug
|
||||
if settings.forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
include ../includes/forceactiontwofactor.pug
|
||||
input.row(type='submit', value=__('Save settings'))
|
||||
hr(size=1)
|
||||
h4.no-m-p #{__('Delete board')}:
|
||||
@@ -59,8 +56,5 @@ block content
|
||||
.label #{__("I'm sure")}
|
||||
label.postform-style.ph-5
|
||||
input(type='checkbox', name='confirm', value='true' required)
|
||||
if settings.forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
include ../includes/forceactiontwofactor.pug
|
||||
input(type='submit', value=__('Submit'))
|
||||
|
||||
@@ -315,8 +315,5 @@ block content
|
||||
.label #{__('Blocked Countries')}
|
||||
include ../includes/2charisocountries.pug
|
||||
|
||||
if forceActionTwofactor === true
|
||||
.row
|
||||
.label #{__('2FA Code')}
|
||||
input(type='text' name='twofactor' required)
|
||||
include ../includes/forceactiontwofactor.pug
|
||||
input.row(type='submit', value=__('Save settings'))
|
||||
|
||||
Reference in New Issue
Block a user