Skip to content

Commit

Permalink
Browser access control dialog shows submitUrl when found
Browse files Browse the repository at this point in the history
  • Loading branch information
varjolintu authored and droidmonkey committed Oct 23, 2019
1 parent d0a7d44 commit bee861f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/browser/BrowserService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ QJsonArray BrowserService::findMatchingEntries(const QString& id,
}

// Confirm entries
if (confirmEntries(pwEntriesToConfirm, url, host, submitHost, realm, httpAuth)) {
if (confirmEntries(pwEntriesToConfirm, url, host, submitUrl, realm, httpAuth)) {
pwEntries.append(pwEntriesToConfirm);
}

Expand Down Expand Up @@ -786,7 +786,7 @@ QList<Entry*> BrowserService::sortEntries(QList<Entry*>& pwEntries, const QStrin
bool BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
const QString& url,
const QString& host,
const QString& submitHost,
const QString& submitUrl,
const QString& realm,
const bool httpAuth)
{
Expand All @@ -797,7 +797,7 @@ bool BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
m_dialogActive = true;
BrowserAccessControlDialog accessControlDialog;
connect(m_dbTabWidget, SIGNAL(databaseLocked(DatabaseWidget*)), &accessControlDialog, SLOT(reject()));
accessControlDialog.setUrl(url);
accessControlDialog.setUrl(!submitUrl.isEmpty() ? submitUrl : url);
accessControlDialog.setItems(pwEntriesToConfirm);
accessControlDialog.setHTTPAuth(httpAuth);

Expand All @@ -806,6 +806,7 @@ bool BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
accessControlDialog.activateWindow();
accessControlDialog.raise();

const QString submitHost = QUrl(submitUrl).host();
int res = accessControlDialog.exec();
if (accessControlDialog.remember()) {
for (auto* entry : pwEntriesToConfirm) {
Expand Down
2 changes: 1 addition & 1 deletion src/browser/BrowserService.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public slots:
bool confirmEntries(QList<Entry*>& pwEntriesToConfirm,
const QString& url,
const QString& host,
const QString& submitHost,
const QString& submitUrl,
const QString& realm,
const bool httpAuth);
QJsonObject prepareEntry(const Entry* entry);
Expand Down

0 comments on commit bee861f

Please sign in to comment.