diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-13 21:31:38 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-21 11:32:38 +0200 |
commit | 0e9ab139432b562f442e01a983b7dcfbd6499115 (patch) | |
tree | 1a6c6a6d9e37de0e02f2dcdf8856ba839079f6f7 /lib/private/group | |
parent | d0aeb268d687f803e62069c852bcd7a1a86eadee (diff) | |
download | nextcloud-server-0e9ab139432b562f442e01a983b7dcfbd6499115.tar.gz nextcloud-server-0e9ab139432b562f442e01a983b7dcfbd6499115.zip |
New \OC\SubAdmin class
* DI
* Tests
* moved OC_SubAdmin to legacy
* Added to private OC\GroupManager
Diffstat (limited to 'lib/private/group')
-rw-r--r-- | lib/private/group/manager.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php index 65ae49dfcd2..6905dd8f5f2 100644 --- a/lib/private/group/manager.php +++ b/lib/private/group/manager.php @@ -71,11 +71,13 @@ class Manager extends PublicEmitter implements IGroupManager { */ private $cachedUserGroups = array(); + /** @var \OC\SubAdmin */ + private $subAdmin = null; /** * @param \OC\User\Manager $userManager */ - public function __construct($userManager) { + public function __construct(\OC\User\Manager $userManager) { $this->userManager = $userManager; $cachedGroups = & $this->cachedGroups; $cachedUserGroups = & $this->cachedUserGroups; @@ -314,4 +316,19 @@ class Manager extends PublicEmitter implements IGroupManager { } return $matchingUsers; } + + /** + * @return \OC\SubAdmin + */ + public function getSubAdmin() { + if (!$this->subAdmin) { + $this->subAdmin = new \OC\SubAdmin( + $this->userManager, + $this, + \OC::$server->getDatabaseConnection() + ); + } + + return $this->subAdmin; + } } |