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
10 changes: 10 additions & 0 deletions apps/user_ldap/lib/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @author Joas Schilling <[email protected]>
* @author Morris Jobke <[email protected]>
* @author Thomas Müller <[email protected]>
* @author Jörn Friedrich Dreyer <[email protected]>
*
* @license AGPL-3.0
*
Expand All @@ -32,6 +33,7 @@
use OCP\IConfig;
use OCP\Image;
use OCP\IUserManager;
use OCP\Util;

/**
* User
Expand Down Expand Up @@ -111,6 +113,14 @@ public function __construct($username, $dn, IUserTools $access,
IConfig $config, FilesystemHelper $fs, Image $image,
LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager) {

if ($username === null) {
$log->log("uid for '$dn' must not be null!", Util::ERROR);
throw new \InvalidArgumentException('uid must not be null!');
} else if ($username === '') {
$log->log("uid for '$dn' must not be an empty string", Util::ERROR);
throw new \InvalidArgumentException('uid must not be an empty string!');
}

$this->access = $access;
$this->connection = $access->getConnection();
$this->config = $config;
Expand Down