diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-12-16 14:22:25 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-12-18 13:03:19 +0100 |
commit | a6c1b3ece3ee70936dc7ca2c099076d86773cc61 (patch) | |
tree | 6f270eb2a6bd932a72bd5910526186d3b3154edd /lib/private/user/manager.php | |
parent | f57c38df772fe3bb9135eeab996a644d87e01edd (diff) | |
download | nextcloud-server-a6c1b3ece3ee70936dc7ca2c099076d86773cc61.tar.gz nextcloud-server-a6c1b3ece3ee70936dc7ca2c099076d86773cc61.zip |
fix the config option to remove the ability for users to set their displayname
Diffstat (limited to 'lib/private/user/manager.php')
-rw-r--r-- | lib/private/user/manager.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php index 703c8cd7413..cf83a75ba25 100644 --- a/lib/private/user/manager.php +++ b/lib/private/user/manager.php @@ -35,7 +35,16 @@ class Manager extends PublicEmitter { */ private $cachedUsers = array(); - public function __construct() { + /** + * @var \OC\AllConfig $config + */ + private $config; + + /** + * @param \OC\AllConfig $config + */ + public function __construct($config = null) { + $this->config = $config; $cachedUsers = $this->cachedUsers; $this->listen('\OC\User', 'postDelete', function ($user) use (&$cachedUsers) { $i = array_search($user, $cachedUsers); @@ -103,7 +112,7 @@ class Manager extends PublicEmitter { if (isset($this->cachedUsers[$uid])) { return $this->cachedUsers[$uid]; } - $this->cachedUsers[$uid] = new User($uid, $backend, $this); + $this->cachedUsers[$uid] = new User($uid, $backend, $this, $this->config); return $this->cachedUsers[$uid]; } @@ -141,7 +150,7 @@ class Manager extends PublicEmitter { */ public function checkPassword($loginname, $password) { foreach ($this->backends as $backend) { - if($backend->implementsActions(\OC_USER_BACKEND_CHECK_PASSWORD)) { + if ($backend->implementsActions(\OC_USER_BACKEND_CHECK_PASSWORD)) { $uid = $backend->checkPassword($loginname, $password); if ($uid !== false) { return $this->getUserObject($uid, $backend); @@ -234,7 +243,7 @@ class Manager extends PublicEmitter { // Allowed are: "a-z", "A-Z", "0-9" and "_.@-" if (preg_match('/[^a-zA-Z0-9 _\.@\-]/', $uid)) { throw new \Exception('Only the following characters are allowed in a username:' - . ' "a-z", "A-Z", "0-9", and "_.@-"'); + . ' "a-z", "A-Z", "0-9", and "_.@-"'); } // No empty username if (trim($uid) == '') { |