* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class UnblockAction extends ProfileFormAction
{
- function prepare($args)
+ function prepare(array $args = array())
{
if (!parent::prepare($args)) {
return false;
assert(!empty($cur)); // checked by parent
if (!$cur->hasBlocked($this->profile)) {
+ // TRANS: Client error displayed when trying to unblock a non-blocked user.
$this->clientError(_("You haven't blocked that user."));
- return false;
}
return true;
*
* @return void
*/
-
function handlePost()
{
- $cur = common_current_user();
- $result = $cur->unblock($this->profile);
+ $cur = common_current_user();
+
+ $result = false;
+
+ if (Event::handle('StartUnblockProfile', array($cur, $this->profile))) {
+ $result = $cur->unblock($this->profile);
+ if ($result) {
+ Event::handle('EndUnblockProfile', array($cur, $this->profile));
+ }
+ }
+
if (!$result) {
+ // TRANS: Server error displayed when removing a user block.
$this->serverError(_('Error removing the block.'));
- return;
}
}
}