包含:登录失败锁定、90天密码有效期、30分钟会话超时、 强制改密、登录审计日志、屏幕水印、企业背景图、 备案信息固定底部、favicon、JS空集合保护、 会话过期体验优化(403 JSON)、display_errors 关闭、 固定 key 根治 Integrity check failed 等全部改动 注意:config.inc.php/.htaccess/.user.ini 含敏感信息, 通过 .gitignore 排除,勿推送到公开仓库。
63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace MRBS;
|
|
|
|
require "../defaultincludes.inc";
|
|
|
|
http_headers(array("Content-type: application/x-javascript"),
|
|
60*30); // 30 minute expiry
|
|
?>
|
|
|
|
'use strict';
|
|
|
|
$(document).on('page_ready', function() {
|
|
|
|
function resetTimer()
|
|
{
|
|
clearTimeout(idleTimer);
|
|
idleTimer = setTimeout(whenUserIdle, <?php echo $kiosk_exit_page_timeout ?>*1000);
|
|
}
|
|
|
|
function whenUserIdle()
|
|
{
|
|
let url = 'index.php';
|
|
if (Object.hasOwn(args, 'site'))
|
|
{
|
|
url += '?site=' + encodeURIComponent(args.site);
|
|
}
|
|
window.location.replace(url);
|
|
}
|
|
|
|
var idleTimer;
|
|
|
|
<?php
|
|
// If it's the exit page then (a) disable everything except the exit form and
|
|
// (b) set a timeout on the page.
|
|
?>
|
|
if ($('#kiosk_exit').length) {
|
|
|
|
$(document.body).on('click keydown mousemove', resetTimer)
|
|
.on('click keydown', function (e) {
|
|
if ($(e.target).parents('#kiosk_exit').length === 0)
|
|
{
|
|
e.preventDefault();
|
|
return false;
|
|
}
|
|
});
|
|
|
|
resetTimer(); // Start the timer
|
|
}
|
|
|
|
<?php // Otherwise, toggle the area and room selects depending on the mode ?>
|
|
else {
|
|
$('[name="mode"]').on('change', function () {
|
|
var isRoom = ($('input[name="mode"]:checked').val() === 'room');
|
|
var form = $('#kiosk_enter');
|
|
form.find('[name="area"]').parent().toggle(!isRoom);
|
|
form.find('[name="room"]').parent().toggle(isRoom);
|
|
}).trigger('change');
|
|
}
|
|
|
|
});
|
|
|