Prevent user with empty uid

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
pull/1616/head
Jörn Friedrich Dreyer 9 years ago committed by Arthur Schiwon
parent 3a0e06147c
commit 0ae9a2c9fe
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
  1. 7
      apps/user_ldap/lib/User/User.php

@ -6,6 +6,7 @@
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
*
* @license AGPL-3.0
*
@ -111,6 +112,12 @@ class User {
IConfig $config, FilesystemHelper $fs, Image $image,
LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager) {
if ($username === null) {
throw new \InvalidArgumentException("uid for '$dn' must not be null!");
} else if ($username === '') {
throw new \InvalidArgumentException("uid for '$dn' must not be an empty string!");
}
$this->access = $access;
$this->connection = $access->getConnection();
$this->config = $config;

Loading…
Cancel
Save