X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fcancelsubscription.php;h=16654ea020b9e3c122239e5fd99a1ba986ba8b92;hb=6afa091dca980fcd856b781015ee57afa89c9339;hp=35e775ab1ddfb2ebb1e322a5011e3e4c3d8a2b3c;hpb=820a21e16d379baa7a9f27f112490e4934b69493;p=quix0rs-gnu-social.git diff --git a/actions/cancelsubscription.php b/actions/cancelsubscription.php index 35e775ab1d..16654ea020 100644 --- a/actions/cancelsubscription.php +++ b/actions/cancelsubscription.php @@ -43,23 +43,17 @@ class CancelsubscriptionAction extends FormAction { protected $needPost = true; - protected function prepare(array $args=array()) + protected function doPreparation() { - parent::prepare($args); - $profile_id = $this->int('unsubscribeto'); $this->target = Profile::getKV('id', $profile_id); if (!$this->target instanceof Profile) { throw new NoProfileException($profile_id); } - - return true; } - protected function handlePost() + protected function doPost() { - parent::handlePost(); - try { $request = Subscription_queue::pkeyGet(array('subscriber' => $this->scoped->id, 'subscribed' => $this->target->id)); @@ -70,7 +64,7 @@ class CancelsubscriptionAction extends FormAction common_debug('Tried to cancel a non-existing pending subscription'); } - if (StatusNet::isAjax()) { + if (GNUsocial::isAjax()) { $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); // TRANS: Title after unsubscribing from a group. @@ -82,10 +76,7 @@ class CancelsubscriptionAction extends FormAction $this->elementEnd('body'); $this->endHTML(); exit(); - } else { - common_redirect(common_local_url('subscriptions', - array('nickname' => $this->scoped->nickname)), - 303); } + common_redirect(common_local_url('subscriptions', array('nickname' => $this->scoped->getNickname())), 303); } }