diff options
author | brantje <brantje@gmail.com> | 2016-10-02 22:17:17 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-10-02 22:17:17 +0300 |
commit | 497198371ea38b60ec44c5e4bb3fc5c0c8c4217b (patch) | |
tree | 8b6cd00771e8cb96b6c09a9010af765887ff2694 /js/app/services/credentialservice.js | |
parent | d6c85bffcc68ae24e1422a47f990b923b8d9903e (diff) |
Dislay of shared item (if user owns it) works
Diffstat (limited to 'js/app/services/credentialservice.js')
-rw-r--r-- | js/app/services/credentialservice.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/js/app/services/credentialservice.js b/js/app/services/credentialservice.js index accf31ae..f432d529 100644 --- a/js/app/services/credentialservice.js +++ b/js/app/services/credentialservice.js @@ -60,13 +60,18 @@ angular.module('passmanApp') getEncryptedFields: function () { return _encryptedFields; }, - updateCredential: function (credential) { + updateCredential: function (credential, skipEncyption) { var _credential = angular.copy(credential); - for (var i = 0; i < _encryptedFields.length; i++) { - var field = _encryptedFields[i]; - var fieldValue = angular.copy(credential[field]); - _credential[field] = EncryptService.encryptString(JSON.stringify(fieldValue)); + if(!skipEncyption){ + for (var i = 0; i < _encryptedFields.length; i++) { + var field = _encryptedFields[i]; + var fieldValue = angular.copy(credential[field]); + _credential[field] = EncryptService.encryptString(JSON.stringify(fieldValue)); + } + } else { + console.log('Skipping encryption') } + _credential.expire_time = new Date( angular.copy(credential.expire_time) ).getTime() / 1000; var queryUrl = OC.generateUrl('apps/passman/api/v2/credentials/' + credential.credential_id); |