mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Expose WebUI ban duration to users
This commit is contained in:
parent
ec61ef5145
commit
6eb190c373
7 changed files with 63 additions and 16 deletions
|
@ -29,6 +29,8 @@
|
|||
|
||||
#include "preferences.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
@ -631,6 +633,16 @@ void Preferences::setWebUIMaxAuthFailCount(const int count)
|
|||
setValue("Preferences/WebUI/MaxAuthenticationFailCount", count);
|
||||
}
|
||||
|
||||
std::chrono::seconds Preferences::getWebUIBanDuration() const
|
||||
{
|
||||
return std::chrono::seconds {value("Preferences/WebUI/BanDuration", 3600).toInt()};
|
||||
}
|
||||
|
||||
void Preferences::setWebUIBanDuration(const std::chrono::seconds duration)
|
||||
{
|
||||
setValue("Preferences/WebUI/BanDuration", static_cast<int>(duration.count()));
|
||||
}
|
||||
|
||||
int Preferences::getWebUISessionTimeout() const
|
||||
{
|
||||
return value("Preferences/WebUI/SessionTimeout", 3600).toInt();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue