Implement groupExists in group database backend

This commit is contained in:
Michael Gapczynski 2012-08-07 14:48:55 -04:00
parent 8d56c42fde
commit 3533f43d12
1 changed files with 14 additions and 0 deletions

View File

@ -174,6 +174,20 @@ class OC_Group_Database extends OC_Group_Backend {
return $groups;
}
/**
* check if a group exists
* @param string $gid
* @return bool
*/
public function groupExists($gid) {
$query = OC_DB::prepare('SELECT gid FROM *PREFIX*groups WHERE gid = ?');
$result = $query->execute(array($gid))->fetchOne();
if ($result) {
return true;
}
return false;
}
/**
* @brief get a list of all users in a group
* @returns array with user ids