diff options
Diffstat (limited to 'lib/group')
-rw-r--r-- | lib/group/database.php | 5 | ||||
-rw-r--r-- | lib/group/dummy.php | 3 | ||||
-rw-r--r-- | lib/group/example.php | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/group/database.php b/lib/group/database.php index fb173665eb8..2770ec185c4 100644 --- a/lib/group/database.php +++ b/lib/group/database.php @@ -41,7 +41,6 @@ * Class for group management in a SQL Database (e.g. MySQL, SQLite) */ class OC_Group_Database extends OC_Group_Backend { - private $userGroupCache=array(); /** * @brief Try to create a new group @@ -116,7 +115,7 @@ class OC_Group_Database extends OC_Group_Backend { // No duplicate entries! if( !$this->inGroup( $uid, $gid )){ $query = OC_DB::prepare( "INSERT INTO `*PREFIX*group_user` ( `uid`, `gid` ) VALUES( ?, ? )" ); - $result = $query->execute( array( $uid, $gid )); + $query->execute( array( $uid, $gid )); return true; }else{ return false; @@ -133,7 +132,7 @@ class OC_Group_Database extends OC_Group_Backend { */ public function removeFromGroup( $uid, $gid ){ $query = OC_DB::prepare( "DELETE FROM *PREFIX*group_user WHERE uid = ? AND gid = ?" ); - $result = $query->execute( array( $uid, $gid )); + $query->execute( array( $uid, $gid )); return true; } diff --git a/lib/group/dummy.php b/lib/group/dummy.php index 0825b10708a..1243891023f 100644 --- a/lib/group/dummy.php +++ b/lib/group/dummy.php @@ -126,7 +126,8 @@ class OC_Group_Dummy extends OC_Group_Backend { */ public function getUserGroups($uid){ $groups=array(); - foreach($this->groups as $group=>$user){ + $allGroups=array_keys($this->groups); + foreach($allGroups as $group){ if($this->inGroup($uid,$group)){ $groups[]=$group; } diff --git a/lib/group/example.php b/lib/group/example.php index c18562db7a4..f9c62fb9789 100644 --- a/lib/group/example.php +++ b/lib/group/example.php @@ -34,7 +34,7 @@ abstract class OC_Group_Example { * Trys to create a new group. If the group name already exists, false will * be returned. */ - public static function createGroup($gid){} + abstract public static function createGroup($gid); /** * @brief delete a group @@ -43,7 +43,7 @@ abstract class OC_Group_Example { * * Deletes a group and removes it from the group_user-table */ - public static function deleteGroup($gid){} + abstract public static function deleteGroup($gid); /** * @brief is user in group? @@ -53,7 +53,7 @@ abstract class OC_Group_Example { * * Checks whether the user is member of a group or not. */ - public static function inGroup($uid, $gid){} + abstract public static function inGroup($uid, $gid); /** * @brief Add a user to a group @@ -63,7 +63,7 @@ abstract class OC_Group_Example { * * Adds a user to a group. */ - public static function addToGroup($uid, $gid){} + abstract public static function addToGroup($uid, $gid); /** * @brief Removes a user from a group @@ -73,7 +73,7 @@ abstract class OC_Group_Example { * * removes the user from a group. */ - public static function removeFromGroup($uid,$gid){} + abstract public static function removeFromGroup($uid,$gid); /** * @brief Get all groups a user belongs to @@ -83,7 +83,7 @@ abstract class OC_Group_Example { * This function fetches all groups a user belongs to. It does not check * if the user exists at all. */ - public static function getUserGroups($uid){} + abstract public static function getUserGroups($uid); /** * @brief get a list of all groups @@ -91,19 +91,19 @@ abstract class OC_Group_Example { * * Returns a list with all groups */ - public static function getGroups(){} + abstract public static function getGroups(); /** * check if a group exists * @param string $gid * @return bool */ - public function groupExists($gid){} + public function groupExists($gid); /** * @brief get a list of all users in a group * @returns array with user ids */ - public static function usersInGroup($gid){} + abstract public static function usersInGroup($gid); } |