forked from GNUsocial/gnu-social
* update translator documentation.
* remove superfluous whitespace. * tab to spaces. * add FIXME for undocumented class.
This commit is contained in:
parent
65045a26f3
commit
6a1b0e2375
@ -45,7 +45,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class OtpAction extends Action
|
class OtpAction extends Action
|
||||||
{
|
{
|
||||||
var $user;
|
var $user;
|
||||||
@ -59,6 +58,7 @@ class OtpAction extends Action
|
|||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
|
|
||||||
if (common_is_real_login()) {
|
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.'));
|
$this->clientError(_('Already logged in.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -66,6 +66,7 @@ class OtpAction extends Action
|
|||||||
$id = $this->trimmed('user_id');
|
$id = $this->trimmed('user_id');
|
||||||
|
|
||||||
if (empty($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.'));
|
$this->clientError(_('No user ID specified.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -73,6 +74,7 @@ class OtpAction extends Action
|
|||||||
$this->user = User::staticGet('id', $id);
|
$this->user = User::staticGet('id', $id);
|
||||||
|
|
||||||
if (empty($this->user)) {
|
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.'));
|
$this->clientError(_('No such user.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -80,6 +82,7 @@ class OtpAction extends Action
|
|||||||
$this->token = $this->trimmed('token');
|
$this->token = $this->trimmed('token');
|
||||||
|
|
||||||
if (empty($this->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.'));
|
$this->clientError(_('No login token specified.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -87,11 +90,13 @@ class OtpAction extends Action
|
|||||||
$this->lt = Login_token::staticGet('user_id', $id);
|
$this->lt = Login_token::staticGet('user_id', $id);
|
||||||
|
|
||||||
if (empty($this->lt)) {
|
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.'));
|
$this->clientError(_('No login token requested.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->lt->token != $this->token) {
|
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.'));
|
$this->clientError(_('Invalid login token specified.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -101,6 +106,7 @@ class OtpAction extends Action
|
|||||||
//delete the token as it is useless
|
//delete the token as it is useless
|
||||||
$this->lt->delete();
|
$this->lt->delete();
|
||||||
$this->lt = null;
|
$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.'));
|
$this->clientError(_('Login token expired.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -117,6 +123,7 @@ class OtpAction extends Action
|
|||||||
|
|
||||||
// success!
|
// success!
|
||||||
if (!common_set_user($this->user)) {
|
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.'));
|
$this->serverError(_('Error setting user. You are probably not authorized.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class RobotstxtAction extends Action
|
class RobotstxtAction extends Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -53,7 +52,6 @@ class RobotstxtAction extends Action
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
if (Event::handle('StartRobotsTxt', array($this))) {
|
if (Event::handle('StartRobotsTxt', array($this))) {
|
||||||
@ -65,9 +63,7 @@ class RobotstxtAction extends Action
|
|||||||
if (common_config('site', 'private')) {
|
if (common_config('site', 'private')) {
|
||||||
|
|
||||||
print "Disallow: /\n";
|
print "Disallow: /\n";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$disallow = common_config('robotstxt', 'disallow');
|
$disallow = common_config('robotstxt', 'disallow');
|
||||||
|
|
||||||
foreach ($disallow as $dir) {
|
foreach ($disallow as $dir) {
|
||||||
@ -92,7 +88,6 @@ class RobotstxtAction extends Action
|
|||||||
*
|
*
|
||||||
* @return boolean is read only action?
|
* @return boolean is read only action?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -53,7 +53,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SubscribeAction extends Action
|
class SubscribeAction extends Action
|
||||||
{
|
{
|
||||||
var $user;
|
var $user;
|
||||||
@ -66,7 +65,6 @@ class SubscribeAction extends Action
|
|||||||
*
|
*
|
||||||
* @return boolean success flag
|
* @return boolean success flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($args)
|
function prepare($args)
|
||||||
{
|
{
|
||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
@ -74,6 +72,8 @@ class SubscribeAction extends Action
|
|||||||
// Only allow POST requests
|
// Only allow POST requests
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
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.'));
|
$this->clientError(_('This action only accepts POST requests.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -83,6 +83,7 @@ class SubscribeAction extends Action
|
|||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
|
|
||||||
if (!$token || $token != common_session_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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
return false;
|
||||||
@ -93,6 +94,7 @@ class SubscribeAction extends Action
|
|||||||
$this->user = common_current_user();
|
$this->user = common_current_user();
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
|
// TRANS: Client error displayed trying to subscribe when not logged in.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -104,6 +106,7 @@ class SubscribeAction extends Action
|
|||||||
$this->other = Profile::staticGet('id', $other_id);
|
$this->other = Profile::staticGet('id', $other_id);
|
||||||
|
|
||||||
if (empty($this->other)) {
|
if (empty($this->other)) {
|
||||||
|
// TRANS: Client error displayed trying to subscribe to a non-existing profile.
|
||||||
$this->clientError(_('No such profile.'));
|
$this->clientError(_('No such profile.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -114,6 +117,7 @@ class SubscribeAction extends Action
|
|||||||
$omb01 = Remote_profile::staticGet('id', $other_id);
|
$omb01 = Remote_profile::staticGet('id', $other_id);
|
||||||
|
|
||||||
if (!empty($omb01)) {
|
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'.
|
$this->clientError(_('You cannot subscribe to an OMB 0.1'.
|
||||||
' remote profile with this action.'));
|
' remote profile with this action.'));
|
||||||
return false;
|
return false;
|
||||||
@ -131,7 +135,6 @@ class SubscribeAction extends Action
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
// Throws exception on error
|
// Throws exception on error
|
||||||
@ -142,6 +145,7 @@ class SubscribeAction extends Action
|
|||||||
if ($this->boolean('ajax')) {
|
if ($this->boolean('ajax')) {
|
||||||
$this->startHTML('text/xml;charset=utf-8');
|
$this->startHTML('text/xml;charset=utf-8');
|
||||||
$this->elementStart('head');
|
$this->elementStart('head');
|
||||||
|
// TRANS: Page title when subscription succeeded.
|
||||||
$this->element('title', null, _('Subscribed'));
|
$this->element('title', null, _('Subscribed'));
|
||||||
$this->elementEnd('head');
|
$this->elementEnd('head');
|
||||||
$this->elementStart('body');
|
$this->elementStart('body');
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
||||||
|
|
||||||
|
// @todo FIXME: documentation needed.
|
||||||
class SupAction extends Action
|
class SupAction extends Action
|
||||||
{
|
{
|
||||||
function handle($args)
|
function handle($args)
|
||||||
|
Loading…
Reference in New Issue
Block a user