Make sure we require an encryption password if encryption is set to true for importing app backups

This commit is contained in:
Johannes Zellner
2022-02-22 16:34:53 +01:00
parent bbc232602f
commit e52a306370
2 changed files with 2 additions and 1 deletions

View File

@@ -364,7 +364,7 @@
<div class="form-group" ng-class="{ 'has-error': importBackup.error.password }">
<label class="control-label" for="inputImportBackupPassword">{{ 'backups.configureBackupStorage.encryptionPassword' | tr }} <sup><a ng-href="https://docs.cloudron.io/backups/#encryption" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></label>
<input type="text" class="form-control" ng-model="importBackup.password" id="inputImportBackupPassword" ng-disabled="importBackup.busy" placeholder="Passphrase used to encrypt the backups">
<input type="text" class="form-control" ng-model="importBackup.password" id="inputImportBackupPassword" ng-disabled="importBackup.busy" ng-required="importBackup.encrypted" placeholder="Passphrase used to encrypt the backups">
</div>
<input class="ng-hide" type="submit" ng-disabled="importBackupForm.$invalid"/>

View File

@@ -1249,6 +1249,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
backupId: '',
password: '',
mountOptions: {},
encrypted: false, // helps with ng-required when backupConfig is read from file
clearForm: function () {
// $scope.importBackup.provider = ''; // do not clear since we call this function on provider change