mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -05:00
Add option for returning expired credentials
This commit is contained in:
parent
247b85fe69
commit
fed8a56098
@ -120,6 +120,7 @@ void BrowserOptionDialog::loadSettings()
|
||||
m_ui->useCustomProxy->setChecked(settings->useCustomProxy());
|
||||
m_ui->customProxyLocation->setText(settings->customProxyLocation());
|
||||
m_ui->updateBinaryPath->setChecked(settings->updateBinaryPath());
|
||||
m_ui->allowExpiredCredentials->setChecked(settings->allowExpiredCredentials());
|
||||
m_ui->chromeSupport->setChecked(settings->chromeSupport());
|
||||
m_ui->chromiumSupport->setChecked(settings->chromiumSupport());
|
||||
m_ui->firefoxSupport->setChecked(settings->firefoxSupport());
|
||||
@ -176,6 +177,7 @@ void BrowserOptionDialog::saveSettings()
|
||||
settings->setCustomProxyLocation(m_ui->customProxyLocation->text());
|
||||
|
||||
settings->setUpdateBinaryPath(m_ui->updateBinaryPath->isChecked());
|
||||
settings->setAllowExpiredCredentials(m_ui->allowExpiredCredentials->isChecked());
|
||||
settings->setAlwaysAllowAccess(m_ui->alwaysAllowAccess->isChecked());
|
||||
settings->setAlwaysAllowUpdate(m_ui->alwaysAllowUpdate->isChecked());
|
||||
settings->setHttpAuthPermission(m_ui->httpAuthPermission->isChecked());
|
||||
|
@ -219,6 +219,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="allowExpiredCredentials">
|
||||
<property name="toolTip">
|
||||
<string>Returns expired credentials. String [expired] is added to the title.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Allow returning expired credentials.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="sortByTitle">
|
||||
<property name="text">
|
||||
|
@ -818,6 +818,10 @@ QJsonObject BrowserService::prepareEntry(const Entry* entry)
|
||||
res["totp"] = entry->totp();
|
||||
}
|
||||
|
||||
if (entry->isExpired()) {
|
||||
res["expired"] = "true";
|
||||
}
|
||||
|
||||
if (browserSettings()->supportKphFields()) {
|
||||
const EntryAttributes* attr = entry->attributes();
|
||||
QJsonArray stringFields;
|
||||
@ -841,7 +845,7 @@ BrowserService::checkAccess(const Entry* entry, const QString& host, const QStri
|
||||
return Unknown;
|
||||
}
|
||||
if (entry->isExpired()) {
|
||||
return Denied;
|
||||
return browserSettings()->allowExpiredCredentials() ? Allowed : Denied;
|
||||
}
|
||||
if ((config.isAllowed(host)) && (submitHost.isEmpty() || config.isAllowed(submitHost))) {
|
||||
return Allowed;
|
||||
|
@ -194,6 +194,16 @@ void BrowserSettings::setUpdateBinaryPath(bool enabled)
|
||||
config()->set("Browser/UpdateBinaryPath", enabled);
|
||||
}
|
||||
|
||||
bool BrowserSettings::allowExpiredCredentials()
|
||||
{
|
||||
return config()->get("Browser/AllowExpiredCredentials", false).toBool();
|
||||
}
|
||||
|
||||
void BrowserSettings::setAllowExpiredCredentials(bool enabled)
|
||||
{
|
||||
config()->set("Browser/AllowExpiredCredentials", enabled);
|
||||
}
|
||||
|
||||
bool BrowserSettings::chromeSupport()
|
||||
{
|
||||
return m_hostInstaller.checkIfInstalled(HostInstaller::SupportedBrowsers::CHROME);
|
||||
|
@ -64,6 +64,8 @@ public:
|
||||
void setCustomProxyLocation(const QString& location);
|
||||
bool updateBinaryPath();
|
||||
void setUpdateBinaryPath(bool enabled);
|
||||
bool allowExpiredCredentials();
|
||||
void setAllowExpiredCredentials(bool enabled);
|
||||
bool chromeSupport();
|
||||
void setChromeSupport(bool enabled);
|
||||
bool chromiumSupport();
|
||||
|
Loading…
Reference in New Issue
Block a user