Add skip_revision param

This commit is contained in:
brantje 2016-10-07 18:26:53 +02:00
parent ac086845b2
commit 59eafb2505
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
3 changed files with 10 additions and 8 deletions

View file

@ -107,7 +107,7 @@ class CredentialController extends ApiController {
$credential_id, $custom_fields, $delete_time, $credential_guid,
$description, $email, $expire_time, $favicon, $files, $guid,
$hidden, $label, $otp, $password, $renew_interval,
$tags, $url, $username, $vault_id, $revision_created, $shared_key, $acl, $unshare_action, $set_share_key) {
$tags, $url, $username, $vault_id, $revision_created, $shared_key, $acl, $unshare_action, $set_share_key, $skip_revision) {
$storedCredential = $this->credentialService->getCredentialByGUID($credential_guid, $this->userId);
@ -225,7 +225,9 @@ class CredentialController extends ApiController {
$storedCredential->setSharedKey('');
$credential['shared_key'] = '';
}
$this->credentialRevisionService->createRevision($storedCredential, $storedCredential->getUserId(), $credential_id, $this->userId);
if(!$skip_revision) {
$this->credentialRevisionService->createRevision($storedCredential, $storedCredential->getUserId(), $credential_id, $this->userId);
}
$credential = $this->credentialService->updateCredential($credential);
return new JSONResponse($credential);

View file

@ -198,16 +198,14 @@ angular.module('passmanApp')
var new_key = VaultService.getActiveVault().vaultKey;
_credential.shared_key = null;
_credential.unshare_action = true;
_credential.skip_revision = true;
_credential = CredentialService.encryptCredential(_credential, old_key)
_credential = CredentialService.encryptCredential(_credential, old_key);
CredentialService.updateCredential(_credential, true).then(function () {
NotificationService.showNotification('Credential unshared', 4000)
NotificationService.showNotification('Credential unshared', 4000);
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).progress(function(data){
console.log(data);
}).then(function(data){
console.warn(data);
//@TODO Implement action on reencryption finished
console.error('This is still NOW called..')
getAcl();
});
})
@ -307,10 +305,11 @@ angular.module('passmanApp')
//This is here is not called
var _credential = data.cryptogram;
_credential.set_share_key = true;
_credential.skip_revision = true;
_credential.shared_key = EncryptService.encryptString(key);
console.log(_credential);
CredentialService.updateCredential(_credential, true).then(function () {
NotificationService.showNotification('Credential shared', 4000)
NotificationService.showNotification('Credential shared', 4000);
$scope.sharing_complete = true;
})
});

View file

@ -181,6 +181,7 @@ angular.module('passmanApp')
this.call_progress(new progress_datatype(1, 2, 'credential'));
// Save data
this.parent.new_credential_cryptogram.skip_revision = true;
service.updateCredential(this.parent.new_credential_cryptogram, true).then((function(data){
this.call_progress(new progress_datatype(2, 2, 'credential'));
this.call_then({