Browser access control dialog shows submitUrl when found

This commit is contained in:
varjolintu 2019-10-19 15:10:50 +03:00 committed by Jonathan White
parent d0a7d44ec3
commit bee861ff8f
2 changed files with 5 additions and 4 deletions

View File

@ -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);
}
@ -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)
{
@ -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);
@ -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) {

View File

@ -120,7 +120,7 @@ private:
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);