diff options
Diffstat (limited to 'lib/private/Group/Group.php')
-rw-r--r-- | lib/private/Group/Group.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index 6795f0e2f53..cc6315263d4 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -10,6 +10,7 @@ * @author Robin McCorkell <robin@mccorkell.me.uk> * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Vincent Petry <pvince81@owncloud.com> + * @author John Molakvoæ <skjnldsv@protonmail.com> * * @license AGPL-3.0 * @@ -31,6 +32,7 @@ namespace OC\Group; use OCP\IGroup; use OCP\IUser; +use OCP\Group\Backend\ICountDisabledInGroup; class Group implements IGroup { /** @var null|string */ @@ -237,6 +239,26 @@ class Group implements IGroup { } /** + * returns the number of disabled users + * + * @return int|bool + */ + public function countDisabled() { + $users = false; + foreach ($this->backends as $backend) { + if($backend instanceOf ICountDisabledInGroup) { + if($users === false) { + //we could directly add to a bool variable, but this would + //be ugly + $users = 0; + } + $users += $backend->countDisabledInGroup($this->gid); + } + } + return $users; + } + + /** * search for users in the group by displayname * * @param string $search |