Merge pull request #1616 from nextcloud/downstream_ldap_6
Prevent user with empty uid
This commit is contained in:
commit
55e72caf9b
|
@ -6,6 +6,7 @@
|
||||||
* @author Joas Schilling <coding@schilljs.com>
|
* @author Joas Schilling <coding@schilljs.com>
|
||||||
* @author Morris Jobke <hey@morrisjobke.de>
|
* @author Morris Jobke <hey@morrisjobke.de>
|
||||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||||
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
||||||
*
|
*
|
||||||
* @license AGPL-3.0
|
* @license AGPL-3.0
|
||||||
*
|
*
|
||||||
|
@ -32,6 +33,7 @@ use OCP\IAvatarManager;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\Image;
|
use OCP\Image;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
|
use OCP\Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
|
@ -111,6 +113,14 @@ class User {
|
||||||
IConfig $config, FilesystemHelper $fs, Image $image,
|
IConfig $config, FilesystemHelper $fs, Image $image,
|
||||||
LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager) {
|
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->access = $access;
|
||||||
$this->connection = $access->getConnection();
|
$this->connection = $access->getConnection();
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
Loading…
Reference in New Issue