Allow users to be unblocked from a group
List users who are blocked from joining a group. Add a form to let them be unblocked. Add an action that removes the block. Includes changes to group and groupblock classes.
This commit is contained in:
@@ -92,4 +92,24 @@ class Group_block extends Memcached_DataObject
|
||||
|
||||
return $block;
|
||||
}
|
||||
|
||||
static function unblockProfile($group, $profile)
|
||||
{
|
||||
$block = Group_block::pkeyGet(array('group_id' => $group->id,
|
||||
'blocked' => $profile->id));
|
||||
|
||||
if (empty($block)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$result = $block->delete();
|
||||
|
||||
if (!$result) {
|
||||
common_log_db_error($block, 'DELETE', __FILE__);
|
||||
return null;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user