We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 621a7cb3 authored by Brion Vibber's avatar Brion Vibber

Merge branch '0.9.x' into testing

parents e35d46b4 4642b024
...@@ -217,7 +217,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction ...@@ -217,7 +217,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
// TRANS: Client exception thrown when trying subscribe someone else to a group. // TRANS: Client exception thrown when trying subscribe someone else to a group.
throw new ClientException(_("Cannot add someone else's". throw new ClientException(_("Cannot add someone else's".
" membership"), 403); " membership."), 403);
} }
$xml = file_get_contents('php://input'); $xml = file_get_contents('php://input');
......
...@@ -149,7 +149,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction ...@@ -149,7 +149,7 @@ class AtompubshowfavoriteAction extends ApiAuthAction
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
// TRANS: Client exception thrown when trying to remove a favorite notice of another user. // TRANS: Client exception thrown when trying to remove a favorite notice of another user.
throw new ClientException(_("Cannot delete someone else's". throw new ClientException(_("Cannot delete someone else's".
" favorite"), 403); " favorite."), 403);
} }
$this->_fave->delete(); $this->_fave->delete();
......
...@@ -78,7 +78,7 @@ class AtompubshowmembershipAction extends ApiAuthAction ...@@ -78,7 +78,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
if (empty($this->_group)) { if (empty($this->_group)) {
// TRANS: Client exception thrown when referencing a non-existing group. // TRANS: Client exception thrown when referencing a non-existing group.
throw new ClientException(_('No such group'), 404); throw new ClientException(_('No such group.'), 404);
} }
$kv = array('group_id' => $groupId, $kv = array('group_id' => $groupId,
...@@ -88,7 +88,7 @@ class AtompubshowmembershipAction extends ApiAuthAction ...@@ -88,7 +88,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
if (empty($this->_membership)) { if (empty($this->_membership)) {
// TRANS: Client exception thrown when trying to show membership of a non-subscribed group // TRANS: Client exception thrown when trying to show membership of a non-subscribed group
throw new ClientException(_('Not a member'), 404); throw new ClientException(_('Not a member.'), 404);
} }
return true; return true;
...@@ -113,7 +113,7 @@ class AtompubshowmembershipAction extends ApiAuthAction ...@@ -113,7 +113,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
break; break;
default: default:
// TRANS: Client exception thrown when using an unsupported HTTP method. // TRANS: Client exception thrown when using an unsupported HTTP method.
throw new ClientException(_('HTTP method not supported'), 405); throw new ClientException(_('HTTP method not supported.'), 405);
break; break;
} }
return; return;
...@@ -149,7 +149,7 @@ class AtompubshowmembershipAction extends ApiAuthAction ...@@ -149,7 +149,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
$this->auth_user->id != $this->_profile->id) { $this->auth_user->id != $this->_profile->id) {
// TRANS: Client exception thrown when deleting someone else's membership. // TRANS: Client exception thrown when deleting someone else's membership.
throw new ClientException(_("Cannot delete someone else's". throw new ClientException(_("Cannot delete someone else's".
" membership"), 403); " membership."), 403);
} }
if (Event::handle('StartLeaveGroup', array($this->_group, $this->auth_user))) { if (Event::handle('StartLeaveGroup', array($this->_group, $this->auth_user))) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright (C) 2010, StatusNet, Inc. * Copyright (C) 2010, StatusNet, Inc.
* *
* Download a backup of your own account to the browser * Download a backup of your own account to the browser
* *
* PHP version 5 * PHP version 5
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
...@@ -48,17 +48,16 @@ if (!defined('STATUSNET')) { ...@@ -48,17 +48,16 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class BackupaccountAction extends Action class BackupaccountAction extends Action
{ {
/** /**
* Returns the title of the page * Returns the title of the page
* *
* @return string page title * @return string page title
*/ */
function title() function title()
{ {
// TRANS: Title for backup account page.
return _("Backup account"); return _("Backup account");
} }
...@@ -69,7 +68,6 @@ class BackupaccountAction extends Action ...@@ -69,7 +68,6 @@ class BackupaccountAction extends Action
* *
* @return boolean true * @return boolean true
*/ */
function prepare($argarray) function prepare($argarray)
{ {
parent::prepare($argarray); parent::prepare($argarray);
...@@ -77,10 +75,12 @@ class BackupaccountAction extends Action ...@@ -77,10 +75,12 @@ class BackupaccountAction extends Action
$cur = common_current_user(); $cur = common_current_user();
if (empty($cur)) { if (empty($cur)) {
// TRANS: Client exception thrown when trying to backup an account while not logged in.
throw new ClientException(_('Only logged-in users can backup their account.'), 403); throw new ClientException(_('Only logged-in users can backup their account.'), 403);
} }
if (!$cur->hasRight(Right::BACKUPACCOUNT)) { if (!$cur->hasRight(Right::BACKUPACCOUNT)) {
// TRANS: Client exception thrown when trying to backup an account without having backup rights.
throw new ClientException(_('You may not backup your account.'), 403); throw new ClientException(_('You may not backup your account.'), 403);
} }
...@@ -94,7 +94,6 @@ class BackupaccountAction extends Action ...@@ -94,7 +94,6 @@ class BackupaccountAction extends Action
* *
* @return void * @return void
*/ */
function handle($argarray=null) function handle($argarray=null)
{ {
parent::handle($argarray); parent::handle($argarray);
...@@ -109,7 +108,7 @@ class BackupaccountAction extends Action ...@@ -109,7 +108,7 @@ class BackupaccountAction extends Action
/** /**
* Send a feed of the user's activities to the browser * Send a feed of the user's activities to the browser
* *
* Uses the UserActivityStream class; may take a long time! * Uses the UserActivityStream class; may take a long time!
* *
* @return void * @return void
...@@ -118,7 +117,7 @@ class BackupaccountAction extends Action ...@@ -118,7 +117,7 @@ class BackupaccountAction extends Action
function sendFeed() function sendFeed()
{ {
$cur = common_current_user(); $cur = common_current_user();
$stream = new UserActivityStream($cur); $stream = new UserActivityStream($cur);
header('Content-Disposition: attachment; filename='.$cur->nickname.'.atom'); header('Content-Disposition: attachment; filename='.$cur->nickname.'.atom');
...@@ -132,13 +131,13 @@ class BackupaccountAction extends Action ...@@ -132,13 +131,13 @@ class BackupaccountAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$form = new BackupAccountForm($this); $form = new BackupAccountForm($this);
$form->show(); $form->show();
} }
/** /**
* Return true if read only. * Return true if read only.
* *
...@@ -148,7 +147,6 @@ class BackupaccountAction extends Action ...@@ -148,7 +147,6 @@ class BackupaccountAction extends Action
* *
* @return boolean is read only action? * @return boolean is read only action?
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return false; return false;
...@@ -161,7 +159,6 @@ class BackupaccountAction extends Action ...@@ -161,7 +159,6 @@ class BackupaccountAction extends Action
* *
* @return string last modified http header * @return string last modified http header
*/ */
function lastModified() function lastModified()
{ {
// For comparison with If-Last-Modified // For comparison with If-Last-Modified
...@@ -176,7 +173,6 @@ class BackupaccountAction extends Action ...@@ -176,7 +173,6 @@ class BackupaccountAction extends Action
* *
* @return string etag http header * @return string etag http header
*/ */
function etag() function etag()
{ {
return null; return null;
...@@ -193,7 +189,6 @@ class BackupaccountAction extends Action ...@@ -193,7 +189,6 @@ class BackupaccountAction extends Action
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class BackupAccountForm extends Form class BackupAccountForm extends Form
{ {
/** /**
...@@ -201,7 +196,6 @@ class BackupAccountForm extends Form ...@@ -201,7 +196,6 @@ class BackupAccountForm extends Form
* *
* @return string the form's class * @return string the form's class
*/ */
function formClass() function formClass()
{ {
return 'form_profile_backup'; return 'form_profile_backup';
...@@ -212,7 +206,6 @@ class BackupAccountForm extends Form ...@@ -212,7 +206,6 @@ class BackupAccountForm extends Form
* *
* @return string the form's action URL * @return string the form's action URL
*/ */
function action() function action()
{ {
return common_local_url('backupaccount'); return common_local_url('backupaccount');
...@@ -220,18 +213,18 @@ class BackupAccountForm extends Form ...@@ -220,18 +213,18 @@ class BackupAccountForm extends Form
/** /**
* Output form data * Output form data
* *
* Really, just instructions for doing a backup. * Really, just instructions for doing a backup.
* *
* @return void * @return void
*/ */
function formData() function formData()
{ {
$msg = $msg =
// TRANS: Information displayed on the backup account page.
_('You can backup your account data in '. _('You can backup your account data in '.
'<a href="http://activitystrea.ms/">Activity Streams</a> '. '<a href="http://activitystrea.ms/">Activity Streams</a> '.
'format. This is an experimental feature and provides an '. 'format. This is an experimental feature and provides an '.
'incomplete backup; private account '. 'incomplete backup; private account '.
'information like email and IM addresses is not backed up. '. 'information like email and IM addresses is not backed up. '.
'Additionally, uploaded files and direct messages are not '. 'Additionally, uploaded files and direct messages are not '.
...@@ -243,18 +236,19 @@ class BackupAccountForm extends Form ...@@ -243,18 +236,19 @@ class BackupAccountForm extends Form
/** /**
* Buttons for the form * Buttons for the form
* *
* In this case, a single submit button * In this case, a single submit button
* *
* @return void * @return void
*/ */
function formActions() function formActions()
{ {
$this->out->submit('submit', $this->out->submit('submit',
// TRANS: Submit button to backup an account on the backup account page.
_m('BUTTON', 'Backup'), _m('BUTTON', 'Backup'),
'submit', 'submit',
null, null,
// TRANS: Title for submit button to backup an account on the backup account page.
_('Backup your account')); _('Backup your account'));
} }
} }
...@@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { ...@@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @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 DeleteuserAction extends ProfileFormAction class DeleteuserAction extends ProfileFormAction
{ {
var $user = null; var $user = null;
...@@ -52,7 +51,6 @@ class DeleteuserAction extends ProfileFormAction ...@@ -52,7 +51,6 @@ class DeleteuserAction extends ProfileFormAction
* *
* @return boolean success flag * @return boolean success flag
*/ */
function prepare($args) function prepare($args)
{ {
if (!parent::prepare($args)) { if (!parent::prepare($args)) {
...@@ -64,6 +62,7 @@ class DeleteuserAction extends ProfileFormAction ...@@ -64,6 +62,7 @@ class DeleteuserAction extends ProfileFormAction
assert(!empty($cur)); // checked by parent assert(!empty($cur)); // checked by parent
if (!$cur->hasRight(Right::DELETEUSER)) { if (!$cur->hasRight(Right::DELETEUSER)) {
// TRANS: Client error displayed when trying to delete a user without having the right to delete users.
$this->clientError(_('You cannot delete users.')); $this->clientError(_('You cannot delete users.'));
return false; return false;
} }
...@@ -71,6 +70,7 @@ class DeleteuserAction extends ProfileFormAction ...@@ -71,6 +70,7 @@ class DeleteuserAction extends ProfileFormAction
$this->user = User::staticGet('id', $this->profile->id); $this->user = User::staticGet('id', $this->profile->id);
if (empty($this->user)) { if (empty($this->user)) {
// TRANS: Client error displayed when trying to delete a non-local user.
$this->clientError(_('You can only delete local users.')); $this->clientError(_('You can only delete local users.'));
return false; return false;
} }
...@@ -87,7 +87,6 @@ class DeleteuserAction extends ProfileFormAction ...@@ -87,7 +87,6 @@ class DeleteuserAction extends ProfileFormAction
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['REQUEST_METHOD'] == 'POST') {
...@@ -107,7 +106,8 @@ class DeleteuserAction extends ProfileFormAction ...@@ -107,7 +106,8 @@ class DeleteuserAction extends ProfileFormAction
} }
function title() { function title() {
return _('Delete user'); // TRANS: Title of delete user page.
return _m('TITLE','Delete user');
} }
function showNoticeForm() { function showNoticeForm() {
...@@ -130,9 +130,11 @@ class DeleteuserAction extends ProfileFormAction ...@@ -130,9 +130,11 @@ class DeleteuserAction extends ProfileFormAction
'action' => common_local_url('deleteuser'))); 'action' => common_local_url('deleteuser')));
$this->elementStart('fieldset'); $this->elementStart('fieldset');
$this->hidden('token', common_session_token()); $this->hidden('token', common_session_token());
// TRANS: Fieldset legend on delete user page.
$this->element('legend', _('Delete user')); $this->element('legend', _('Delete user'));
if (Event::handle('StartDeleteUserForm', array($this, $this->user))) { if (Event::handle('StartDeleteUserForm', array($this, $this->user))) {
$this->element('p', null, $this->element('p', null,
// TRANS: Information text to request if a user is certain that the described action has to be performed.
_('Are you sure you want to delete this user? '. _('Are you sure you want to delete this user? '.
'This will clear all data about the user from the '. 'This will clear all data about the user from the '.
'database, without a backup.')); 'database, without a backup.'));
...@@ -153,7 +155,7 @@ class DeleteuserAction extends ProfileFormAction ...@@ -153,7 +155,7 @@ class DeleteuserAction extends ProfileFormAction
'submit form_action-primary', 'submit form_action-primary',
'no', 'no',
// TRANS: Submit button title for 'No' when deleting a user. // TRANS: Submit button title for 'No' when deleting a user.
_('Do not block this user')); _('Do not delete this user'));
$this->submit('form_action-yes', $this->submit('form_action-yes',
// TRANS: Button label on the delete user form. // TRANS: Button label on the delete user form.
_m('BUTTON','Yes'), _m('BUTTON','Yes'),
...@@ -170,7 +172,6 @@ class DeleteuserAction extends ProfileFormAction ...@@ -170,7 +172,6 @@ class DeleteuserAction extends ProfileFormAction
* *
* @return void * @return void
*/ */
function handlePost() function handlePost()
{ {
if (Event::handle('StartDeleteUser', array($this, $this->user))) { if (Event::handle('StartDeleteUser', array($this, $this->user))) {
......
This diff is collapsed.
...@@ -58,6 +58,7 @@ class DisfavorAction extends Action ...@@ -58,6 +58,7 @@ class DisfavorAction extends Action
{ {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {
// TRANS: Client error displayed when trying to remove a favorite while not logged in.
$this->clientError(_('Not logged in.')); $this->clientError(_('Not logged in.'));
return; return;
} }
...@@ -71,6 +72,7 @@ class DisfavorAction extends Action ...@@ -71,6 +72,7 @@ class DisfavorAction extends Action
$notice = Notice::staticGet($id); $notice = Notice::staticGet($id);
$token = $this->trimmed('token-'.$notice->id); $token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) { if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_('There was a problem with your session token. Try again, please.')); $this->clientError(_('There was a problem with your session token. Try again, please.'));
return; return;
} }
...@@ -78,12 +80,14 @@ class DisfavorAction extends Action ...@@ -78,12 +80,14 @@ class DisfavorAction extends Action
$fave->user_id = $user->id; $fave->user_id = $user->id;
$fave->notice_id = $notice->id; $fave->notice_id = $notice->id;
if (!$fave->find(true)) { if (!$fave->find(true)) {
// TRANS: Client error displayed when trying to remove favorite status for a notice that is not a favorite.
$this->clientError(_('This notice is not a favorite!')); $this->clientError(_('This notice is not a favorite!'));
return; return;
} }
$result = $fave->delete(); $result = $fave->delete();
if (!$result) { if (!$result) {
common_log_db_error($fave, 'DELETE', __FILE__); common_log_db_error($fave, 'DELETE', __FILE__);
// TRANS: Server error displayed when removing a favorite from the database fails.
$this->serverError(_('Could not delete favorite.')); $this->serverError(_('Could not delete favorite.'));
return; return;
} }
...@@ -91,6 +95,7 @@ class DisfavorAction extends Action ...@@ -91,6 +95,7 @@ class DisfavorAction 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: Title for page on which favorites can be added.
$this->element('title', null, _('Add to favorites')); $this->element('title', null, _('Add to favorites'));
$this->elementEnd('head'); $this->elementEnd('head');
$this->elementStart('body'); $this->elementStart('body');
...@@ -105,4 +110,3 @@ class DisfavorAction extends Action ...@@ -105,4 +110,3 @@ class DisfavorAction extends Action
} }
} }
} }
<?php <?php
/** /**
* Documentation action. * Documentation action.
* *
...@@ -83,7 +82,6 @@ class DocAction extends Action ...@@ -83,7 +82,6 @@ class DocAction extends Action
* *
* @return void * @return void
*/ */
function showPageTitle() function showPageTitle()
{ {
$this->element('h1', array('class' => 'entry-title'), $this->title()); $this->element('h1', array('class' => 'entry-title'), $this->title());
...@@ -96,7 +94,6 @@ class DocAction extends Action ...@@ -96,7 +94,6 @@ class DocAction extends Action
* *
* @return void. * @return void.
*/ */
function showContentBlock() function showContentBlock()
{ {
$this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); $this->elementStart('div', array('id' => 'content', 'class' => 'hentry'));
...@@ -117,7 +114,6 @@ class DocAction extends Action ...@@ -117,7 +114,6 @@ class DocAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$this->raw($this->output); $this->raw($this->output);
...@@ -142,7 +138,6 @@ class DocAction extends Action ...@@ -142,7 +138,6 @@ class DocAction extends Action
* *
* @return boolean read-only flag (false) * @return boolean read-only flag (false)
*/ */
function isReadOnly($args) function isReadOnly($args)
{ {
return true; return true;
...@@ -155,7 +150,9 @@ class DocAction extends Action ...@@ -155,7 +150,9 @@ class DocAction extends Action
$this->filename = $this->getFilename(); $this->filename = $this->getFilename();
if (empty($this->filename)) { if (empty($this->filename)) {
throw new ClientException(sprintf(_('No such document "%s"'), $this->title), 404); // TRANS: Client exception thrown when requesting a document from the documentation that does not exist.