mirror of
https://github.com/nextcloud/passman.git
synced 2024-12-29 11:32:47 +08:00
Started woking on some credential changes
This commit is contained in:
parent
f8c86b9ea6
commit
0b2dff77eb
2 changed files with 9 additions and 1 deletions
|
@ -44,6 +44,11 @@ class CredentialMapper extends Mapper {
|
|||
return $this->findEntities($sql, [$timestamp]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $credential_id
|
||||
* @param null $user_id
|
||||
* @return Credential
|
||||
*/
|
||||
public function getCredentialById($credential_id, $user_id = null){
|
||||
$sql = 'SELECT * FROM `*PREFIX*passman_credentials` ' .
|
||||
'WHERE `id` = ?';
|
||||
|
|
|
@ -54,7 +54,10 @@ class CredentialService {
|
|||
}
|
||||
|
||||
public function getCredentialById($credential_id, $user_id){
|
||||
return $this->credentialMapper->getCredentialById($credential_id, $user_id);
|
||||
$credential = $this->credentialMapper->getCredentialById($credential_id);
|
||||
if ($credential->getUserId() == $user_id){
|
||||
return $credential;
|
||||
}
|
||||
}
|
||||
public function getCredentialLabelById($credential_id){
|
||||
return $this->credentialMapper->getCredentialLabelById($credential_id);
|
||||
|
|
Loading…
Reference in a new issue