mirror of
https://github.com/nextcloud/server.git
synced 2026-03-29 13:53:55 -04:00
use random password if "password link" is enabled
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
be139c85a8
commit
c3fe8f6cf2
1 changed files with 3 additions and 1 deletions
|
|
@ -281,9 +281,11 @@ class Manager extends PublicEmitter implements IUserManager {
|
|||
if (strlen(trim($uid, "\t\n\r\0\x0B\xe2\x80\x8b")) !== strlen(trim($uid))) {
|
||||
throw new \Exception($l->t('Username contains whitespace at the beginning or at the end'));
|
||||
}
|
||||
// empty password only allowed if password link is sent
|
||||
// if password link is sent use random password; permit empty password
|
||||
if (trim($password) == '' && $this->config->getAppValue('core', 'umgmt_send_passwordlink', 'false') === 'false') {
|
||||
throw new \Exception($l->t('A valid password must be provided'));
|
||||
} else {
|
||||
$password = \OC::$server->getSecureRandom()->generate(32);
|
||||
}
|
||||
|
||||
// Check if user already exists
|
||||
|
|
|
|||
Loading…
Reference in a new issue