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:
Evan Prodromou
2009-06-14 16:17:44 -07:00
parent bd26a80d45
commit f8da15bf41
6 changed files with 517 additions and 1 deletions

View File

@@ -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;
}
}