diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-10-27 14:09:45 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-10-29 11:31:18 +0100 |
commit | c6f6a8758b3f08e47c3a8f45a67d09698376b2e2 (patch) | |
tree | bfd52190961e28ae97fa65a96df05b1fe0390a2f /lib/private/subadmin.php | |
parent | f428d31a5d1f91c6e7aa96fd8550c75c02cc0963 (diff) | |
download | nextcloud-server-c6f6a8758b3f08e47c3a8f45a67d09698376b2e2.tar.gz nextcloud-server-c6f6a8758b3f08e47c3a8f45a67d09698376b2e2.zip |
Drop OC_SubAdmin and replace usages
Diffstat (limited to 'lib/private/subadmin.php')
-rw-r--r-- | lib/private/subadmin.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/private/subadmin.php b/lib/private/subadmin.php index 6bf960661b5..c00a2b24669 100644 --- a/lib/private/subadmin.php +++ b/lib/private/subadmin.php @@ -44,6 +44,11 @@ class SubAdmin extends PublicEmitter { /** @var IDBConnection */ private $dbConn; + /** + * @param IUserManager $userManager + * @param IGroupManager $groupManager + * @param IDBConnection $dbConn + */ public function __construct(IUserManager $userManager, IGroupManager $groupManager, IDBConnection $dbConn) { @@ -68,7 +73,7 @@ class SubAdmin extends PublicEmitter { public function createSubAdmin(IUser $user, IGroup $group) { $qb = $this->dbConn->getQueryBuilder(); - $result = $qb->insert('group_admin') + $qb->insert('group_admin') ->values([ 'gid' => $qb->createNamedParameter($group->getGID()), 'uid' => $qb->createNamedParameter($user->getUID()) @@ -89,7 +94,7 @@ class SubAdmin extends PublicEmitter { public function deleteSubAdmin(IUser $user, IGroup $group) { $qb = $this->dbConn->getQueryBuilder(); - $result = $qb->delete('group_admin') + $qb->delete('group_admin') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($group->getGID()))) ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID()))) ->execute(); @@ -231,9 +236,9 @@ class SubAdmin extends PublicEmitter { if($this->groupManager->isAdmin($user->getUID())) { return false; } - $accessiblegroups = $this->getSubAdminsGroups($subadmin); - foreach($accessiblegroups as $accessiblegroup) { - if($accessiblegroup->inGroup($user)) { + $accessibleGroups = $this->getSubAdminsGroups($subadmin); + foreach($accessibleGroups as $accessibleGroup) { + if($accessibleGroup->inGroup($user)) { return true; } } @@ -248,7 +253,7 @@ class SubAdmin extends PublicEmitter { private function post_deleteUser($user) { $qb = $this->dbConn->getQueryBuilder(); - $result = $qb->delete('group_admin') + $qb->delete('group_admin') ->where($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID()))) ->execute(); @@ -263,7 +268,7 @@ class SubAdmin extends PublicEmitter { private function post_deleteGroup($group) { $qb = $this->dbConn->getQueryBuilder(); - $result = $qb->delete('group_admin') + $qb->delete('group_admin') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($group->getGID()))) ->execute(); |