X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fnudge.php;h=219a8c9abafb5e7fa24d15e7fd76a57415158766;hb=bcccbd6d8afb8b022d80ca7fa558ac4dbb31d38b;hp=456106459457f6ac4dbb3620bc006fc60c8f38d1;hpb=6c7842129841878b65c1d686de64f98f1edcb16f;p=quix0rs-gnu-social.git diff --git a/actions/nudge.php b/actions/nudge.php index 4561064594..219a8c9aba 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -6,14 +6,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou - * @author Robin Millette + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -29,7 +29,7 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,17 +39,18 @@ require_once INSTALLDIR.'/lib/mail.php'; * Nudge a user action class. * * @category Action - * @package Laconica - * @author Evan Prodromou - * @author Robin Millette + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class NudgeAction extends Action { /** * Class handler. - * + * * @param array $args array of arguments * * @return nothing @@ -74,32 +75,33 @@ class NudgeAction extends Action // CSRF protection $token = $this->trimmed('token'); - + if (!$token || $token != common_session_token()) { $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } if (!$other->email || !$other->emailnotifynudge) { - $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); + $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set their email address yet.')); return; } $this->notify($user, $other); if ($this->boolean('ajax')) { - $this->startHTML('text/xml;charset=utf-8', true); + $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); $this->element('title', null, _('Nudge sent')); $this->elementEnd('head'); $this->elementStart('body'); - common_nudge_response(); + $this->element('p', array('id' => 'nudge_response'), _('Nudge sent!')); $this->elementEnd('body'); $this->elementEnd('html'); } else { // display a confirmation to the user common_redirect(common_local_url('showstream', - array('nickname' => $other->nickname))); + array('nickname' => $other->nickname)), + 303); } } @@ -121,5 +123,10 @@ class NudgeAction extends Action // XXX: notify by SMS } } + + function isReadOnly($args) + { + return true; + } }