diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-08 13:32:17 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 12:38:06 +0300 |
commit | 99dd7130ff388beaa415f7214055b35d8a682200 (patch) | |
tree | 469b665a29b4a9ece874f58f479a85b874a2feab /lib/Manager.php | |
parent | 9a45d13b756fb1923b5934168dd7565e53511f60 (diff) |
Only use numeric tokens for conversations when sip is configured
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r-- | lib/Manager.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Manager.php b/lib/Manager.php index 1314e6642..3f1aa022e 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -805,10 +805,18 @@ class Manager { * @return string */ protected function getNewToken(): string { - $chars = str_replace(['l', '0', '1'], '', ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); + $sipConfig = $this->config->getAppValue('spreed', 'sip_config', ''); // FIXME adjust config name $entropy = (int) $this->config->getAppValue('spreed', 'token_entropy', 8); $entropy = max(8, $entropy); // For update cases + if ($sipConfig === '') { + $chars = str_replace(['l', '0', '1'], '', ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); + } else { + $chars = ISecureRandom::CHAR_DIGITS; + // Increase default token length as we only use numbers + $entropy = max(10, $entropy); + } + $query = $this->db->getQueryBuilder(); $query->select('id') ->from('talk_rooms') |