OC_Group_Backend.php misses function groupexists
Fix http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-182
This commit is contained in:
parent
ea99e1184d
commit
68b1ae1a36
|
@ -255,7 +255,12 @@ class OC_Group {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function groupExists($gid){
|
public static function groupExists($gid){
|
||||||
return in_array( $gid, self::getGroups());
|
foreach(self::$_usedBackends as $backend){
|
||||||
|
if ($backend->groupExists($gid)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -82,4 +82,16 @@ abstract class OC_Group_Backend {
|
||||||
public function implementsActions($actions){
|
public function implementsActions($actions){
|
||||||
return (bool)($this->getSupportedActions() & $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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue