diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2016-09-29 10:16:13 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-10-04 12:26:06 +0200 |
commit | 0ae9a2c9fefb16be52362826c8981e4efe2fa878 (patch) | |
tree | ef6f5f640d737b0b1be1a341bc023147a1c4718b /apps/user_ldap | |
parent | 3a0e06147c87cd881238e2e121f31183399f3bbf (diff) | |
download | nextcloud-server-0ae9a2c9fefb16be52362826c8981e4efe2fa878.tar.gz nextcloud-server-0ae9a2c9fefb16be52362826c8981e4efe2fa878.zip |
Prevent user with empty uid
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/User/User.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index 3d247663b3f..51fd577104c 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/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; |