From 0e9ab139432b562f442e01a983b7dcfbd6499115 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 13 Aug 2015 21:31:38 +0200 Subject: New \OC\SubAdmin class * DI * Tests * moved OC_SubAdmin to legacy * Added to private OC\GroupManager --- lib/private/group/manager.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/private/group/manager.php') 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; + } } -- cgit v1.2.3