* remove superfluous whitespace.
* tab to spaces.
* add FIXME for undocumented class.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class OtpAction extends Action
{
var $user;
parent::prepare($args);
if (common_is_real_login()) {
+ // TRANS: Client error displayed trying to use "one time password login" when already logged in.
$this->clientError(_('Already logged in.'));
return false;
}
$id = $this->trimmed('user_id');
if (empty($id)) {
+ // TRANS: Client error displayed trying to use "one time password login" without specifying a user.
$this->clientError(_('No user ID specified.'));
return false;
}
$this->user = User::staticGet('id', $id);
if (empty($this->user)) {
+ // TRANS: Client error displayed trying to use "one time password login" without using an existing user.
$this->clientError(_('No such user.'));
return false;
}
$this->token = $this->trimmed('token');
if (empty($this->token)) {
+ // TRANS: Client error displayed trying to use "one time password login" without specifying a login token.
$this->clientError(_('No login token specified.'));
return false;
}
$this->lt = Login_token::staticGet('user_id', $id);
if (empty($this->lt)) {
+ // TRANS: Client error displayed trying to use "one time password login" without requesting a login token.
$this->clientError(_('No login token requested.'));
return false;
}
if ($this->lt->token != $this->token) {
+ // TRANS: Client error displayed trying to use "one time password login" while specifying an invalid login token.
$this->clientError(_('Invalid login token specified.'));
return false;
}
//delete the token as it is useless
$this->lt->delete();
$this->lt = null;
+ // TRANS: Client error displayed trying to use "one time password login" while specifying an expired login token.
$this->clientError(_('Login token expired.'));
return false;
}
return true;
}
- function handle($args)
+ function handle($args)
{
parent::handle($args);
// success!
if (!common_set_user($this->user)) {
+ // TRANS: Server error displayed when a user object could not be created trying to login using "one time password login".
$this->serverError(_('Error setting user. You are probably not authorized.'));
return;
}
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class RobotstxtAction extends Action
{
/**
*
* @return void
*/
-
function handle($args)
{
if (Event::handle('StartRobotsTxt', array($this))) {
if (common_config('site', 'private')) {
print "Disallow: /\n";
-
} else {
-
$disallow = common_config('robotstxt', 'disallow');
foreach ($disallow as $dir) {
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return true;
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class SubscribeAction extends Action
{
var $user;
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
// Only allow POST requests
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ // TRANS: Client error displayed trying to perform any request method other than POST.
+ // TRANS: Do not translate POST.
$this->clientError(_('This action only accepts POST requests.'));
return false;
}
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
+ // TRANS: Client error displayed when the session token is not okay.
$this->clientError(_('There was a problem with your session token.'.
' Try again, please.'));
return false;
$this->user = common_current_user();
if (empty($this->user)) {
+ // TRANS: Client error displayed trying to subscribe when not logged in.
$this->clientError(_('Not logged in.'));
return false;
}
$this->other = Profile::staticGet('id', $other_id);
if (empty($this->other)) {
+ // TRANS: Client error displayed trying to subscribe to a non-existing profile.
$this->clientError(_('No such profile.'));
return false;
}
$omb01 = Remote_profile::staticGet('id', $other_id);
if (!empty($omb01)) {
+ // TRANS: Client error displayed trying to subscribe to an OMB 0.1 remote profile.
$this->clientError(_('You cannot subscribe to an OMB 0.1'.
' remote profile with this action.'));
return false;
*
* @return void
*/
-
function handle($args)
{
// Throws exception on error
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
+ // TRANS: Page title when subscription succeeded.
$this->element('title', null, _('Subscribed'));
$this->elementEnd('head');
$this->elementStart('body');
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
+// @todo FIXME: documentation needed.
class SupAction extends Action
{
function handle($args)