empty password only allowed if password link is sent

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
tobiasKaminsky 2016-11-23 21:44:38 +01:00 committed by Morris Jobke
parent a37f29964f
commit be139c85a8
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 4 additions and 4 deletions

View File

@ -281,10 +281,10 @@ 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'));
}
// No empty password
// if (trim($password) == '') {
// throw new \Exception($l->t('A valid password must be provided'));
// }
// empty password only allowed if password link is sent
if (trim($password) == '' && $this->config->getAppValue('core', 'umgmt_send_passwordlink', 'false') === 'false') {
throw new \Exception($l->t('A valid password must be provided'));
}
// Check if user already exists
if ($this->userExists($uid)) {