- if (!$block) {
- $this->client_error(_('That user is not blocked!'));
- return;
- }
-
- $result = $block->delete();
-
- if (!$result) {
- common_log_db_error($block, 'DELETE', __FILE__);
- $this->server_error(_('Could not delete block record.'));
- return;
- }
-
- foreach ($this->args as $k => $v) {
- if ($k == 'returnto-action') {
- $action = $v;
- } else if (substr($k, 0, 9) == 'returnto-') {
- $args[substr($k, 9)] = $v;
+ if (Event::handle('StartUnblockProfile', array($cur, $this->profile))) {
+ $result = $cur->unblock($this->profile);
+ if ($result) {
+ Event::handle('EndUnblockProfile', array($cur, $this->profile));