*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
// Check to make sure we haven't already authorized the token
if ($this->reqToken->state != 0) {
// TRANS: Client error given when an invalid request token was passed to the OAuth API.
- $this->clientError(_("Invalid request token."));
+ $this->clientError(_('Invalid request token.'));
}
}
}
if (!$result) {
common_log_db_error($tokenAssoc, 'INSERT', __FILE__);
+ // TRANS: Server error displayed when a database action fails.
$this->serverError(_('Database error inserting oauth_token_association.'));
}
// Otherwise, inform the user that the rt was authorized
$this->showAuthorized();
-
} else if ($this->arg('cancel')) {
-
try {
$this->store->revoke_token($this->oauthTokenParam, 0);
$this->showCanceled();
} catch (Exception $e) {
$this->ServerError($e->getMessage());
}
-
} else {
// TRANS: Client error given on when invalid data was passed through a form in the OAuth API.
$this->clientError(_('Unexpected form submission.'));
*
* @return string title of the page
*/
-
function title()
{
// TRANS: Title for a page where a user can confirm/deny account access by an external application.
*
* @return void
*/
-
function showContent()
{
$this->elementStart('form', array('method' => 'post',
return empty($result) ? null : $oau;
}
-
}
-
$app = Oauth_application::getByConsumerKey('anonymous');
if (!$app) {
-
common_debug("API OAuth - creating anonymous application");
$app = new OAuth_application();
$app->owner = 1; // XXX: What to do here?
$id = $app->insert();
if (!$id) {
- // TRANS: Server error displayed when trying to create an anynymous OAuth application.
+ // TRANS: Server error displayed when trying to create an anynymous OAuth application.
$this->serverError(_("Could not create anonymous OAuth application."));
}
}
if (!$tokenAssoc) {
throw new Exception(
+ // TRANS: Exception thrown when no token association could be found.
_('Could not find a profile and application associated with the request token.')
);
}
if (!$result) {
throw new Exception(
+ // TRANS: Exception thrown when no access token can be issued.
_('Could not issue access token.')
);
}
if (!$result) {
common_log_db_error($appUser, 'INSERT', __FILE__);
+ // TRANS: Server error displayed when a database error occurs.
$this->serverError(_('Database error inserting OAuth application user.'));
}
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class DBErrorAction extends ServerErrorAction
{
function __construct($message='Error', $code=500)
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class Feed
{
const RSS1 = 1;
*
* @see Action::showExportList()
*/
-
class FeedList extends Widget
{
var $action = null;
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class GroupsByMembersSection extends GroupSection
{
function getGroups()
function title()
{
+ // TRANS: Title for groups with the most members section.
return _('Groups with most members');
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class GroupsByPostsSection extends GroupSection
{
function getGroups()
function title()
{
+ // TRANS: Title for groups with the most posts section.
return _('Groups with most posts');
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class GroupSection extends Section
{
function showContent()
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class GroupTagCloudSection extends TagCloudSection
{
var $group = null;
function title()
{
+ // TRANS: Title for group tag cloud section.
+ // TRANS: %s is a group name.
return sprintf(_('Tags in %s group\'s notices'), $this->group->nickname);
}
* In a multi-site queuedaemon.php run, one connection will be instantiated
* for each site being handled by the current process that has XMPP enabled.
*/
-
class XmppManager extends IoManager
{
protected $site = null;
$this->conn->addEventHandler('reconnect', 'handle_reconnect', $this);
$this->conn->setReconnectTimeout(600);
+ // @todo Needs i18n?
jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', 100);
return !is_null($this->conn);
$_cur = $user;
if (!$user) {
- $this->from_site($from, 'Unknown user; go to ' .
- common_local_url('imsettings') .
- ' to add your address to your account');
+ // TRANS: %s is the URL to the StatusNet site's Instant Messaging settings.
+ $this->from_site($from, sprintf(_('Unknown user. Go to %s ' .
+ 'to add your address to your account'),common_local_url('imsettings')));
$this->log(LOG_WARNING, 'Message from unknown user ' . $from);
return;
}
unset($pl);
}
-
function is_self($from)
{
return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from));
$content_shortened = common_shorten_links($body);
if (Notice::contentTooLong($content_shortened)) {
$from = jabber_normalize_jid($pl['from']);
- $this->from_site($from, sprintf(_('Message too long - maximum is %1$d characters, you sent %2$d.'),
+ // TRANS: Response to XMPP source when it sent too long a message.
+ // TRANS: %1$d the maximum number of allowed characters (used for plural), %2$d is the sent number.
+ $this->from_site($from, sprintf(_m('Message too long. Maximum is %1$d character, you sent %2$d.',
+ 'Message too long. Maximum is %1$d characters, you sent %2$d.',
+ Notice::maxContent()),
Notice::maxContent(),
mb_strlen($content_shortened)));
return;