From 68b1ae1a36b652de19afcb645e098e6ac6918eab Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 15 Apr 2012 16:28:31 +0200 Subject: OC_Group_Backend.php misses function groupexists Fix http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-182 --- lib/group/backend.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/group') diff --git a/lib/group/backend.php b/lib/group/backend.php index b3fc06ac9a8..d0bc970da73 100644 --- a/lib/group/backend.php +++ b/lib/group/backend.php @@ -82,4 +82,16 @@ abstract class OC_Group_Backend { public function implementsActions($actions){ return (bool)($this->getSupportedActions() & $actions); } + + /** + * check if a group exists + * @param string $gid + * @return bool + */ + public function groupExists($gid){ + if(!$backend->implementsActions(OC_GROUP_BACKEND_GET_GROUPS)){ + return false; + } + return in_array($gid, $this->getGroups()); + } } -- cgit v1.2.3