git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 6a1b0e23 authored by Siebrand Mazeland's avatar Siebrand Mazeland

* update translator documentation.

* remove superfluous whitespace.
* tab to spaces.
* add FIXME for undocumented class.
parent 65045a26
......@@ -45,7 +45,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
class OtpAction extends Action
{
var $user;
......@@ -59,6 +58,7 @@ class OtpAction extends Action
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;
}
......@@ -66,6 +66,7 @@ class OtpAction extends Action
$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;
}
......@@ -73,6 +74,7 @@ class OtpAction extends Action
$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;
}
......@@ -80,6 +82,7 @@ class OtpAction extends Action
$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;
}
......@@ -87,11 +90,13 @@ class OtpAction extends Action
$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;
}
......@@ -101,6 +106,7 @@ class OtpAction extends Action
//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;
}
......@@ -111,12 +117,13 @@ class OtpAction extends Action
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;
}
......
......@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
class RobotstxtAction extends Action
{
/**
......@@ -53,7 +52,6 @@ class RobotstxtAction extends Action
*
* @return void
*/
function handle($args)
{
if (Event::handle('StartRobotsTxt', array($this))) {
......@@ -65,9 +63,7 @@ class RobotstxtAction extends Action
if (common_config('site', 'private')) {
print "Disallow: /\n";
} else {
$disallow = common_config('robotstxt', 'disallow');
foreach ($disallow as $dir) {
......@@ -92,7 +88,6 @@ class RobotstxtAction extends Action
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
return true;
......
......@@ -53,7 +53,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
class SubscribeAction extends Action
{
var $user;
......@@ -66,7 +65,6 @@ class SubscribeAction extends Action
*
* @return boolean success flag
*/
function prepare($args)
{
parent::prepare($args);
......@@ -74,6 +72,8 @@ class SubscribeAction extends Action
// 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;
}
......@@ -83,6 +83,7 @@ class SubscribeAction extends Action
$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;
......@@ -93,6 +94,7 @@ class SubscribeAction extends Action
$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;
}
......@@ -104,6 +106,7 @@ class SubscribeAction extends Action
$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;
}
......@@ -114,6 +117,7 @@ class SubscribeAction extends Action
$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;
......@@ -131,7 +135,6 @@ class SubscribeAction extends Action
*
* @return void
*/
function handle($args)
{
// Throws exception on error
......@@ -142,6 +145,7 @@ class SubscribeAction extends Action
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');
......
......@@ -19,6 +19,7 @@
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
// @todo FIXME: documentation needed.
class SupAction extends Action
{
function handle($args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment