1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class UnblockAction extends ProfileFormAction
- {
- function prepare(array $args = array())
- {
- if (!parent::prepare($args)) {
- return false;
- }
- $cur = common_current_user();
- assert(!empty($cur));
- if (!$cur->hasBlocked($this->profile)) {
-
- $this->clientError(_("You haven't blocked that user."));
- }
- return true;
- }
-
- function handlePost()
- {
- $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) {
-
- $this->serverError(_('Error removing the block.'));
- }
- }
- }
|