Add option to control WebUI clickjacking protection

Some users actually want embedding WebUI into their custom build iframe.
Closes #7370.
This commit is contained in:
Chocobo1 2018-05-21 23:33:44 +08:00
parent e8a69dd60c
commit bad4d94f77
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
8 changed files with 52 additions and 3 deletions

View file

@ -576,6 +576,16 @@ void Preferences::setWebUiPassword(const QString &new_password)
setValue("Preferences/WebUI/Password_ha1", md5.result().toHex());
}
bool Preferences::isWebUiClickjackingProtectionEnabled() const
{
return value("Preferences/WebUI/ClickjackingProtection", true).toBool();
}
void Preferences::setWebUiClickjackingProtectionEnabled(bool enabled)
{
setValue("Preferences/WebUI/ClickjackingProtection", enabled);
}
bool Preferences::isWebUiHttpsEnabled() const
{
return value("Preferences/WebUI/HTTPS/Enabled", false).toBool();