mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-10 17:27:40 +08:00
Add skip_revision param
This commit is contained in:
parent
ac086845b2
commit
59eafb2505
3 changed files with 10 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
});
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue