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); 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); void setItems(const QList<Entry*>& items);
bool remember() const; bool remember() const;
void setRemember(bool r); void setRemember(bool r);
void setHTTPAuth(bool httpAuth);
private: private:
QScopedPointer<Ui::BrowserAccessControlDialog> m_ui; QScopedPointer<Ui::BrowserAccessControlDialog> m_ui;

View File

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

View File

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