Expose WebUI ban duration to users

This commit is contained in:
Chocobo1 2020-02-12 22:04:54 +08:00
parent ec61ef5145
commit 6eb190c373
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
7 changed files with 63 additions and 16 deletions

View file

@ -233,6 +233,7 @@ void AppController::preferencesAction()
authSubnetWhitelistStringList << Utils::Net::subnetToString(subnet);
data["bypass_auth_subnet_whitelist"] = authSubnetWhitelistStringList.join("\n");
data["web_ui_max_auth_fail_count"] = pref->getWebUIMaxAuthFailCount();
data["web_ui_ban_duration"] = static_cast<int>(pref->getWebUIBanDuration().count());
data["web_ui_session_timeout"] = pref->getWebUISessionTimeout();
// Use alternative Web UI
data["alternative_webui_enabled"] = pref->isAltWebUiEnabled();
@ -604,6 +605,8 @@ void AppController::setPreferencesAction()
}
if (hasKey("web_ui_max_auth_fail_count"))
pref->setWebUIMaxAuthFailCount(it.value().toInt());
if (hasKey("web_ui_ban_duration"))
pref->setWebUIBanDuration(std::chrono::seconds {it.value().toInt()});
if (hasKey("web_ui_session_timeout"))
pref->setWebUISessionTimeout(it.value().toInt());
// Use alternative Web UI