Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent user with empty uid
  • Loading branch information
butonic authored and jvillafanez committed Dec 12, 2016
commit ae5ae4a805324240a9e9262bb1628a2172943e9c
7 changes: 7 additions & 0 deletions apps/user_ldap/lib/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @author Joas Schilling <[email protected]>
* @author Morris Jobke <[email protected]>
* @author Thomas Müller <[email protected]>
* @author Jörn Friedrich Dreyer <[email protected]>
*
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @license AGPL-3.0
Expand Down Expand Up @@ -110,6 +111,12 @@ public function __construct($username, $dn, IUserTools $access,
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;
Expand Down