Disable remember checkbox with Basic HTTP Auth

This commit is contained in:
varjolintu 2019-07-12 09:16:24 +03:00 committed by Jonathan White
parent 493b51882b
commit 79bb991a61
4 changed files with 12 additions and 3 deletions

View File

@ -59,3 +59,8 @@ void BrowserAccessControlDialog::setRemember(bool r)
{
m_ui->rememberDecisionCheckBox->setChecked(r);
}
void BrowserAccessControlDialog::setHTTPAuth(bool httpAuth)
{
m_ui->rememberDecisionCheckBox->setVisible(!httpAuth);
}

View File

@ -41,6 +41,7 @@ public:
void setItems(const QList<Entry*>& items);
bool remember() const;
void setRemember(bool r);
void setHTTPAuth(bool httpAuth);
private:
QScopedPointer<Ui::BrowserAccessControlDialog> m_ui;

View File

@ -400,7 +400,7 @@ QJsonArray BrowserService::findMatchingEntries(const QString& id,
}
// Confirm entries
if (confirmEntries(pwEntriesToConfirm, url, host, submitHost, realm)) {
if (confirmEntries(pwEntriesToConfirm, url, host, submitHost, realm, httpAuth)) {
pwEntries.append(pwEntriesToConfirm);
}
@ -764,7 +764,8 @@ bool BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
const QString& url,
const QString& host,
const QString& submitHost,
const QString& realm)
const QString& realm,
const bool httpAuth)
{
if (pwEntriesToConfirm.isEmpty() || m_dialogActive) {
return false;
@ -775,6 +776,7 @@ bool BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
connect(m_dbTabWidget, SIGNAL(databaseLocked(DatabaseWidget*)), &accessControlDialog, SLOT(reject()));
accessControlDialog.setUrl(url);
accessControlDialog.setItems(pwEntriesToConfirm);
accessControlDialog.setHTTPAuth(httpAuth);
raiseWindow();
accessControlDialog.show();

View File

@ -118,7 +118,8 @@ private:
const QString& url,
const QString& host,
const QString& submitHost,
const QString& realm);
const QString& realm,
const bool httpAuth);
QJsonObject prepareEntry(const Entry* entry);
Access checkAccess(const Entry* entry, const QString& host, const QString& submitHost, const QString& realm);
Group* getDefaultEntryGroup(const QSharedPointer<Database>& selectedDb = {});