mirror of
https://github.com/nextcloud/passman.git
synced 2025-09-29 08:15:50 +08:00
Fix some bugs
This commit is contained in:
parent
130e296b1e
commit
53c55d5fd6
3 changed files with 6 additions and 14 deletions
|
@ -107,7 +107,7 @@ class CredentialController extends ApiController {
|
|||
$credential_id, $custom_fields, $delete_time,
|
||||
$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) {
|
||||
$tags, $url, $username, $vault_id, $revision_created, $shared_key, $acl, $unshare_action, $set_share_key) {
|
||||
|
||||
|
||||
$storedCredential = $this->credentialService->getCredentialById($credential_id, $this->userId);
|
||||
|
@ -133,7 +133,6 @@ class CredentialController extends ApiController {
|
|||
'delete_time' => $delete_time,
|
||||
'hidden' => $hidden,
|
||||
'otp' => $otp,
|
||||
'shared_key' => ($storedCredential->getSharedKey() === null) ? $shared_key : $storedCredential->getSharedKey(),
|
||||
);
|
||||
|
||||
|
||||
|
@ -218,10 +217,11 @@ class CredentialController extends ApiController {
|
|||
$link, $storedCredential->getUserId(), Activity::TYPE_ITEM_ACTION);
|
||||
}
|
||||
}
|
||||
if($storedCredential->getSharedKey() === null){
|
||||
if($set_share_key == true){
|
||||
$storedCredential->setSharedKey($shared_key);
|
||||
$credential['shared_key'] = $shared_key;
|
||||
}
|
||||
if($unshare_action){
|
||||
if($unshare_action == true){
|
||||
$storedCredential->setSharedKey('');
|
||||
$credential['shared_key'] = '';
|
||||
}
|
||||
|
|
|
@ -291,6 +291,7 @@ angular.module('passmanApp')
|
|||
|
||||
ShareService.generateSharedKey(20).then(function (key) {
|
||||
var encryptedSharedCredential = ShareService.encryptSharedCredential($scope.storedCredential, key);
|
||||
encryptedSharedCredential.set_share_key = true;
|
||||
CredentialService.updateCredential(encryptedSharedCredential, true).then(function (sharedCredential) {
|
||||
$scope.storedCredential = ShareService.decryptSharedCredential(sharedCredential, key);
|
||||
});
|
||||
|
|
|
@ -73,16 +73,7 @@ angular.module('passmanApp')
|
|||
return response.data;
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
getSharedCredentialRevisions: function (credential) {
|
||||
var queryUrl = OC.generateUrl('apps/passman/api/v2/sharing/credential/'+ credential.guid +'/revisions');
|
||||
return $http.get(queryUrl).then(function (response) {
|
||||
if (response.data) {
|
||||
return response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
createPublicSharedCredential: function (shareObj) {
|
||||
var queryUrl = OC.generateUrl('apps/passman/api/v2/sharing/public');
|
||||
return $http.post(queryUrl, shareObj).then(function (response) {
|
||||
|
|
Loading…
Add table
Reference in a new issue