Add countUsersInGroup

This commit is contained in:
Patrick Valsecchi
2017-12-19 20:13:03 +01:00
parent ddc1922d0a
commit 031b588255
2 changed files with 19 additions and 0 deletions

View File

@@ -75,5 +75,20 @@ class OC_GROUP_SQL extends \OC_Group_Backend implements \OCP\GroupInterface
}
return $users;
}
public function countUsersInGroup($gid, $search = '') {
if(empty($this -> settings['sql_group_table']))
{
return 0;
}
$search = "%".$search."%";
$count = $this -> helper -> runQuery('countUsersInGroup', array('gid' => $gid, 'search' => $search));
if($count === false)
{
return 0;
} else {
return intval(reset($count));
}
}
}
?>