mirror of
https://github.com/nextcloud/passman.git
synced 2024-09-20 23:06:24 +08:00
Limit it to 20 credential for preformance reasons
This commit is contained in:
parent
11f427904c
commit
3524cded0d
|
@ -39,7 +39,7 @@ class CredentialMapper extends Mapper {
|
|||
*/
|
||||
public function getRandomCredentialByVaultId($vault_id, $user_id) {
|
||||
$sql = 'SELECT * FROM `*PREFIX*passman_credentials` ' .
|
||||
'WHERE `user_id` = ? and vault_id = ? AND shared_key is NULL';
|
||||
'WHERE `user_id` = ? and vault_id = ? AND shared_key is NULL LIMIT 20';
|
||||
$entities = $this->findEntities($sql, [$user_id, $vault_id]);
|
||||
$count = count($entities);
|
||||
$entities = array_splice($entities, rand(0, $count), 1);
|
||||
|
|
Loading…
Reference in a new issue