Merge pull request #3557 from Pectojin/confirm_export_encryption_passphrase

added passphrase confirmation
This commit is contained in:
Hendrik
2018-12-24 15:05:16 +01:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
@@ -53,9 +53,12 @@ backupApp.controller("ExportController", function($scope, $routeParams, AppServi
// Make checks that do not require user input
$scope.fileEncrypted = false;
if ($scope.UseEncryption && $scope.ExportType === "file") {
if (($scope.Passphrase || "").trim().length === 0) {
if (typeof $scope.Passphrase === "undefined" || $scope.Passphrase.trim().length === 0) {
DialogService.dialog(gettextCatalog.getString("No passphrase entered"), gettextCatalog.getString("To export without a passphrase, uncheck the \"Encrypt file\" box"));
return;
} else if ($scope.Passphrase !== $scope.ConfirmPassphrase) {
DialogService.dialog(gettextCatalog.getString("Error"), gettextCatalog.getString("The passwords do not match"));
return;
} else {
$scope.fileEncrypted = true;
}
@@ -25,6 +25,10 @@
<label for="encryption-passphrase" translate>Passphrase</label>
<input type="password" name="encryption-password" id="encryption-passphrase" ng-model="Passphrase" placeholder="{{'Enter encryption passphrase' | translate}}" >
</div>
<div class="input text" ng-show="UseEncryption && ExportType == 'file'">
<label for="encryption-passphrase" translate>Confirm passphrase</label>
<input type="password" name="confirm-encryption-password" id="confirm-encryption-passphrase" ng-model="ConfirmPassphrase" placeholder="{{'Confirm encryption passphrase' | translate}}" >
</div>
<div class="buttons" ng-hide="Connecting">
<a href="#" class="submit" translate>Cancel</a>