added passphrase confirmation

This commit is contained in:
Rune Henriksen
2018-12-22 18:41:36 +01:00
parent 898dbf30db
commit bb736f113a
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>