mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-07 14:32:55 -04:00
Add warning prior to export of database
* Ensures user is aware that the exported data is unencrypted and vulnerable
This commit is contained in:
parent
aac76ad407
commit
d12f15da92
2 changed files with 21 additions and 0 deletions
|
@ -390,6 +390,10 @@ void DatabaseTabWidget::exportToCsv()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!warnOnExport()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QString fileName = fileDialog()->getSaveFileName(
|
QString fileName = fileDialog()->getSaveFileName(
|
||||||
this, tr("Export database to CSV file"), QString(), tr("CSV file").append(" (*.csv)"), nullptr, nullptr, "csv");
|
this, tr("Export database to CSV file"), QString(), tr("CSV file").append(" (*.csv)"), nullptr, nullptr, "csv");
|
||||||
if (fileName.isEmpty()) {
|
if (fileName.isEmpty()) {
|
||||||
|
@ -411,6 +415,10 @@ void DatabaseTabWidget::exportToHtml()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!warnOnExport()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QString fileName = fileDialog()->getSaveFileName(this,
|
QString fileName = fileDialog()->getSaveFileName(this,
|
||||||
tr("Export database to HTML file"),
|
tr("Export database to HTML file"),
|
||||||
QString(),
|
QString(),
|
||||||
|
@ -429,6 +437,18 @@ void DatabaseTabWidget::exportToHtml()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DatabaseTabWidget::warnOnExport()
|
||||||
|
{
|
||||||
|
auto ans =
|
||||||
|
MessageBox::question(this,
|
||||||
|
tr("Export Confirmation"),
|
||||||
|
tr("You are about to export your database to an unencrypted file. This will leave your "
|
||||||
|
"passwords and sensitive information vulnerable! Are you sure you want to continue?"),
|
||||||
|
MessageBox::Yes | MessageBox::No,
|
||||||
|
MessageBox::No);
|
||||||
|
return ans == MessageBox::Yes;
|
||||||
|
}
|
||||||
|
|
||||||
void DatabaseTabWidget::changeMasterKey()
|
void DatabaseTabWidget::changeMasterKey()
|
||||||
{
|
{
|
||||||
currentDatabaseWidget()->switchToMasterKeyChange();
|
currentDatabaseWidget()->switchToMasterKeyChange();
|
||||||
|
|
|
@ -99,6 +99,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
QSharedPointer<Database> execNewDatabaseWizard();
|
QSharedPointer<Database> execNewDatabaseWizard();
|
||||||
void updateLastDatabases(const QString& filename);
|
void updateLastDatabases(const QString& filename);
|
||||||
|
bool warnOnExport();
|
||||||
|
|
||||||
QPointer<DatabaseWidgetStateSync> m_dbWidgetStateSync;
|
QPointer<DatabaseWidgetStateSync> m_dbWidgetStateSync;
|
||||||
QPointer<DatabaseWidget> m_dbWidgetPendingLock;
|
QPointer<DatabaseWidget> m_dbWidgetPendingLock;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue