summaryrefslogtreecommitdiffstats
path: root/lib/private/Group/MetaData.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-05-16 12:32:56 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-05-24 17:52:15 +0200
commit10c135ca3414544a92febbc45b39d358c8383757 (patch)
tree17137dc89af559ed083dd36824ba78803a8e58d1 /lib/private/Group/MetaData.php
parent6689a3e37b5bc71a66462c547072ad7555958c05 (diff)
downloadnextcloud-server-10c135ca3414544a92febbc45b39d358c8383757.tar.gz
nextcloud-server-10c135ca3414544a92febbc45b39d358c8383757.zip
Added disabled count per groups
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Group/MetaData.php')
-rw-r--r--lib/private/Group/MetaData.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php
index 99594301990..1e89472bc30 100644
--- a/lib/private/Group/MetaData.php
+++ b/lib/private/Group/MetaData.php
@@ -8,6 +8,7 @@
* @author Morris Jobke <hey@morrisjobke.de>
* @author Stephan Peijnik <speijnik@anexia-it.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license AGPL-3.0
*
@@ -28,6 +29,7 @@
namespace OC\Group;
use OCP\IUserSession;
+use OCP\IGroupManager;
class MetaData {
const SORT_NONE = 0;
@@ -40,7 +42,7 @@ class MetaData {
protected $isAdmin;
/** @var array */
protected $metaData = array();
- /** @var \OCP\IGroupManager */
+ /** @var IGroupManager */
protected $groupManager;
/** @var bool */
protected $sorting = false;
@@ -50,13 +52,14 @@ class MetaData {
/**
* @param string $user the uid of the current user
* @param bool $isAdmin whether the current users is an admin
- * @param \OCP\IGroupManager $groupManager
+ * @param IGroupManager $groupManager
+ * @param IUserManager $userManager
* @param IUserSession $userSession
*/
public function __construct(
$user,
$isAdmin,
- \OCP\IGroupManager $groupManager,
+ IGroupManager $groupManager,
IUserSession $userSession
) {
$this->user = $user;
@@ -155,13 +158,14 @@ class MetaData {
* creates an array containing the group meta data
* @param \OCP\IGroup $group
* @param string $userSearch
- * @return array with the keys 'id', 'name' and 'usercount'
+ * @return array with the keys 'id', 'name', 'usercount' and 'disabled'
*/
private function generateGroupMetaData(\OCP\IGroup $group, $userSearch) {
return array(
'id' => $group->getGID(),
'name' => $group->getDisplayName(),
'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
+ 'disabled' => $group->countDisabled()
);
}