More feedback during changing password

This commit is contained in:
brantje 2016-10-07 18:03:39 +02:00
parent 4f12b4f8df
commit d30400595a
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
3 changed files with 13 additions and 4 deletions

View file

@ -149,6 +149,8 @@ angular.module('passmanApp')
};
$scope.cur_state = {};
$scope.changeVaultPassword = function (oldVaultPass,newVaultPass,newVaultPass2) {
if(oldVaultPass != VaultService.getActiveVault().vaultKey){
$scope.error ='Your old password is incorrect!'
@ -176,7 +178,7 @@ angular.module('passmanApp')
};
var changeCredential = function(index, oldVaultPass, newVaultPass){
CredentialService.reencryptCredential(_selected_credentials[index].guid, oldVaultPass, newVaultPass).progress(function(data){
console.log(data);
$scope.cur_state = data;
}).then(function(data){
var percent = index / _selected_credentials.length * 100;
$scope.change_pw = {
@ -188,8 +190,12 @@ angular.module('passmanApp')
changeCredential(index+1, oldVaultPass, newVaultPass);
} else {
console.log('Update complete!');
//@TODO update private key with new pw
//@TODO Logout user
vault.private_sharing_key = EncryptService.decryptString(angular.copy(vault.private_sharing_key), oldVaultPass);
vault.private_sharing_key = EncryptService.encryptString(vault.private_sharing_key, newVaultPass);
VaultService.updateSharingKeys(vault).then(function (result) {
$rootScope.$broadcast('logout')
});
}
});
};

View file

@ -51,7 +51,7 @@ angular.module('views/partials/forms/settings/export.html', []).run(['$templateC
angular.module('views/partials/forms/settings/general_settings.html', []).run(['$templateCache', function($templateCache) {
'use strict';
$templateCache.put('views/partials/forms/settings/general_settings.html',
'<div class="row"><div class="col-xs-12 col-md-6"><h3>Rename vault</h3><label>New vault name</label><input type="text" ng-model="$parent.new_vault_name"> <button ng-click="saveVaultSettings()">Change</button><h3>Change vault key</h3><label>Old vault password</label><input type="password" ng-model="oldVaultPass"><label>New vault password</label><password-gen ng-model="newVaultPass"></password-gen><ng-password-meter password="newVaultPass"></ng-password-meter><label>New vault password</label><input type="password" ng-model="newVaultPass2"><div ng-show="error" class="error"><ul><li>{{error}}</li></ul></div><button ng-click="changeVaultPassword(oldVaultPass,newVaultPass,newVaultPass2)">Change</button><div ng-show="change_pw.total > 0">Please wait you vault is being updated, do not leave this page.<br><div progress-bar="change_pw.percent" index="change_pw.done" total="change_pw.total"></div></div></div><div class="col-xs-12 col-md-6"><h3>About passman</h3><p>Version: <b>{{passman_version}}</b><br>Bla bla about passman, changelog.<br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">Donate to support development</a><br></p><h3>Bookmarklet</h3><div><p>Save your passwords with 1 click!<br>Drag below button to your bookmark toolbar.<br></p></div><div><p ng-bind-html="bookmarklet" style="margin-top: 5px"></p></div></div></div>');
'<div class="row"><div class="col-xs-12 col-md-6"><h3>Rename vault</h3><label>New vault name</label><input type="text" ng-model="$parent.new_vault_name"> <button ng-click="saveVaultSettings()">Change</button><h3>Change vault key</h3><label>Old vault password</label><input type="password" ng-model="oldVaultPass"><label>New vault password</label><password-gen ng-model="newVaultPass"></password-gen><ng-password-meter password="newVaultPass"></ng-password-meter><label>New vault password</label><input type="password" ng-model="newVaultPass2"><div ng-show="error" class="error"><ul><li>{{error}}</li></ul></div><button ng-click="changeVaultPassword(oldVaultPass,newVaultPass,newVaultPass2)">Change</button><div ng-show="change_pw.total > 0">Please wait you vault is being updated, do not leave this page.<br>Processing {{cur_state.process}}<div progress-bar="cur_state.calculated" index="cur_state.current" total="cur_state.total"></div>Total progress<div progress-bar="change_pw.percent" index="change_pw.done" total="change_pw.total"></div></div></div><div class="col-xs-12 col-md-6"><h3>About passman</h3><p>Version: <b>{{passman_version}}</b><br>Bla bla about passman, changelog.<br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">Donate to support development</a><br></p><h3>Bookmarklet</h3><div><p>Save your passwords with 1 click!<br>Drag below button to your bookmark toolbar.<br></p></div><div><p ng-bind-html="bookmarklet" style="margin-top: 5px"></p></div></div></div>');
}]);
angular.module('views/partials/forms/settings/import.html', []).run(['$templateCache', function($templateCache) {

View file

@ -27,6 +27,9 @@
</button>
<div ng-show="change_pw.total > 0">
Please wait you vault is being updated, do not leave this page.<br />
Processing {{cur_state.process}}
<div progress-bar="cur_state.calculated" index="cur_state.current" total="cur_state.total"></div>
Total progress
<div progress-bar="change_pw.percent" index="change_pw.done" total="change_pw.total"></div>
</div>