Cosmetic changes to common_redirect, clientError, serverError
Since these functions exit (or throw exception) after running, there is no need to have a 'return' statement or similar afterwards.
This commit is contained in:
parent
acbe94936f
commit
c00491cd7a
@ -77,7 +77,6 @@ class AddpeopletagAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only for logged-in users
|
// Only for logged-in users
|
||||||
@ -87,7 +86,6 @@ class AddpeopletagAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Profile to subscribe to
|
// Profile to subscribe to
|
||||||
@ -99,7 +97,6 @@ class AddpeopletagAction extends Action
|
|||||||
if (empty($this->tagged)) {
|
if (empty($this->tagged)) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
|
||||||
$this->clientError(_('No such profile.'));
|
$this->clientError(_('No such profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->arg('peopletag_id');
|
$id = $this->arg('peopletag_id');
|
||||||
@ -108,7 +105,6 @@ class AddpeopletagAction extends Action
|
|||||||
if (empty($this->peopletag)) {
|
if (empty($this->peopletag)) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'));
|
$this->clientError(_('No such list.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -144,7 +140,6 @@ class AddpeopletagAction extends Action
|
|||||||
'The remote server is probably not responding correctly. ' .
|
'The remote server is probably not responding correctly. ' .
|
||||||
'Please try retrying later.'), $this->profile->profileurl));
|
'Please try retrying later.'), $this->profile->profileurl));
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if ($this->boolean('ajax')) {
|
if ($this->boolean('ajax')) {
|
||||||
$this->startHTML('text/xml;charset=utf-8');
|
$this->startHTML('text/xml;charset=utf-8');
|
||||||
|
@ -67,7 +67,6 @@ class AllrssAction extends Rss10Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error when user not found for an rss related action.
|
// TRANS: Client error when user not found for an rss related action.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
$this->notices = $this->getNotices($this->limit);
|
$this->notices = $this->getNotices($this->limit);
|
||||||
return true;
|
return true;
|
||||||
|
@ -84,7 +84,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
|
|||||||
404,
|
404,
|
||||||
$this->format
|
$this->format
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: Twitter no longer supports IM
|
// Note: Twitter no longer supports IM
|
||||||
@ -93,7 +92,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
|
|||||||
// TRANS: Client error displayed when no valid device parameter is provided for a user's delivery device setting.
|
// TRANS: Client error displayed when no valid device parameter is provided for a user's delivery device setting.
|
||||||
$this->clientError(_( 'You must specify a parameter named ' .
|
$this->clientError(_( 'You must specify a parameter named ' .
|
||||||
'\'device\' with a value of one of: sms, im, none.' ));
|
'\'device\' with a value of one of: sms, im, none.' ));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
@ -124,7 +122,6 @@ class ApiAccountUpdateDeliveryDeviceAction extends ApiAuthAction
|
|||||||
common_log_db_error($this->user, 'UPDATE', __FILE__);
|
common_log_db_error($this->user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed when a user's delivery device cannot be updated.
|
// TRANS: Server error displayed when a user's delivery device cannot be updated.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile = $this->user->getProfile();
|
$profile = $this->user->getProfile();
|
||||||
|
@ -92,7 +92,6 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
|
|||||||
if (empty($profile)) {
|
if (empty($profile)) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->clientError(_('User has no profile.'));
|
$this->clientError(_('User has no profile.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$original = clone($profile);
|
$original = clone($profile);
|
||||||
@ -128,7 +127,6 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
|
|||||||
common_log_db_error($profile, 'UPDATE', __FILE__);
|
common_log_db_error($profile, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed if a user profile could not be saved.
|
// TRANS: Server error displayed if a user profile could not be saved.
|
||||||
$this->serverError(_('Could not save profile.'));
|
$this->serverError(_('Could not save profile.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$twitter_user = $this->twitterUserArray($profile, true);
|
$twitter_user = $this->twitterUserArray($profile, true);
|
||||||
|
@ -64,7 +64,6 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
|
|||||||
if (!in_array($this->format, array('xml', 'json'))) {
|
if (!in_array($this->format, array('xml', 'json'))) {
|
||||||
// TRANS: Client error displayed when coming across a non-supported API method.
|
// TRANS: Client error displayed when coming across a non-supported API method.
|
||||||
$this->clientError(_('API method not found.'), $code = 404);
|
$this->clientError(_('API method not found.'), $code = 404);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$twitter_user = $this->twitterUserArray($this->auth_user->getProfile(), true);
|
$twitter_user = $this->twitterUserArray($this->auth_user->getProfile(), true);
|
||||||
|
@ -120,7 +120,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
|
|||||||
if (!in_array($this->format, array('xml', 'json'))) {
|
if (!in_array($this->format, array('xml', 'json'))) {
|
||||||
// TRANS: Client error displayed when coming across a non-supported API method.
|
// TRANS: Client error displayed when coming across a non-supported API method.
|
||||||
$this->clientError(_('API method not found.'), 404);
|
$this->clientError(_('API method not found.'), 404);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->source)) {
|
if (empty($this->source)) {
|
||||||
@ -129,7 +128,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
|
|||||||
_('Could not determine source user.'),
|
_('Could not determine source user.'),
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->target)) {
|
if (empty($this->target)) {
|
||||||
@ -138,7 +136,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
|
|||||||
_('Could not find target user.'),
|
_('Could not find target user.'),
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->twitterRelationshipArray($this->source, $this->target);
|
$result = $this->twitterRelationshipArray($this->source, $this->target);
|
||||||
|
@ -63,7 +63,6 @@ class ApiMediaUploadAction extends ApiAuthAction
|
|||||||
_('This method requires a POST.'),
|
_('This method requires a POST.'),
|
||||||
400, $this->format
|
400, $this->format
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround for PHP returning empty $_POST and $_FILES when POST
|
// Workaround for PHP returning empty $_POST and $_FILES when POST
|
||||||
@ -79,7 +78,6 @@ class ApiMediaUploadAction extends ApiAuthAction
|
|||||||
'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
|
'The server was unable to handle that much POST data (%s bytes) due to its current configuration.',
|
||||||
intval($_SERVER['CONTENT_LENGTH']));
|
intval($_SERVER['CONTENT_LENGTH']));
|
||||||
$this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
|
$this->clientError(sprintf($msg, $_SERVER['CONTENT_LENGTH']));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$upload = null;
|
$upload = null;
|
||||||
@ -88,7 +86,6 @@ class ApiMediaUploadAction extends ApiAuthAction
|
|||||||
$upload = MediaFile::fromUpload('media', $this->auth_user->getProfile());
|
$upload = MediaFile::fromUpload('media', $this->auth_user->getProfile());
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->clientError($e->getMessage(), $e->getCode());
|
$this->clientError($e->getMessage(), $e->getCode());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($upload)) {
|
if (isset($upload)) {
|
||||||
@ -96,7 +93,6 @@ class ApiMediaUploadAction extends ApiAuthAction
|
|||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when uploading a media file has failed.
|
// TRANS: Client error displayed when uploading a media file has failed.
|
||||||
$this->clientError(_('Upload failed.'));
|
$this->clientError(_('Upload failed.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,6 @@ class ApiOAuthAccessTokenAction extends ApiOAuthAction
|
|||||||
common_debug(var_export($req, true));
|
common_debug(var_export($req, true));
|
||||||
$code = $e->getCode();
|
$code = $e->getCode();
|
||||||
$this->clientError($e->getMessage(), empty($code) ? 401 : $code, 'text');
|
$this->clientError($e->getMessage(), empty($code) ? 401 : $code, 'text');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($atok)) {
|
if (empty($atok)) {
|
||||||
|
@ -101,7 +101,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
|
|||||||
if (!in_array($this->format, array('xml', 'json', 'atom'))) {
|
if (!in_array($this->format, array('xml', 'json', 'atom'))) {
|
||||||
// TRANS: Client error displayed when coming across a non-supported API method.
|
// TRANS: Client error displayed when coming across a non-supported API method.
|
||||||
$this->clientError(_('API method not found.'), 404);
|
$this->clientError(_('API method not found.'), 404);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($_SERVER['REQUEST_METHOD']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
@ -114,7 +113,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
|
|||||||
default:
|
default:
|
||||||
// TRANS: Client error displayed calling an unsupported HTTP error in API status show.
|
// TRANS: Client error displayed calling an unsupported HTTP error in API status show.
|
||||||
$this->clientError(_('HTTP method not supported.'), 405);
|
$this->clientError(_('HTTP method not supported.'), 405);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +221,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
|
|||||||
if ($this->format != 'atom') {
|
if ($this->format != 'atom') {
|
||||||
// TRANS: Client error displayed when trying to delete a notice not using the Atom format.
|
// TRANS: Client error displayed when trying to delete a notice not using the Atom format.
|
||||||
$this->clientError(_('Can only delete using the Atom format.'));
|
$this->clientError(_('Can only delete using the Atom format.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->auth_user) ||
|
if (empty($this->auth_user) ||
|
||||||
@ -231,7 +228,6 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
|
|||||||
!$this->auth_user->hasRight(Right::DELETEOTHERSNOTICE))) {
|
!$this->auth_user->hasRight(Right::DELETEOTHERSNOTICE))) {
|
||||||
// TRANS: Client error displayed when a user has no rights to delete notices of other users.
|
// TRANS: Client error displayed when a user has no rights to delete notices of other users.
|
||||||
$this->clientError(_('Cannot delete this notice.'), 403);
|
$this->clientError(_('Cannot delete this notice.'), 403);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Event::handle('StartDeleteOwnNotice', array($this->auth_user, $this->notice))) {
|
if (Event::handle('StartDeleteOwnNotice', array($this->auth_user, $this->notice))) {
|
||||||
|
@ -57,7 +57,6 @@ class ApprovegroupAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to leave a group.'));
|
$this->clientError(_('You must be logged in to leave a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -72,7 +71,6 @@ class ApprovegroupAction extends Action
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('leavegroup', $args), 301);
|
common_redirect(common_local_url('leavegroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -80,27 +78,23 @@ class ApprovegroupAction extends Action
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-local group.
|
// TRANS: Client error displayed when trying to leave a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
|
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
|
||||||
$this->clientError(_('No nickname or ID.'), 404);
|
$this->clientError(_('No nickname or ID.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-existing group.
|
// TRANS: Client error displayed when trying to leave a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if (empty($cur)) {
|
if (empty($cur)) {
|
||||||
// TRANS: Client error displayed trying to approve group membership while not logged in.
|
// TRANS: Client error displayed trying to approve group membership while not logged in.
|
||||||
$this->clientError(_('Must be logged in.'), 403);
|
$this->clientError(_('Must be logged in.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if ($this->arg('profile_id')) {
|
if ($this->arg('profile_id')) {
|
||||||
if ($cur->isAdmin($this->group)) {
|
if ($cur->isAdmin($this->group)) {
|
||||||
@ -108,12 +102,10 @@ class ApprovegroupAction extends Action
|
|||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed trying to approve group membership while not a group administrator.
|
// TRANS: Client error displayed trying to approve group membership while not a group administrator.
|
||||||
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
|
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed trying to approve group membership without specifying a profile to approve.
|
// TRANS: Client error displayed trying to approve group membership without specifying a profile to approve.
|
||||||
$this->clientError(_('Must specify a profile.'));
|
$this->clientError(_('Must specify a profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->request = Group_join_queue::pkeyGet(array('profile_id' => $this->profile->id,
|
$this->request = Group_join_queue::pkeyGet(array('profile_id' => $this->profile->id,
|
||||||
@ -186,9 +178,7 @@ class ApprovegroupAction extends Action
|
|||||||
$this->elementEnd('body');
|
$this->elementEnd('body');
|
||||||
$this->endHTML();
|
$this->endHTML();
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('groupmembers', array('nickname' =>
|
common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303);
|
||||||
$this->group->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,14 +58,12 @@ class ApprovesubAction extends Action
|
|||||||
if (empty($cur)) {
|
if (empty($cur)) {
|
||||||
// TRANS: Client error displayed trying to approve group membership while not logged in.
|
// TRANS: Client error displayed trying to approve group membership while not logged in.
|
||||||
$this->clientError(_('Must be logged in.'), 403);
|
$this->clientError(_('Must be logged in.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if ($this->arg('profile_id')) {
|
if ($this->arg('profile_id')) {
|
||||||
$this->profile = Profile::getKV('id', $this->arg('profile_id'));
|
$this->profile = Profile::getKV('id', $this->arg('profile_id'));
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed trying to approve subscriptionswithout specifying a profile to approve.
|
// TRANS: Client error displayed trying to approve subscriptionswithout specifying a profile to approve.
|
||||||
$this->clientError(_('Must specify a profile.'));
|
$this->clientError(_('Must specify a profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->request = Subscription_queue::pkeyGet(array('subscriber' => $this->profile->id,
|
$this->request = Subscription_queue::pkeyGet(array('subscriber' => $this->profile->id,
|
||||||
|
@ -118,7 +118,6 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
|
|||||||
default:
|
default:
|
||||||
// TRANS: Client error shown when using a non-supported HTTP method.
|
// TRANS: Client error shown when using a non-supported HTTP method.
|
||||||
$this->clientError(_('HTTP method not supported.'), 405);
|
$this->clientError(_('HTTP method not supported.'), 405);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -105,7 +105,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
default:
|
default:
|
||||||
// TRANS: Client exception thrown when using an unsupported HTTP method.
|
// TRANS: Client exception thrown when using an unsupported HTTP method.
|
||||||
$this->clientError(_('HTTP method not supported.'), 405);
|
$this->clientError(_('HTTP method not supported.'), 405);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -232,7 +231,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
$dom->documentElement->localName != 'entry') {
|
$dom->documentElement->localName != 'entry') {
|
||||||
// TRANS: Client error displayed when not using an Atom entry.
|
// TRANS: Client error displayed when not using an Atom entry.
|
||||||
$this->clientError(_('Atom post must be an Atom entry.'));
|
$this->clientError(_('Atom post must be an Atom entry.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$activity = new Activity($dom->documentElement);
|
$activity = new Activity($dom->documentElement);
|
||||||
@ -244,7 +242,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
if ($activity->verb != ActivityVerb::FOLLOW) {
|
if ($activity->verb != ActivityVerb::FOLLOW) {
|
||||||
// TRANS: Client error displayed when not using the follow verb.
|
// TRANS: Client error displayed when not using the follow verb.
|
||||||
$this->clientError(_('Can only handle Follow activities.'));
|
$this->clientError(_('Can only handle Follow activities.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = $activity->objects[0];
|
$person = $activity->objects[0];
|
||||||
@ -252,7 +249,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
if ($person->type != ActivityObject::PERSON) {
|
if ($person->type != ActivityObject::PERSON) {
|
||||||
// TRANS: Client exception thrown when subscribing to an object that is not a person.
|
// TRANS: Client exception thrown when subscribing to an object that is not a person.
|
||||||
$this->clientError(_('Can only follow people.'));
|
$this->clientError(_('Can only follow people.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: OStatus discovery (maybe)
|
// XXX: OStatus discovery (maybe)
|
||||||
@ -263,7 +259,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
// TRANS: Client exception thrown when subscribing to a non-existing profile.
|
// TRANS: Client exception thrown when subscribing to a non-existing profile.
|
||||||
// TRANS: %s is the unknown profile ID.
|
// TRANS: %s is the unknown profile ID.
|
||||||
$this->clientError(sprintf(_('Unknown profile %s.'), $person->id));
|
$this->clientError(sprintf(_('Unknown profile %s.'), $person->id));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Subscription::exists($this->_profile, $profile)) {
|
if (Subscription::exists($this->_profile, $profile)) {
|
||||||
@ -273,7 +268,6 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
$this->clientError(sprintf(_('Already subscribed to %s.'),
|
$this->clientError(sprintf(_('Already subscribed to %s.'),
|
||||||
$person->id),
|
$person->id),
|
||||||
409);
|
409);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Subscription::start($this->_profile, $profile)) {
|
if (Subscription::start($this->_profile, $profile)) {
|
||||||
|
@ -71,7 +71,6 @@ class AttachmentAction extends Action
|
|||||||
if (empty($this->attachment)) {
|
if (empty($this->attachment)) {
|
||||||
// TRANS: Client error displayed trying to get a non-existing attachment.
|
// TRANS: Client error displayed trying to get a non-existing attachment.
|
||||||
$this->clientError(_('No such attachment.'), 404);
|
$this->clientError(_('No such attachment.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,6 @@ class AvatarsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'SELECT', __FILE__);
|
common_log_db_error($user, 'SELECT', __FILE__);
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->elementStart('form', array('enctype' => 'multipart/form-data',
|
$this->elementStart('form', array('enctype' => 'multipart/form-data',
|
||||||
@ -195,7 +194,6 @@ class AvatarsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'SELECT', __FILE__);
|
common_log_db_error($user, 'SELECT', __FILE__);
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->elementStart('form', array('method' => 'post',
|
$this->elementStart('form', array('method' => 'post',
|
||||||
@ -362,7 +360,6 @@ class AvatarsettingsAction extends SettingsAction
|
|||||||
if (!$filedata) {
|
if (!$filedata) {
|
||||||
// TRANS: Server error displayed if an avatar upload went wrong somehow server side.
|
// TRANS: Server error displayed if an avatar upload went wrong somehow server side.
|
||||||
$this->serverError(_('Lost our file data.'));
|
$this->serverError(_('Lost our file data.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$file_d = ($filedata['width'] > $filedata['height'])
|
$file_d = ($filedata['width'] > $filedata['height'])
|
||||||
|
@ -66,7 +66,6 @@ class BlockAction extends ProfileFormAction
|
|||||||
if ($cur->hasBlocked($this->profile)) {
|
if ($cur->hasBlocked($this->profile)) {
|
||||||
// TRANS: Client error displayed when blocking a user that has already been blocked.
|
// TRANS: Client error displayed when blocking a user that has already been blocked.
|
||||||
$this->clientError(_('You already blocked that user.'));
|
$this->clientError(_('You already blocked that user.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -187,7 +186,6 @@ class BlockAction extends ProfileFormAction
|
|||||||
if (!$result) {
|
if (!$result) {
|
||||||
// TRANS: Server error displayed when blocking a user fails.
|
// TRANS: Server error displayed when blocking a user fails.
|
||||||
$this->serverError(_('Failed to save block information.'));
|
$this->serverError(_('Failed to save block information.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,13 +65,11 @@ class BlockedfromgroupAction extends GroupAction
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('blockedfromgroup', $args), 301);
|
common_redirect(common_local_url('blockedfromgroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
// TRANS: Client error displayed when requesting a list of blocked users for a group without providing a group nickname.
|
// TRANS: Client error displayed when requesting a list of blocked users for a group without providing a group nickname.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -79,7 +77,6 @@ class BlockedfromgroupAction extends GroupAction
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when requesting a list of blocked users for a non-local group.
|
// TRANS: Client error displayed when requesting a list of blocked users for a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
@ -87,7 +84,6 @@ class BlockedfromgroupAction extends GroupAction
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when requesting a list of blocked users for a non-existing group.
|
// TRANS: Client error displayed when requesting a list of blocked users for a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -57,7 +57,6 @@ class CancelgroupAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to leave a group.'));
|
$this->clientError(_('You must be logged in to leave a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -71,7 +70,6 @@ class CancelgroupAction extends Action
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('leavegroup', $args), 301);
|
common_redirect(common_local_url('leavegroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -79,27 +77,23 @@ class CancelgroupAction extends Action
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-local group.
|
// TRANS: Client error displayed when trying to leave a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
|
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
|
||||||
$this->clientError(_('No nickname or ID.'), 404);
|
$this->clientError(_('No nickname or ID.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-existing group.
|
// TRANS: Client error displayed when trying to leave a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if (empty($cur)) {
|
if (empty($cur)) {
|
||||||
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
||||||
$this->clientError(_('Must be logged in.'), 403);
|
$this->clientError(_('Must be logged in.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if ($this->arg('profile_id')) {
|
if ($this->arg('profile_id')) {
|
||||||
if ($cur->isAdmin($this->group)) {
|
if ($cur->isAdmin($this->group)) {
|
||||||
@ -108,7 +102,6 @@ class CancelgroupAction extends Action
|
|||||||
// TRANS: Client error displayed when trying to approve or cancel a group join request without
|
// TRANS: Client error displayed when trying to approve or cancel a group join request without
|
||||||
// TRANS: being a group administrator.
|
// TRANS: being a group administrator.
|
||||||
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
|
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->profile = $cur->getProfile();
|
$this->profile = $cur->getProfile();
|
||||||
@ -164,9 +157,7 @@ class CancelgroupAction extends Action
|
|||||||
$this->elementEnd('body');
|
$this->elementEnd('body');
|
||||||
$this->endHTML();
|
$this->endHTML();
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('groupmembers', array('nickname' =>
|
common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303);
|
||||||
$this->group->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@ class CancelsubscriptionAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -63,7 +62,6 @@ class CancelsubscriptionAction extends Action
|
|||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||||
common_redirect(common_local_url('subscriptions',
|
common_redirect(common_local_url('subscriptions',
|
||||||
array('nickname' => $user->nickname)));
|
array('nickname' => $user->nickname)));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use a session token for CSRF protection. */
|
/* Use a session token for CSRF protection. */
|
||||||
@ -74,7 +72,6 @@ class CancelsubscriptionAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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. ' .
|
$this->clientError(_('There was a problem with your session token. ' .
|
||||||
'Try again, please.'));
|
'Try again, please.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$other_id = $this->arg('unsubscribeto');
|
$other_id = $this->arg('unsubscribeto');
|
||||||
@ -82,7 +79,6 @@ class CancelsubscriptionAction extends Action
|
|||||||
if (!$other_id) {
|
if (!$other_id) {
|
||||||
// TRANS: Client error displayed when trying to leave a group without specifying an ID.
|
// TRANS: Client error displayed when trying to leave a group without specifying an ID.
|
||||||
$this->clientError(_('No profile ID in request.'));
|
$this->clientError(_('No profile ID in request.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$other = Profile::getKV('id', $other_id);
|
$other = Profile::getKV('id', $other_id);
|
||||||
@ -90,7 +86,6 @@ class CancelsubscriptionAction extends Action
|
|||||||
if (!$other) {
|
if (!$other) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-existing group.
|
// TRANS: Client error displayed when trying to leave a non-existing group.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->request = Subscription_queue::pkeyGet(array('subscriber' => $user->id,
|
$this->request = Subscription_queue::pkeyGet(array('subscriber' => $user->id,
|
||||||
|
@ -66,25 +66,21 @@ class ConfirmaddressAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
common_set_returnto($this->selfUrl());
|
common_set_returnto($this->selfUrl());
|
||||||
common_redirect(common_local_url('login'));
|
common_redirect(common_local_url('login'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$code = $this->trimmed('code');
|
$code = $this->trimmed('code');
|
||||||
if (!$code) {
|
if (!$code) {
|
||||||
// TRANS: Client error displayed when not providing a confirmation code in the contact address confirmation action.
|
// TRANS: Client error displayed when not providing a confirmation code in the contact address confirmation action.
|
||||||
$this->clientError(_('No confirmation code.'));
|
$this->clientError(_('No confirmation code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$confirm = Confirm_address::getKV('code', $code);
|
$confirm = Confirm_address::getKV('code', $code);
|
||||||
if (!$confirm) {
|
if (!$confirm) {
|
||||||
// TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action.
|
// TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action.
|
||||||
$this->clientError(_('Confirmation code not found.'));
|
$this->clientError(_('Confirmation code not found.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if ($cur->id != $confirm->user_id) {
|
if ($cur->id != $confirm->user_id) {
|
||||||
// TRANS: Client error displayed when not providing a confirmation code for another user in the contact address confirmation action.
|
// TRANS: Client error displayed when not providing a confirmation code for another user in the contact address confirmation action.
|
||||||
$this->clientError(_('That confirmation code is not for you!'));
|
$this->clientError(_('That confirmation code is not for you!'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$type = $confirm->address_type;
|
$type = $confirm->address_type;
|
||||||
$transports = array();
|
$transports = array();
|
||||||
@ -92,7 +88,6 @@ class ConfirmaddressAction extends Action
|
|||||||
if (!in_array($type, array('email', 'sms')) && !in_array($type, array_keys($transports))) {
|
if (!in_array($type, array('email', 'sms')) && !in_array($type, array_keys($transports))) {
|
||||||
// TRANS: Server error for an unknown address type, which can be 'email', 'sms', or the name of an IM network (such as 'xmpp' or 'aim')
|
// TRANS: Server error for an unknown address type, which can be 'email', 'sms', or the name of an IM network (such as 'xmpp' or 'aim')
|
||||||
$this->serverError(sprintf(_('Unrecognized address type %s'), $type));
|
$this->serverError(sprintf(_('Unrecognized address type %s'), $type));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$this->address = $confirm->address;
|
$this->address = $confirm->address;
|
||||||
$cur->query('BEGIN');
|
$cur->query('BEGIN');
|
||||||
@ -101,7 +96,6 @@ class ConfirmaddressAction extends Action
|
|||||||
if ($cur->$type == $confirm->address) {
|
if ($cur->$type == $confirm->address) {
|
||||||
// TRANS: Client error for an already confirmed email/jabber/sms address.
|
// TRANS: Client error for an already confirmed email/jabber/sms address.
|
||||||
$this->clientError(_('That address has already been confirmed.'));
|
$this->clientError(_('That address has already been confirmed.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$orig_user = clone($cur);
|
$orig_user = clone($cur);
|
||||||
@ -120,7 +114,6 @@ class ConfirmaddressAction extends Action
|
|||||||
common_log_db_error($cur, 'UPDATE', __FILE__);
|
common_log_db_error($cur, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed when confirming an e-mail address or IM address fails.
|
// TRANS: Server error displayed when confirming an e-mail address or IM address fails.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type == 'email') {
|
if ($type == 'email') {
|
||||||
@ -136,7 +129,6 @@ class ConfirmaddressAction extends Action
|
|||||||
if($user_im_prefs->screenname == $confirm->address){
|
if($user_im_prefs->screenname == $confirm->address){
|
||||||
// TRANS: Client error for an already confirmed IM address.
|
// TRANS: Client error for an already confirmed IM address.
|
||||||
$this->clientError(_('That address has already been confirmed.'));
|
$this->clientError(_('That address has already been confirmed.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$user_im_prefs->screenname = $confirm->address;
|
$user_im_prefs->screenname = $confirm->address;
|
||||||
$result = $user_im_prefs->update();
|
$result = $user_im_prefs->update();
|
||||||
@ -145,7 +137,6 @@ class ConfirmaddressAction extends Action
|
|||||||
common_log_db_error($user_im_prefs, 'UPDATE', __FILE__);
|
common_log_db_error($user_im_prefs, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed when updating IM preferences fails.
|
// TRANS: Server error displayed when updating IM preferences fails.
|
||||||
$this->serverError(_('Could not update user IM preferences.'));
|
$this->serverError(_('Could not update user IM preferences.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$user_im_prefs = new User_im_prefs();
|
$user_im_prefs = new User_im_prefs();
|
||||||
@ -158,7 +149,6 @@ class ConfirmaddressAction extends Action
|
|||||||
common_log_db_error($user_im_prefs, 'INSERT', __FILE__);
|
common_log_db_error($user_im_prefs, 'INSERT', __FILE__);
|
||||||
// TRANS: Server error displayed when adding IM preferences fails.
|
// TRANS: Server error displayed when adding IM preferences fails.
|
||||||
$this->serverError(_('Could not insert user IM preferences.'));
|
$this->serverError(_('Could not insert user IM preferences.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +161,6 @@ class ConfirmaddressAction extends Action
|
|||||||
// TRANS: Server error displayed when an address confirmation code deletion from the
|
// TRANS: Server error displayed when an address confirmation code deletion from the
|
||||||
// TRANS: database fails in the contact address confirmation action.
|
// TRANS: database fails in the contact address confirmation action.
|
||||||
$this->serverError(_('Could not delete address confirmation.'));
|
$this->serverError(_('Could not delete address confirmation.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur->query('COMMIT');
|
$cur->query('COMMIT');
|
||||||
|
@ -60,7 +60,6 @@ class DeleteapplicationAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed trying to delete an application while not logged in.
|
// TRANS: Client error displayed trying to delete an application while not logged in.
|
||||||
$this->clientError(_('You must be logged in to delete an application.'));
|
$this->clientError(_('You must be logged in to delete an application.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = (int)$this->arg('id');
|
$id = (int)$this->arg('id');
|
||||||
@ -69,7 +68,6 @@ class DeleteapplicationAction extends Action
|
|||||||
if (empty($this->app)) {
|
if (empty($this->app)) {
|
||||||
// TRANS: Client error displayed trying to delete an application that does not exist.
|
// TRANS: Client error displayed trying to delete an application that does not exist.
|
||||||
$this->clientError(_('Application not found.'));
|
$this->clientError(_('Application not found.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -77,7 +75,6 @@ class DeleteapplicationAction extends Action
|
|||||||
if ($cur->id != $this->app->owner) {
|
if ($cur->id != $this->app->owner) {
|
||||||
// TRANS: Client error displayed trying to delete an application the current user does not own.
|
// TRANS: Client error displayed trying to delete an application the current user does not own.
|
||||||
$this->clientError(_('You are not the owner of this application.'), 401);
|
$this->clientError(_('You are not the owner of this application.'), 401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -101,7 +98,6 @@ class DeleteapplicationAction extends Action
|
|||||||
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.
|
// 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.'));
|
$this->clientError(_('There was a problem with your session token.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->arg('no')) {
|
if ($this->arg('no')) {
|
||||||
|
@ -62,7 +62,6 @@ class DeletegroupAction extends RedirectingAction
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error when trying to delete group while not logged in.
|
// TRANS: Client error when trying to delete group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to delete a group.'));
|
$this->clientError(_('You must be logged in to delete a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -77,7 +76,6 @@ class DeletegroupAction extends RedirectingAction
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('leavegroup', $args), 301);
|
common_redirect(common_local_url('leavegroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -85,27 +83,23 @@ class DeletegroupAction extends RedirectingAction
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error when trying to delete a non-local group.
|
// TRANS: Client error when trying to delete a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error when trying to delete a group without providing a nickname or ID for the group.
|
// TRANS: Client error when trying to delete a group without providing a nickname or ID for the group.
|
||||||
$this->clientError(_('No nickname or ID.'), 404);
|
$this->clientError(_('No nickname or ID.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error when trying to delete a non-existing group.
|
// TRANS: Client error when trying to delete a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if (!$cur->hasRight(Right::DELETEGROUP)) {
|
if (!$cur->hasRight(Right::DELETEGROUP)) {
|
||||||
// TRANS: Client error when trying to delete a group without having the rights to delete it.
|
// TRANS: Client error when trying to delete a group without having the rights to delete it.
|
||||||
$this->clientError(_('You are not allowed to delete this group.'), 403);
|
$this->clientError(_('You are not allowed to delete this group.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -166,8 +160,7 @@ class DeletegroupAction extends RedirectingAction
|
|||||||
} else {
|
} else {
|
||||||
// @fixme if we could direct to the page on which this group
|
// @fixme if we could direct to the page on which this group
|
||||||
// would have shown... that would be awesome
|
// would have shown... that would be awesome
|
||||||
common_redirect(common_local_url('groups'),
|
common_redirect(common_local_url('groups'), 303);
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ class DeleteuserAction extends ProfileFormAction
|
|||||||
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.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('id', $this->profile->id);
|
$this->user = User::getKV('id', $this->profile->id);
|
||||||
@ -72,7 +71,6 @@ class DeleteuserAction extends ProfileFormAction
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Client error displayed when trying to delete a non-local 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 true;
|
return true;
|
||||||
|
@ -64,7 +64,6 @@ class EditApplicationAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed trying to edit an application while not logged in.
|
// TRANS: Client error displayed trying to edit an application while not logged in.
|
||||||
$this->clientError(_('You must be logged in to edit an application.'));
|
$this->clientError(_('You must be logged in to edit an application.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = (int)$this->arg('id');
|
$id = (int)$this->arg('id');
|
||||||
@ -81,7 +80,6 @@ class EditApplicationAction extends Action
|
|||||||
if (!$this->app) {
|
if (!$this->app) {
|
||||||
// TRANS: Client error displayed trying to edit an application that does not exist.
|
// TRANS: Client error displayed trying to edit an application that does not exist.
|
||||||
$this->clientError(_('No such application.'));
|
$this->clientError(_('No such application.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -130,7 +128,6 @@ class EditApplicationAction extends Action
|
|||||||
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.
|
// 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.'));
|
$this->clientError(_('There was a problem with your session token.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
@ -66,7 +66,6 @@ class EditgroupAction extends GroupAction
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed trying to edit a group while not logged in.
|
// TRANS: Client error displayed trying to edit a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to create a group.'));
|
$this->clientError(_('You must be logged in to create a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -77,13 +76,11 @@ class EditgroupAction extends GroupAction
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('editgroup', $args), 301);
|
common_redirect(common_local_url('editgroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
// TRANS: Client error displayed trying to edit a group while not proving a nickname for the group to edit.
|
// TRANS: Client error displayed trying to edit a group while not proving a nickname for the group to edit.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupid = $this->trimmed('groupid');
|
$groupid = $this->trimmed('groupid');
|
||||||
@ -100,7 +97,6 @@ class EditgroupAction extends GroupAction
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed trying to edit a non-existing group.
|
// TRANS: Client error displayed trying to edit a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -108,7 +104,6 @@ class EditgroupAction extends GroupAction
|
|||||||
if (!$cur->isAdmin($this->group)) {
|
if (!$cur->isAdmin($this->group)) {
|
||||||
// TRANS: Client error displayed trying to edit a group while not being a group admin.
|
// TRANS: Client error displayed trying to edit a group while not being a group admin.
|
||||||
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -274,9 +269,7 @@ class EditgroupAction extends GroupAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->group->nickname != $orig->nickname) {
|
if ($this->group->nickname != $orig->nickname) {
|
||||||
common_redirect(common_local_url('editgroup',
|
common_redirect(common_local_url('editgroup', array('nickname' => $nickname)), 303);
|
||||||
array('nickname' => $nickname)),
|
|
||||||
303);
|
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Group edit form success message.
|
// TRANS: Group edit form success message.
|
||||||
$this->showForm(_('Options saved.'));
|
$this->showForm(_('Options saved.'));
|
||||||
|
@ -67,7 +67,6 @@ class EditpeopletagAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->arg('id');
|
$id = $this->arg('id');
|
||||||
@ -88,7 +87,6 @@ class EditpeopletagAction extends Action
|
|||||||
if ($tagger_arg != $tagger || $tag_arg != $tag) {
|
if ($tagger_arg != $tagger || $tag_arg != $tag) {
|
||||||
$args = array('tagger' => $tagger, 'tag' => $tag);
|
$args = array('tagger' => $tagger, 'tag' => $tag);
|
||||||
common_redirect(common_local_url('editpeopletag', $args), 301);
|
common_redirect(common_local_url('editpeopletag', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = null;
|
$user = null;
|
||||||
@ -101,7 +99,6 @@ class EditpeopletagAction extends Action
|
|||||||
if (!$tagger) {
|
if (!$tagger) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a tagging user or ID.
|
// TRANS: Error message displayed when trying to perform an action that requires a tagging user or ID.
|
||||||
$this->clientError(_('No tagger or ID.'), 404);
|
$this->clientError(_('No tagger or ID.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV('nickname', $tagger);
|
$user = User::getKV('nickname', $tagger);
|
||||||
@ -111,20 +108,17 @@ class EditpeopletagAction extends Action
|
|||||||
if (!$this->peopletag) {
|
if (!$this->peopletag) {
|
||||||
// TRANS: Client error displayed when referring to a non-existing list.
|
// TRANS: Client error displayed when referring to a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
// This should not be happening
|
// This should not be happening
|
||||||
// TRANS: Client error displayed when referring to non-local user.
|
// TRANS: Client error displayed when referring to non-local user.
|
||||||
$this->clientError(_('Not a local user.'), 404);
|
$this->clientError(_('Not a local user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($current->id != $user->id) {
|
if ($current->id != $user->id) {
|
||||||
// TRANS: Client error displayed when reting to edit a tag that was not self-created.
|
// TRANS: Client error displayed when reting to edit a tag that was not self-created.
|
||||||
$this->clientError(_('You must be the creator of the tag to edit it.'), 404);
|
$this->clientError(_('You must be the creator of the tag to edit it.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = $user->getProfile();
|
$this->tagger = $user->getProfile();
|
||||||
@ -311,9 +305,7 @@ class EditpeopletagAction extends Action
|
|||||||
// This might take quite a bit of time.
|
// This might take quite a bit of time.
|
||||||
$this->peopletag->delete();
|
$this->peopletag->delete();
|
||||||
// send home.
|
// send home.
|
||||||
common_redirect(common_local_url('all',
|
common_redirect(common_local_url('all', array('nickname' => $this->tagger->nickname)), 303);
|
||||||
array('nickname' => $this->tagger->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tag != $orig->tag) {
|
if ($tag != $orig->tag) {
|
||||||
|
@ -351,7 +351,6 @@ class EmailsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error updating e-mail preferences.
|
// TRANS: Server error thrown on database error updating e-mail preferences.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->query('COMMIT');
|
$user->query('COMMIT');
|
||||||
@ -419,7 +418,6 @@ class EmailsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($confirm, 'INSERT', __FILE__);
|
common_log_db_error($confirm, 'INSERT', __FILE__);
|
||||||
// TRANS: Server error thrown on database error adding e-mail confirmation code.
|
// TRANS: Server error thrown on database error adding e-mail confirmation code.
|
||||||
$this->serverError(_('Could not insert confirmation code.'));
|
$this->serverError(_('Could not insert confirmation code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mail_confirm_address($user, $confirm->code, $user->nickname, $email);
|
mail_confirm_address($user, $confirm->code, $user->nickname, $email);
|
||||||
@ -463,7 +461,6 @@ class EmailsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($confirm, 'DELETE', __FILE__);
|
common_log_db_error($confirm, 'DELETE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error canceling e-mail address confirmation.
|
// TRANS: Server error thrown on database error canceling e-mail address confirmation.
|
||||||
$this->serverError(_('Could not delete email confirmation.'));
|
$this->serverError(_('Could not delete email confirmation.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TRANS: Message given after successfully canceling e-mail address confirmation.
|
// TRANS: Message given after successfully canceling e-mail address confirmation.
|
||||||
@ -502,7 +499,6 @@ class EmailsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error removing a registered e-mail address.
|
// TRANS: Server error thrown on database error removing a registered e-mail address.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$user->query('COMMIT');
|
$user->query('COMMIT');
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ class FavoritesrssAction extends Rss10Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist.
|
// TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
$this->notices = $this->getNotices($this->limit);
|
$this->notices = $this->getNotices($this->limit);
|
||||||
return true;
|
return true;
|
||||||
|
@ -40,7 +40,6 @@ class FoafAction extends Action
|
|||||||
if (empty($nickname_arg)) {
|
if (empty($nickname_arg)) {
|
||||||
// TRANS: Client error displayed when requesting Friends of a Friend feed without providing a user nickname.
|
// TRANS: Client error displayed when requesting Friends of a Friend feed without providing a user nickname.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->nickname = common_canonical_nickname($nickname_arg);
|
$this->nickname = common_canonical_nickname($nickname_arg);
|
||||||
@ -51,7 +50,6 @@ class FoafAction extends Action
|
|||||||
common_redirect(common_local_url('foaf',
|
common_redirect(common_local_url('foaf',
|
||||||
array('nickname' => $this->nickname)),
|
array('nickname' => $this->nickname)),
|
||||||
301);
|
301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('nickname', $this->nickname);
|
$this->user = User::getKV('nickname', $this->nickname);
|
||||||
@ -59,7 +57,6 @@ class FoafAction extends Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when requesting Friends of a Friend feed for an object that is not a user.
|
// TRANS: Client error displayed when requesting Friends of a Friend feed for an object that is not a user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $this->user->getProfile();
|
$this->profile = $this->user->getProfile();
|
||||||
@ -67,7 +64,6 @@ class FoafAction extends Action
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'), 500);
|
$this->serverError(_('User has no profile.'), 500);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -44,7 +44,6 @@ class FoafGroupAction extends Action
|
|||||||
if (empty($nickname_arg)) {
|
if (empty($nickname_arg)) {
|
||||||
// TRANS: Client error displayed when requesting Friends of a Friend feed without providing a group nickname.
|
// TRANS: Client error displayed when requesting Friends of a Friend feed without providing a group nickname.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->nickname = common_canonical_nickname($nickname_arg);
|
$this->nickname = common_canonical_nickname($nickname_arg);
|
||||||
@ -63,7 +62,6 @@ class FoafGroupAction extends Action
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when requesting Friends of a Friend feed for a non-local group.
|
// TRANS: Client error displayed when requesting Friends of a Friend feed for a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
@ -71,7 +69,6 @@ class FoafGroupAction extends Action
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when requesting Friends of a Friend feed for a nickname that is not a group.
|
// TRANS: Client error displayed when requesting Friends of a Friend feed for a nickname that is not a group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
common_set_returnto($this->selfUrl());
|
common_set_returnto($this->selfUrl());
|
||||||
|
@ -71,12 +71,10 @@ class GetfileAction extends Action
|
|||||||
if (empty($path) or !file_exists($path)) {
|
if (empty($path) or !file_exists($path)) {
|
||||||
// TRANS: Client error displayed when requesting a non-existent file.
|
// TRANS: Client error displayed when requesting a non-existent file.
|
||||||
$this->clientError(_('No such file.'), 404);
|
$this->clientError(_('No such file.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if (!is_readable($path)) {
|
if (!is_readable($path)) {
|
||||||
// TRANS: Client error displayed when requesting a file without having read access to it.
|
// TRANS: Client error displayed when requesting a file without having read access to it.
|
||||||
$this->clientError(_('Cannot read file.'), 403);
|
$this->clientError(_('Cannot read file.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
|
@ -59,12 +59,10 @@ class GrantRoleAction extends ProfileFormAction
|
|||||||
if (!Profile_role::isValid($this->role)) {
|
if (!Profile_role::isValid($this->role)) {
|
||||||
// TRANS: Client error displayed when trying to assign an invalid role to a user.
|
// TRANS: Client error displayed when trying to assign an invalid role to a user.
|
||||||
$this->clientError(_('Invalid role.'));
|
$this->clientError(_('Invalid role.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if (!Profile_role::isSettable($this->role)) {
|
if (!Profile_role::isSettable($this->role)) {
|
||||||
// TRANS: Client error displayed when trying to assign an reserved role to a user.
|
// TRANS: Client error displayed when trying to assign an reserved role to a user.
|
||||||
$this->clientError(_('This role is reserved and cannot be set.'));
|
$this->clientError(_('This role is reserved and cannot be set.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -74,7 +72,6 @@ class GrantRoleAction extends ProfileFormAction
|
|||||||
if (!$cur->hasRight(Right::GRANTROLE)) {
|
if (!$cur->hasRight(Right::GRANTROLE)) {
|
||||||
// TRANS: Client error displayed when trying to assign a role to a user while not being allowed to set roles.
|
// TRANS: Client error displayed when trying to assign a role to a user while not being allowed to set roles.
|
||||||
$this->clientError(_('You cannot grant user roles on this site.'));
|
$this->clientError(_('You cannot grant user roles on this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!empty($this->profile)); // checked by parent
|
assert(!empty($this->profile)); // checked by parent
|
||||||
@ -82,7 +79,6 @@ class GrantRoleAction extends ProfileFormAction
|
|||||||
if ($this->profile->hasRole($this->role)) {
|
if ($this->profile->hasRole($this->role)) {
|
||||||
// TRANS: Client error displayed when trying to assign a role to a user that already has that role.
|
// TRANS: Client error displayed when trying to assign a role to a user that already has that role.
|
||||||
$this->clientError(_('User already has this role.'));
|
$this->clientError(_('User already has this role.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -205,7 +205,6 @@ class GroupblockAction extends RedirectingAction
|
|||||||
if (empty($block)) {
|
if (empty($block)) {
|
||||||
// TRANS: Server error displayed when trying to block a user from a group fails because of an application error.
|
// TRANS: Server error displayed when trying to block a user from a group fails because of an application error.
|
||||||
$this->serverError(_("Database error blocking user from group."));
|
$this->serverError(_("Database error blocking user from group."));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->returnToPrevious();
|
$this->returnToPrevious();
|
||||||
|
@ -71,7 +71,6 @@ class GroupbyidAction extends Action
|
|||||||
if (!$id) {
|
if (!$id) {
|
||||||
// TRANS: Client error displayed referring to a group's permalink without providing a group ID.
|
// TRANS: Client error displayed referring to a group's permalink without providing a group ID.
|
||||||
$this->clientError(_('No ID.'));
|
$this->clientError(_('No ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
common_debug("Got ID $id");
|
common_debug("Got ID $id");
|
||||||
@ -81,7 +80,6 @@ class GroupbyidAction extends Action
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed referring to a group's permalink for a non-existing group ID.
|
// TRANS: Client error displayed referring to a group's permalink for a non-existing group ID.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -67,7 +67,6 @@ class GrouplogoAction extends GroupAction
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to create a group while not logged in.
|
// TRANS: Client error displayed when trying to create a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to create a group.'));
|
$this->clientError(_('You must be logged in to create a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -78,13 +77,11 @@ class GrouplogoAction extends GroupAction
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('grouplogo', $args), 301);
|
common_redirect(common_local_url('grouplogo', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
// TRANS: Client error displayed when trying to change group logo settings without providing a nickname.
|
// TRANS: Client error displayed when trying to change group logo settings without providing a nickname.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupid = $this->trimmed('groupid');
|
$groupid = $this->trimmed('groupid');
|
||||||
@ -101,7 +98,6 @@ class GrouplogoAction extends GroupAction
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when trying to update logo settings for a non-existing group.
|
// TRANS: Client error displayed when trying to update logo settings for a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -109,7 +105,6 @@ class GrouplogoAction extends GroupAction
|
|||||||
if (!$cur->isAdmin($this->group)) {
|
if (!$cur->isAdmin($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to change group logo settings while not being a group admin.
|
// TRANS: Client error displayed when trying to change group logo settings while not being a group admin.
|
||||||
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
$this->clientError(_('You must be an admin to edit the group.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -182,7 +177,6 @@ class GrouplogoAction extends GroupAction
|
|||||||
common_log_db_error($user, 'SELECT', __FILE__);
|
common_log_db_error($user, 'SELECT', __FILE__);
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$original = $this->group->original_logo;
|
$original = $this->group->original_logo;
|
||||||
@ -389,7 +383,6 @@ class GrouplogoAction extends GroupAction
|
|||||||
if (!$filedata) {
|
if (!$filedata) {
|
||||||
// TRANS: Server error displayed trying to crop an uploaded group logo that is no longer present.
|
// TRANS: Server error displayed trying to crop an uploaded group logo that is no longer present.
|
||||||
$this->serverError(_('Lost our file data.'));
|
$this->serverError(_('Lost our file data.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If image is not being cropped assume pos & dimentions of original
|
// If image is not being cropped assume pos & dimentions of original
|
||||||
|
@ -69,13 +69,11 @@ class GroupqueueAction extends GroupAction
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('groupqueue', $args), 301);
|
common_redirect(common_local_url('groupqueue', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
// TRANS: Client error displayed when trying to view group members without providing a group nickname.
|
// TRANS: Client error displayed when trying to view group members without providing a group nickname.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -83,7 +81,6 @@ class GroupqueueAction extends GroupAction
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when trying to view group members for a non-existing group.
|
// TRANS: Client error displayed when trying to view group members for a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
@ -91,14 +88,12 @@ class GroupqueueAction extends GroupAction
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when trying to view group members for an object that is not a group.
|
// TRANS: Client error displayed when trying to view group members for an object that is not a group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
if (!$cur || !$cur->isAdmin($this->group)) {
|
if (!$cur || !$cur->isAdmin($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to approve group applicants without being a group administrator.
|
// TRANS: Client error displayed when trying to approve group applicants without being a group administrator.
|
||||||
$this->clientError(_('Only the group admin may approve users.'));
|
$this->clientError(_('Only the group admin may approve users.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -81,13 +81,11 @@ class groupRssAction extends Rss10Action
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('showgroup', $args), 301);
|
common_redirect(common_local_url('showgroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
// TRANS: Client error displayed when requesting a group RSS feed without providing a group nickname.
|
// TRANS: Client error displayed when requesting a group RSS feed without providing a group nickname.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -95,7 +93,6 @@ class groupRssAction extends Rss10Action
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when requesting a group RSS feed for group that does not exist.
|
// TRANS: Client error displayed when requesting a group RSS feed for group that does not exist.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
@ -103,7 +100,6 @@ class groupRssAction extends Rss10Action
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group.
|
// TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notices = $this->getNotices($this->limit);
|
$this->notices = $this->getNotices($this->limit);
|
||||||
|
@ -58,48 +58,40 @@ class GroupunblockAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (empty($token) || $token != common_session_token()) {
|
if (empty($token) || $token != common_session_token()) {
|
||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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;
|
|
||||||
}
|
}
|
||||||
$id = $this->trimmed('unblockto');
|
$id = $this->trimmed('unblockto');
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a user from a group without providing a profile.
|
// TRANS: Client error displayed when trying to unblock a user from a group without providing a profile.
|
||||||
$this->clientError(_('No profile specified.'));
|
$this->clientError(_('No profile specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$this->profile = Profile::getKV('id', $id);
|
$this->profile = Profile::getKV('id', $id);
|
||||||
if (empty($this->profile)) {
|
if (empty($this->profile)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a user from a group without providing an existing profile.
|
// TRANS: Client error displayed when trying to unblock a user from a group without providing an existing profile.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$group_id = $this->trimmed('unblockgroup');
|
$group_id = $this->trimmed('unblockgroup');
|
||||||
if (empty($group_id)) {
|
if (empty($group_id)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a user from a group without providing a group.
|
// TRANS: Client error displayed when trying to unblock a user from a group without providing a group.
|
||||||
$this->clientError(_('No group specified.'));
|
$this->clientError(_('No group specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$this->group = User_group::getKV('id', $group_id);
|
$this->group = User_group::getKV('id', $group_id);
|
||||||
if (empty($this->group)) {
|
if (empty($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a user from a non-existing group.
|
// TRANS: Client error displayed when trying to unblock a user from a non-existing group.
|
||||||
$this->clientError(_('No such group.'));
|
$this->clientError(_('No such group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
if (!$user->isAdmin($this->group)) {
|
if (!$user->isAdmin($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a user from a group without being an administrator for the group.
|
// TRANS: Client error displayed when trying to unblock a user from a group without being an administrator for the group.
|
||||||
$this->clientError(_('Only an admin can unblock group members.'), 401);
|
$this->clientError(_('Only an admin can unblock group members.'), 401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if (!Group_block::isBlocked($this->group, $this->profile)) {
|
if (!Group_block::isBlocked($this->group, $this->profile)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a non-blocked user from a group.
|
// TRANS: Client error displayed when trying to unblock a non-blocked user from a group.
|
||||||
$this->clientError(_('User is not blocked from group.'));
|
$this->clientError(_('User is not blocked from group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -131,7 +123,6 @@ class GroupunblockAction extends Action
|
|||||||
if (!$result) {
|
if (!$result) {
|
||||||
// TRANS: Server error displayed when unblocking a user from a group fails because of an unknown error.
|
// TRANS: Server error displayed when unblocking a user from a group fails because of an unknown error.
|
||||||
$this->serverError(_('Error removing the block.'));
|
$this->serverError(_('Error removing the block.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->args as $k => $v) {
|
foreach ($this->args as $k => $v) {
|
||||||
@ -145,9 +136,7 @@ class GroupunblockAction extends Action
|
|||||||
if ($action) {
|
if ($action) {
|
||||||
common_redirect(common_local_url($action, $args), 303);
|
common_redirect(common_local_url($action, $args), 303);
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('blockedfromgroup',
|
common_redirect(common_local_url('blockedfromgroup', array('nickname' => $this->group->nickname)), 303);
|
||||||
array('nickname' => $this->group->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,6 @@ class ImsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error updating IM preferences.
|
// TRANS: Server error thrown on database error updating IM preferences.
|
||||||
$this->serverError(_('Could not update IM preferences.'));
|
$this->serverError(_('Could not update IM preferences.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}while($user_im_prefs->fetch());
|
}while($user_im_prefs->fetch());
|
||||||
}
|
}
|
||||||
@ -364,7 +363,6 @@ class ImsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($confirm, 'INSERT', __FILE__);
|
common_log_db_error($confirm, 'INSERT', __FILE__);
|
||||||
// TRANS: Server error thrown on database error adding Instant Messaging confirmation code.
|
// TRANS: Server error thrown on database error adding Instant Messaging confirmation code.
|
||||||
$this->serverError(_('Could not insert confirmation code.'));
|
$this->serverError(_('Could not insert confirmation code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::handle('SendImConfirmationCode', array($transport, $screenname, $confirm->code, $user));
|
Event::handle('SendImConfirmationCode', array($transport, $screenname, $confirm->code, $user));
|
||||||
@ -407,7 +405,6 @@ class ImsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($confirm, 'DELETE', __FILE__);
|
common_log_db_error($confirm, 'DELETE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error canceling IM address confirmation.
|
// TRANS: Server error thrown on database error canceling IM address confirmation.
|
||||||
$this->serverError(_('Could not delete confirmation.'));
|
$this->serverError(_('Could not delete confirmation.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TRANS: Message given after successfully canceling IM address confirmation.
|
// TRANS: Message given after successfully canceling IM address confirmation.
|
||||||
@ -445,7 +442,6 @@ class ImsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error removing a registered IM address.
|
// TRANS: Server error thrown on database error removing a registered IM address.
|
||||||
$this->serverError(_('Could not update user IM preferences.'));
|
$this->serverError(_('Could not update user IM preferences.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: unsubscribe to the old address
|
// XXX: unsubscribe to the old address
|
||||||
|
@ -57,7 +57,6 @@ class JoingroupAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to join a group while not logged in.
|
// TRANS: Client error displayed when trying to join a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to join a group.'));
|
$this->clientError(_('You must be logged in to join a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -72,7 +71,6 @@ class JoingroupAction extends Action
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('leavegroup', $args), 301);
|
common_redirect(common_local_url('leavegroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -80,20 +78,17 @@ class JoingroupAction extends Action
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when trying to join a non-local group.
|
// TRANS: Client error displayed when trying to join a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when trying to join a group without providing a group name or group ID.
|
// TRANS: Client error displayed when trying to join a group without providing a group name or group ID.
|
||||||
$this->clientError(_('No nickname or ID.'), 404);
|
$this->clientError(_('No nickname or ID.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when trying to join a non-existing group.
|
// TRANS: Client error displayed when trying to join a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -101,13 +96,11 @@ class JoingroupAction extends Action
|
|||||||
if ($cur->isMember($this->group)) {
|
if ($cur->isMember($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to join a group while already a member.
|
// TRANS: Client error displayed when trying to join a group while already a member.
|
||||||
$this->clientError(_('You are already a member of that group.'), 403);
|
$this->clientError(_('You are already a member of that group.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Group_block::isBlocked($this->group, $cur->getProfile())) {
|
if (Group_block::isBlocked($this->group, $cur->getProfile())) {
|
||||||
// TRANS: Client error displayed when trying to join a group while being blocked form joining it.
|
// TRANS: Client error displayed when trying to join a group while being blocked form joining it.
|
||||||
$this->clientError(_('You have been blocked from that group by the admin.'), 403);
|
$this->clientError(_('You have been blocked from that group by the admin.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -165,9 +158,7 @@ class JoingroupAction extends Action
|
|||||||
$this->elementEnd('body');
|
$this->elementEnd('body');
|
||||||
$this->endHTML();
|
$this->endHTML();
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('groupmembers', array('nickname' =>
|
common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303);
|
||||||
$this->group->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ class LeavegroupAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
// TRANS: Client error displayed when trying to leave a group while not logged in.
|
||||||
$this->clientError(_('You must be logged in to leave a group.'));
|
$this->clientError(_('You must be logged in to leave a group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname_arg = $this->trimmed('nickname');
|
$nickname_arg = $this->trimmed('nickname');
|
||||||
@ -72,7 +71,6 @@ class LeavegroupAction extends Action
|
|||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
$args = array('nickname' => $nickname);
|
$args = array('nickname' => $nickname);
|
||||||
common_redirect(common_local_url('leavegroup', $args), 301);
|
common_redirect(common_local_url('leavegroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -80,20 +78,17 @@ class LeavegroupAction extends Action
|
|||||||
if (!$local) {
|
if (!$local) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-local group.
|
// TRANS: Client error displayed when trying to leave a non-local group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::getKV('id', $local->group_id);
|
$this->group = User_group::getKV('id', $local->group_id);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
|
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
|
||||||
$this->clientError(_('No nickname or ID.'), 404);
|
$this->clientError(_('No nickname or ID.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed when trying to leave a non-existing group.
|
// TRANS: Client error displayed when trying to leave a non-existing group.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -101,7 +96,6 @@ class LeavegroupAction extends Action
|
|||||||
if (!$cur->isMember($this->group)) {
|
if (!$cur->isMember($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to join a group while already a member.
|
// TRANS: Client error displayed when trying to join a group while already a member.
|
||||||
$this->clientError(_('You are not a member of that group.'), 403);
|
$this->clientError(_('You are not a member of that group.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -147,9 +141,7 @@ class LeavegroupAction extends Action
|
|||||||
$this->elementEnd('body');
|
$this->elementEnd('body');
|
||||||
$this->endHTML();
|
$this->endHTML();
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('groupmembers', array('nickname' =>
|
common_redirect(common_local_url('groupmembers', array('nickname' => $this->group->nickname)), 303);
|
||||||
$this->group->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,44 +60,37 @@ class MakeadminAction extends RedirectingAction
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (empty($token) || $token != common_session_token()) {
|
if (empty($token) || $token != common_session_token()) {
|
||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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;
|
|
||||||
}
|
}
|
||||||
$id = $this->trimmed('profileid');
|
$id = $this->trimmed('profileid');
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
// TRANS: Client error displayed when not providing a profile ID on the Make Admin page.
|
// TRANS: Client error displayed when not providing a profile ID on the Make Admin page.
|
||||||
$this->clientError(_('No profile specified.'));
|
$this->clientError(_('No profile specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$this->profile = Profile::getKV('id', $id);
|
$this->profile = Profile::getKV('id', $id);
|
||||||
if (empty($this->profile)) {
|
if (empty($this->profile)) {
|
||||||
// TRANS: Client error displayed when specifying an invalid profile ID on the Make Admin page.
|
// TRANS: Client error displayed when specifying an invalid profile ID on the Make Admin page.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$group_id = $this->trimmed('groupid');
|
$group_id = $this->trimmed('groupid');
|
||||||
if (empty($group_id)) {
|
if (empty($group_id)) {
|
||||||
// TRANS: Client error displayed when not providing a group ID on the Make Admin page.
|
// TRANS: Client error displayed when not providing a group ID on the Make Admin page.
|
||||||
$this->clientError(_('No group specified.'));
|
$this->clientError(_('No group specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$this->group = User_group::getKV('id', $group_id);
|
$this->group = User_group::getKV('id', $group_id);
|
||||||
if (empty($this->group)) {
|
if (empty($this->group)) {
|
||||||
// TRANS: Client error displayed when providing an invalid group ID on the Make Admin page.
|
// TRANS: Client error displayed when providing an invalid group ID on the Make Admin page.
|
||||||
$this->clientError(_('No such group.'));
|
$this->clientError(_('No such group.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
if (!$user->isAdmin($this->group) &&
|
if (!$user->isAdmin($this->group) &&
|
||||||
!$user->hasRight(Right::MAKEGROUPADMIN)) {
|
!$user->hasRight(Right::MAKEGROUPADMIN)) {
|
||||||
// TRANS: Client error displayed when trying to make another user admin on the Make Admin page while not an admin.
|
// TRANS: Client error displayed when trying to make another user admin on the Make Admin page while not an admin.
|
||||||
$this->clientError(_('Only an admin can make another user an admin.'), 401);
|
$this->clientError(_('Only an admin can make another user an admin.'), 401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if ($this->profile->isAdmin($this->group)) {
|
if ($this->profile->isAdmin($this->group)) {
|
||||||
// TRANS: Client error displayed when trying to make another user admin on the Make Admin page who already is admin.
|
// TRANS: Client error displayed when trying to make another user admin on the Make Admin page who already is admin.
|
||||||
@ -106,7 +99,6 @@ class MakeadminAction extends RedirectingAction
|
|||||||
$this->profile->getBestName(),
|
$this->profile->getBestName(),
|
||||||
$this->group->getBestName()),
|
$this->group->getBestName()),
|
||||||
401);
|
401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ class MicrosummaryAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Client error displayed trying to make a micro summary without providing a valid user.
|
// TRANS: Client error displayed trying to make a micro summary without providing a valid user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$notice = $user->getCurrentNotice();
|
$notice = $user->getCurrentNotice();
|
||||||
|
@ -62,7 +62,6 @@ class NudgeAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -71,7 +70,6 @@ class NudgeAction extends Action
|
|||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||||
common_redirect(common_local_url('showstream',
|
common_redirect(common_local_url('showstream',
|
||||||
array('nickname' => $other->nickname)));
|
array('nickname' => $other->nickname)));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
@ -80,13 +78,11 @@ class NudgeAction extends Action
|
|||||||
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.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$other->email || !$other->emailnotifynudge) {
|
if (!$other->email || !$other->emailnotifynudge) {
|
||||||
// TRANS: Client error displayed trying to nudge a user that cannot be nudged.
|
// TRANS: Client error displayed trying to nudge a user that cannot be nudged.
|
||||||
$this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set their email address yet.'));
|
$this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set their email address yet.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notify($user, $other);
|
$this->notify($user, $other);
|
||||||
|
@ -57,7 +57,6 @@ class OauthappssettingsAction extends SettingsAction
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Message displayed to an anonymous user trying to view OAuth application list.
|
// TRANS: Message displayed to an anonymous user trying to view OAuth application list.
|
||||||
$this->clientError(_('You must be logged in to list your applications.'));
|
$this->clientError(_('You must be logged in to list your applications.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -142,7 +142,6 @@ class OauthconnectionssettingsAction extends SettingsAction
|
|||||||
} else {
|
} else {
|
||||||
// TRANS: Client error when submitting a form with unexpected information.
|
// TRANS: Client error when submitting a form with unexpected information.
|
||||||
$this->clientError(_('Unexpected form submission.'), 401);
|
$this->clientError(_('Unexpected form submission.'), 401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +162,6 @@ class OauthconnectionssettingsAction extends SettingsAction
|
|||||||
if (empty($appUser)) {
|
if (empty($appUser)) {
|
||||||
// TRANS: Client error when trying to revoke access for an application while not being a user of it.
|
// TRANS: Client error when trying to revoke access for an application while not being a user of it.
|
||||||
$this->clientError(_('You are not a user of that application.'), 401);
|
$this->clientError(_('You are not a user of that application.'), 401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$app = Oauth_application::getKV('id', $appUser->application_id);
|
$app = Oauth_application::getKV('id', $appUser->application_id);
|
||||||
@ -178,7 +176,6 @@ class OauthconnectionssettingsAction extends SettingsAction
|
|||||||
// TRANS: Client error when revoking access has failed for some reason.
|
// TRANS: Client error when revoking access has failed for some reason.
|
||||||
// TRANS: %s is the application ID revoking access failed for.
|
// TRANS: %s is the application ID revoking access failed for.
|
||||||
$this->clientError(sprintf(_('Unable to revoke access for application: %s.'), $app->id));
|
$this->clientError(sprintf(_('Unable to revoke access for application: %s.'), $app->id));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg = 'API OAuth - user %s (id: %d) revoked access token %s for app id %d';
|
$msg = 'API OAuth - user %s (id: %d) revoked access token %s for app id %d';
|
||||||
|
@ -60,7 +60,6 @@ class OtpAction extends Action
|
|||||||
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.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->trimmed('user_id');
|
$id = $this->trimmed('user_id');
|
||||||
@ -68,7 +67,6 @@ class OtpAction extends Action
|
|||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
// TRANS: Client error displayed trying to use "one time password login" without specifying a user.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('id', $id);
|
$this->user = User::getKV('id', $id);
|
||||||
@ -76,7 +74,6 @@ class OtpAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Client error displayed trying to use "one time password login" without using an existing 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->token = $this->trimmed('token');
|
$this->token = $this->trimmed('token');
|
||||||
@ -84,7 +81,6 @@ class OtpAction extends Action
|
|||||||
if (empty($this->token)) {
|
if (empty($this->token)) {
|
||||||
// TRANS: Client error displayed trying to use "one time password login" without specifying a login 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lt = Login_token::getKV('user_id', $id);
|
$this->lt = Login_token::getKV('user_id', $id);
|
||||||
@ -92,13 +88,11 @@ class OtpAction extends Action
|
|||||||
if (empty($this->lt)) {
|
if (empty($this->lt)) {
|
||||||
// TRANS: Client error displayed trying to use "one time password login" without requesting a login token.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->lt->modified > time() + Login_token::TIMEOUT) {
|
if ($this->lt->modified > time() + Login_token::TIMEOUT) {
|
||||||
@ -108,7 +102,6 @@ class OtpAction extends Action
|
|||||||
$this->lt = null;
|
$this->lt = null;
|
||||||
// TRANS: Client error displayed trying to use "one time password login" while specifying an expired login token.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rememberme = $this->boolean('rememberme');
|
$this->rememberme = $this->boolean('rememberme');
|
||||||
@ -125,7 +118,6 @@ class OtpAction extends Action
|
|||||||
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".
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're now logged in; disable the lt
|
// We're now logged in; disable the lt
|
||||||
|
@ -199,7 +199,6 @@ class PasswordsettingsAction extends SettingsAction
|
|||||||
// TRANS: Server error displayed on page where to change password when password change
|
// TRANS: Server error displayed on page where to change password when password change
|
||||||
// TRANS: could not be made because of a server error.
|
// TRANS: could not be made because of a server error.
|
||||||
$this->serverError(_('Cannot save new password.'));
|
$this->serverError(_('Cannot save new password.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
Event::handle('EndChangePassword', array($user));
|
Event::handle('EndChangePassword', array($user));
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,6 @@ class PeopletagAction extends Action
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletag', $args), 301);
|
common_redirect(common_local_url('peopletag', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$this->tag = $tag;
|
$this->tag = $tag;
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ class PeopletagautocompleteAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
@ -66,7 +65,6 @@ class PeopletagautocompleteAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile = $this->user->getProfile();
|
$profile = $this->user->getProfile();
|
||||||
|
@ -76,13 +76,11 @@ class PeopletaggedAction extends Action
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletagged', $args), 301);
|
common_redirect(common_local_url('peopletagged', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$tagger) {
|
if (!$tagger) {
|
||||||
// TRANS: Client error displayed when a tagger is expected but not provided.
|
// TRANS: Client error displayed when a tagger is expected but not provided.
|
||||||
$this->clientError(_('No tagger.'), 404);
|
$this->clientError(_('No tagger.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV('nickname', $tagger);
|
$user = User::getKV('nickname', $tagger);
|
||||||
@ -90,7 +88,6 @@ class PeopletaggedAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Client error displayed when referring to non-existing user.
|
// TRANS: Client error displayed when referring to non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = $user->getProfile();
|
$this->tagger = $user->getProfile();
|
||||||
@ -99,7 +96,6 @@ class PeopletaggedAction extends Action
|
|||||||
if (!$this->peopletag) {
|
if (!$this->peopletag) {
|
||||||
// TRANS: Client error displayed when referring to a non-existing list.
|
// TRANS: Client error displayed when referring to a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -92,7 +92,6 @@ class PeopletagsbyuserAction extends Action
|
|||||||
$args['page'] = $this->arg['page'];
|
$args['page'] = $this->arg['page'];
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletagsbyuser', $args), 301);
|
common_redirect(common_local_url('peopletagsbyuser', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('nickname', $nickname);
|
$this->user = User::getKV('nickname', $nickname);
|
||||||
@ -100,7 +99,6 @@ class PeopletagsbyuserAction extends Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = $this->user->getProfile();
|
$this->tagger = $this->user->getProfile();
|
||||||
@ -108,7 +106,6 @@ class PeopletagsbyuserAction extends Action
|
|||||||
if (!$this->tagger) {
|
if (!$this->tagger) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
@ -146,7 +143,6 @@ class PeopletagsbyuserAction extends Action
|
|||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303);
|
common_redirect(common_local_url('peopletagsbyuser', $this->getSelfUrlArgs()), 303);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
@ -74,7 +74,6 @@ class PeopletagsforuserAction extends Action
|
|||||||
$args['page'] = $this->arg['page'];
|
$args['page'] = $this->arg['page'];
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletagsforuser', $args), 301);
|
common_redirect(common_local_url('peopletagsforuser', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('nickname', $nickname);
|
$this->user = User::getKV('nickname', $nickname);
|
||||||
@ -82,7 +81,6 @@ class PeopletagsforuserAction extends Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagged = $this->user->getProfile();
|
$this->tagged = $this->user->getProfile();
|
||||||
@ -90,7 +88,6 @@ class PeopletagsforuserAction extends Action
|
|||||||
if (!$this->tagged) {
|
if (!$this->tagged) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
@ -76,13 +76,11 @@ class PeopletagsubscribersAction extends Action
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletagged', $args), 301);
|
common_redirect(common_local_url('peopletagged', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$tagger) {
|
if (!$tagger) {
|
||||||
// TRANS: Client error displayed when a tagger is expected but not provided.
|
// TRANS: Client error displayed when a tagger is expected but not provided.
|
||||||
$this->clientError(_('No tagger.'), 404);
|
$this->clientError(_('No tagger.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV('nickname', $tagger);
|
$user = User::getKV('nickname', $tagger);
|
||||||
@ -90,7 +88,6 @@ class PeopletagsubscribersAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = $user->getProfile();
|
$this->tagger = $user->getProfile();
|
||||||
@ -99,7 +96,6 @@ class PeopletagsubscribersAction extends Action
|
|||||||
if (!$this->peopletag) {
|
if (!$this->peopletag) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -76,7 +76,6 @@ class PeopletagsubscriptionsAction extends Action
|
|||||||
$args['page'] = $this->arg['page'];
|
$args['page'] = $this->arg['page'];
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletagsbyuser', $args), 301);
|
common_redirect(common_local_url('peopletagsbyuser', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV('nickname', $nickname);
|
$user = User::getKV('nickname', $nickname);
|
||||||
@ -84,7 +83,6 @@ class PeopletagsubscriptionsAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $user->getProfile();
|
$this->profile = $user->getProfile();
|
||||||
@ -92,7 +90,6 @@ class PeopletagsubscriptionsAction extends Action
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
@ -76,7 +76,6 @@ class PluginEnableAction extends Action
|
|||||||
// TRANS: Client error displayed when trying to use another method than POST.
|
// TRANS: Client error displayed when trying to use another method than POST.
|
||||||
// TRANS: Do not translate POST.
|
// TRANS: Do not translate POST.
|
||||||
$this->clientError(_('This action only accepts POST requests.'));
|
$this->clientError(_('This action only accepts POST requests.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
@ -87,7 +86,6 @@ class PluginEnableAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only for logged-in users
|
// Only for logged-in users
|
||||||
@ -97,13 +95,11 @@ class PluginEnableAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AdminPanelAction::canAdmin('plugins')) {
|
if (!AdminPanelAction::canAdmin('plugins')) {
|
||||||
// TRANS: Client error displayed when trying to enable or disable a plugin without access rights.
|
// TRANS: Client error displayed when trying to enable or disable a plugin without access rights.
|
||||||
$this->clientError(_('You cannot administer plugins.'));
|
$this->clientError(_('You cannot administer plugins.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->plugin = $this->arg('plugin');
|
$this->plugin = $this->arg('plugin');
|
||||||
@ -111,7 +107,6 @@ class PluginEnableAction extends Action
|
|||||||
if (!array_key_exists($this->plugin, $defaultPlugins)) {
|
if (!array_key_exists($this->plugin, $defaultPlugins)) {
|
||||||
// TRANS: Client error displayed when trying to enable or disable a non-existing plugin.
|
// TRANS: Client error displayed when trying to enable or disable a non-existing plugin.
|
||||||
$this->clientError(_('No such plugin.'));
|
$this->clientError(_('No such plugin.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -80,7 +80,6 @@ class ProfilecompletionAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only for logged-in users
|
// Only for logged-in users
|
||||||
@ -90,7 +89,6 @@ class ProfilecompletionAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->arg('peopletag_id');
|
$id = $this->arg('peopletag_id');
|
||||||
@ -99,7 +97,6 @@ class ProfilecompletionAction extends Action
|
|||||||
if (empty($this->peopletag)) {
|
if (empty($this->peopletag)) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'));
|
$this->clientError(_('No such list.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$field = $this->arg('field');
|
$field = $this->arg('field');
|
||||||
@ -107,7 +104,6 @@ class ProfilecompletionAction extends Action
|
|||||||
// TRANS: Client error displayed when trying to add an unindentified field to profile.
|
// TRANS: Client error displayed when trying to add an unindentified field to profile.
|
||||||
// TRANS: %s is a field name.
|
// TRANS: %s is a field name.
|
||||||
$this->clientError(sprintf(_('Unidentified field %s.'), htmlspecialchars($field)), 404);
|
$this->clientError(sprintf(_('Unidentified field %s.'), htmlspecialchars($field)), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$this->field = $field;
|
$this->field = $field;
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ class ProfiletagbyidAction extends Action
|
|||||||
if (!$id) {
|
if (!$id) {
|
||||||
// TRANS: Client error displayed trying to perform an action without providing an ID.
|
// TRANS: Client error displayed trying to perform an action without providing an ID.
|
||||||
$this->clientError(_('No ID.'));
|
$this->clientError(_('No ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
common_debug("Peopletag id $id by user id $tagger_id");
|
common_debug("Peopletag id $id by user id $tagger_id");
|
||||||
@ -65,7 +64,6 @@ class ProfiletagbyidAction extends Action
|
|||||||
if (!$this->peopletag) {
|
if (!$this->peopletag) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV('id', $tagger_id);
|
$user = User::getKV('id', $tagger_id);
|
||||||
|
@ -102,7 +102,6 @@ class PublicAction extends Action
|
|||||||
if (!$this->notice) {
|
if (!$this->notice) {
|
||||||
// TRANS: Server error displayed when a public timeline cannot be retrieved.
|
// TRANS: Server error displayed when a public timeline cannot be retrieved.
|
||||||
$this->serverError(_('Could not retrieve public timeline.'));
|
$this->serverError(_('Could not retrieve public timeline.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->page > 1 && $this->notice->N == 0){
|
if($this->page > 1 && $this->notice->N == 0){
|
||||||
|
@ -35,7 +35,6 @@ class RecoverpasswordAction extends Action
|
|||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
// TRANS: Client error displayed trying to recover password while already logged in.
|
// TRANS: Client error displayed trying to recover password while already logged in.
|
||||||
$this->clientError(_('You are already logged in!'));
|
$this->clientError(_('You are already logged in!'));
|
||||||
return;
|
|
||||||
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
if ($this->arg('recover')) {
|
if ($this->arg('recover')) {
|
||||||
$this->recoverPassword();
|
$this->recoverPassword();
|
||||||
@ -62,12 +61,10 @@ class RecoverpasswordAction extends Action
|
|||||||
if (!$confirm) {
|
if (!$confirm) {
|
||||||
// TRANS: Client error displayed when password recovery code is not correct.
|
// TRANS: Client error displayed when password recovery code is not correct.
|
||||||
$this->clientError(_('No such recovery code.'));
|
$this->clientError(_('No such recovery code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if ($confirm->address_type != 'recover') {
|
if ($confirm->address_type != 'recover') {
|
||||||
// TRANS: Client error displayed when no proper password recovery code was submitted.
|
// TRANS: Client error displayed when no proper password recovery code was submitted.
|
||||||
$this->clientError(_('Not a recovery code.'));
|
$this->clientError(_('Not a recovery code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV($confirm->user_id);
|
$user = User::getKV($confirm->user_id);
|
||||||
@ -75,7 +72,6 @@ class RecoverpasswordAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Server error displayed trying to recover password without providing a user.
|
// TRANS: Server error displayed trying to recover password without providing a user.
|
||||||
$this->serverError(_('Recovery code for unknown user.'));
|
$this->serverError(_('Recovery code for unknown user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$touched = strtotime($confirm->modified);
|
$touched = strtotime($confirm->modified);
|
||||||
@ -89,7 +85,6 @@ class RecoverpasswordAction extends Action
|
|||||||
common_log_db_error($confirm, 'DELETE', __FILE__);
|
common_log_db_error($confirm, 'DELETE', __FILE__);
|
||||||
// TRANS: Server error displayed removing a password recovery code from the database.
|
// TRANS: Server error displayed removing a password recovery code from the database.
|
||||||
$this->serverError(_('Error with confirmation code.'));
|
$this->serverError(_('Error with confirmation code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// These should be reaped, but for now we just check mod time
|
// These should be reaped, but for now we just check mod time
|
||||||
@ -102,7 +97,6 @@ class RecoverpasswordAction extends Action
|
|||||||
// TRANS: Client error displayed trying to recover password with too old a recovery code.
|
// TRANS: Client error displayed trying to recover password with too old a recovery code.
|
||||||
$this->clientError(_('This confirmation code is too old. ' .
|
$this->clientError(_('This confirmation code is too old. ' .
|
||||||
'Please start again.'));
|
'Please start again.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we used an outstanding confirmation to send the email,
|
// If we used an outstanding confirmation to send the email,
|
||||||
@ -116,7 +110,6 @@ class RecoverpasswordAction extends Action
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed when updating a user's e-mail address in the database fails while recovering a password.
|
// TRANS: Server error displayed when updating a user's e-mail address in the database fails while recovering a password.
|
||||||
$this->serverError(_('Could not update user with confirmed email address.'));
|
$this->serverError(_('Could not update user with confirmed email address.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +303,6 @@ class RecoverpasswordAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Client error displayed when trying to reset as password without providing a user.
|
// TRANS: Client error displayed when trying to reset as password without providing a user.
|
||||||
$this->clientError(_('Unexpected password reset.'));
|
$this->clientError(_('Unexpected password reset.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$newpassword = $this->trimmed('newpassword');
|
$newpassword = $this->trimmed('newpassword');
|
||||||
@ -337,7 +329,6 @@ class RecoverpasswordAction extends Action
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Reset password form validation error message.
|
// TRANS: Reset password form validation error message.
|
||||||
$this->serverError(_('Cannot save new password.'));
|
$this->serverError(_('Cannot save new password.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->clearTempUser();
|
$this->clearTempUser();
|
||||||
@ -345,7 +336,6 @@ class RecoverpasswordAction extends Action
|
|||||||
if (!common_set_user($user->nickname)) {
|
if (!common_set_user($user->nickname)) {
|
||||||
// TRANS: Server error displayed when something does wrong with the user object during password reset.
|
// TRANS: Server error displayed when something does wrong with the user object during password reset.
|
||||||
$this->serverError(_('Error setting user.'));
|
$this->serverError(_('Error setting user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
common_real_login(true);
|
common_real_login(true);
|
||||||
|
@ -93,7 +93,6 @@ class RedirecturlAction extends Action
|
|||||||
function handle($argarray=null)
|
function handle($argarray=null)
|
||||||
{
|
{
|
||||||
common_redirect($this->file->url, 307);
|
common_redirect($this->file->url, 307);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,7 +79,6 @@ class RegisterAction extends Action
|
|||||||
if (common_config('site', 'inviteonly') && empty($this->code)) {
|
if (common_config('site', 'inviteonly') && empty($this->code)) {
|
||||||
// TRANS: Client error displayed when trying to register to an invite-only site without an invitation.
|
// TRANS: Client error displayed when trying to register to an invite-only site without an invitation.
|
||||||
$this->clientError(_('Sorry, only invited people can register.'));
|
$this->clientError(_('Sorry, only invited people can register.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->code)) {
|
if (!empty($this->code)) {
|
||||||
@ -87,7 +86,6 @@ class RegisterAction extends Action
|
|||||||
if (empty($this->invite)) {
|
if (empty($this->invite)) {
|
||||||
// TRANS: Client error displayed when trying to register to an invite-only site without a valid invitation.
|
// TRANS: Client error displayed when trying to register to an invite-only site without a valid invitation.
|
||||||
$this->clientError(_('Sorry, invalid invitation code.'));
|
$this->clientError(_('Sorry, invalid invitation code.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// Store this in case we need it
|
// Store this in case we need it
|
||||||
common_ensure_session();
|
common_ensure_session();
|
||||||
@ -187,7 +185,6 @@ class RegisterAction extends Action
|
|||||||
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
||||||
// TRANS: Client error displayed when trying to register to an invite-only site without an invitation.
|
// TRANS: Client error displayed when trying to register to an invite-only site without an invitation.
|
||||||
$this->clientError(_('Sorry, only invited people can register.'));
|
$this->clientError(_('Sorry, only invited people can register.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Input scrubbing
|
// Input scrubbing
|
||||||
@ -387,7 +384,6 @@ class RegisterAction extends Action
|
|||||||
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
if (common_config('site', 'inviteonly') && !($code && $invite)) {
|
||||||
// TRANS: Client error displayed when trying to register to an invite-only site without an invitation.
|
// TRANS: Client error displayed when trying to register to an invite-only site without an invitation.
|
||||||
$this->clientError(_('Sorry, only invited people can register.'));
|
$this->clientError(_('Sorry, only invited people can register.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->elementStart('form', array('method' => 'post',
|
$this->elementStart('form', array('method' => 'post',
|
||||||
|
@ -78,7 +78,6 @@ class RemovepeopletagAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only for logged-in users
|
// Only for logged-in users
|
||||||
@ -88,7 +87,6 @@ class RemovepeopletagAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Profile to subscribe to
|
// Profile to subscribe to
|
||||||
@ -100,7 +98,6 @@ class RemovepeopletagAction extends Action
|
|||||||
if (empty($this->tagged)) {
|
if (empty($this->tagged)) {
|
||||||
// TRANS: Client error displayed when referring to a non-existing profile.
|
// TRANS: Client error displayed when referring to a non-existing profile.
|
||||||
$this->clientError(_('No such profile.'));
|
$this->clientError(_('No such profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->arg('peopletag_id');
|
$id = $this->arg('peopletag_id');
|
||||||
@ -109,7 +106,6 @@ class RemovepeopletagAction extends Action
|
|||||||
if (empty($this->peopletag)) {
|
if (empty($this->peopletag)) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'));
|
$this->clientError(_('No such list.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -146,7 +142,6 @@ class RemovepeopletagAction extends Action
|
|||||||
'The remote server is probably not responding correctly, ' .
|
'The remote server is probably not responding correctly, ' .
|
||||||
'please try retrying later.'), $this->profile->profileurl));
|
'please try retrying later.'), $this->profile->profileurl));
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if ($this->boolean('ajax')) {
|
if ($this->boolean('ajax')) {
|
||||||
$this->startHTML('text/xml;charset=utf-8');
|
$this->startHTML('text/xml;charset=utf-8');
|
||||||
|
@ -56,7 +56,6 @@ class RepeatAction extends Action
|
|||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
// TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID.
|
// TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID.
|
||||||
$this->clientError(_('No notice specified.'));
|
$this->clientError(_('No notice specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->notice = Notice::getKV('id', $id);
|
$this->notice = Notice::getKV('id', $id);
|
||||||
@ -64,7 +63,6 @@ class RepeatAction extends Action
|
|||||||
if (!($this->notice instanceof Notice)) {
|
if (!($this->notice instanceof Notice)) {
|
||||||
// TRANS: Client error displayed when trying to repeat a non-existing notice.
|
// TRANS: Client error displayed when trying to repeat a non-existing notice.
|
||||||
$this->clientError(_('No notice specified.'));
|
$this->clientError(_('No notice specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$token = $this->trimmed('token-'.$id);
|
$token = $this->trimmed('token-'.$id);
|
||||||
@ -72,7 +70,6 @@ class RepeatAction extends Action
|
|||||||
if (empty($token) || $token != common_session_token()) {
|
if (empty($token) || $token != common_session_token()) {
|
||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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 false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -70,7 +70,6 @@ class RepliesAction extends Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when trying to reply to a non-exsting user.
|
// TRANS: Client error displayed when trying to reply to a non-exsting user.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile = $this->user->getProfile();
|
$profile = $this->user->getProfile();
|
||||||
@ -78,7 +77,6 @@ class RepliesAction extends Action
|
|||||||
if (!$profile) {
|
if (!$profile) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
@ -36,7 +36,6 @@ class RepliesrssAction extends Rss10Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
|
// TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
$this->notices = $this->getNotices($this->limit);
|
$this->notices = $this->getNotices($this->limit);
|
||||||
return true;
|
return true;
|
||||||
|
@ -59,12 +59,10 @@ class RevokeRoleAction extends ProfileFormAction
|
|||||||
if (!Profile_role::isValid($this->role)) {
|
if (!Profile_role::isValid($this->role)) {
|
||||||
// TRANS: Client error displayed when trying to revoke an invalid role.
|
// TRANS: Client error displayed when trying to revoke an invalid role.
|
||||||
$this->clientError(_('Invalid role.'));
|
$this->clientError(_('Invalid role.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if (!Profile_role::isSettable($this->role)) {
|
if (!Profile_role::isSettable($this->role)) {
|
||||||
// TRANS: Client error displayed when trying to revoke a reserved role.
|
// TRANS: Client error displayed when trying to revoke a reserved role.
|
||||||
$this->clientError(_('This role is reserved and cannot be set.'));
|
$this->clientError(_('This role is reserved and cannot be set.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -74,7 +72,6 @@ class RevokeRoleAction extends ProfileFormAction
|
|||||||
if (!$cur->hasRight(Right::REVOKEROLE)) {
|
if (!$cur->hasRight(Right::REVOKEROLE)) {
|
||||||
// TRANS: Client error displayed when trying to revoke a role without having the right to do that.
|
// TRANS: Client error displayed when trying to revoke a role without having the right to do that.
|
||||||
$this->clientError(_('You cannot revoke user roles on this site.'));
|
$this->clientError(_('You cannot revoke user roles on this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!empty($this->profile)); // checked by parent
|
assert(!empty($this->profile)); // checked by parent
|
||||||
@ -82,7 +79,6 @@ class RevokeRoleAction extends ProfileFormAction
|
|||||||
if (!$this->profile->hasRole($this->role)) {
|
if (!$this->profile->hasRole($this->role)) {
|
||||||
// TRANS: Client error displayed when trying to revoke a role that is not set.
|
// TRANS: Client error displayed when trying to revoke a role that is not set.
|
||||||
$this->clientError(_('User does not have this role.'));
|
$this->clientError(_('User does not have this role.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -101,10 +101,7 @@ class RsdAction extends Action
|
|||||||
// Permanent redirect on non-canonical nickname
|
// Permanent redirect on non-canonical nickname
|
||||||
|
|
||||||
if ($nickname_arg != $nickname) {
|
if ($nickname_arg != $nickname) {
|
||||||
common_redirect(common_local_url('rsd',
|
common_redirect(common_local_url('rsd', array('nickname' => $nickname)), 301);
|
||||||
array('nickname' => $nickname)),
|
|
||||||
301);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('nickname', $nickname);
|
$this->user = User::getKV('nickname', $nickname);
|
||||||
@ -112,7 +109,6 @@ class RsdAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Client error.
|
// TRANS: Client error.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,6 @@ class SandboxAction extends ProfileFormAction
|
|||||||
if (!$cur->hasRight(Right::SANDBOXUSER)) {
|
if (!$cur->hasRight(Right::SANDBOXUSER)) {
|
||||||
// TRANS: Client error displayed trying to sandbox users on a site where the feature is not enabled.
|
// TRANS: Client error displayed trying to sandbox users on a site where the feature is not enabled.
|
||||||
$this->clientError(_('You cannot sandbox users on this site.'));
|
$this->clientError(_('You cannot sandbox users on this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!empty($this->profile)); // checked by parent
|
assert(!empty($this->profile)); // checked by parent
|
||||||
@ -70,7 +69,6 @@ class SandboxAction extends ProfileFormAction
|
|||||||
if ($this->profile->isSandboxed()) {
|
if ($this->profile->isSandboxed()) {
|
||||||
// TRANS: Client error displayed trying to sandbox an already sandboxed user.
|
// TRANS: Client error displayed trying to sandbox an already sandboxed user.
|
||||||
$this->clientError(_('User is already sandboxed.'));
|
$this->clientError(_('User is already sandboxed.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -77,13 +77,11 @@ class ShowApplicationAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed trying to display an OAuth application while not logged in.
|
// TRANS: Client error displayed trying to display an OAuth application while not logged in.
|
||||||
$this->clientError(_('You must be logged in to view an application.'));
|
$this->clientError(_('You must be logged in to view an application.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->application)) {
|
if (empty($this->application)) {
|
||||||
// TRANS: Client error displayed trying to display a non-existing OAuth application.
|
// TRANS: Client error displayed trying to display a non-existing OAuth application.
|
||||||
$this->clientError(_('No such application.'), 404);
|
$this->clientError(_('No such application.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
@ -91,7 +89,6 @@ class ShowApplicationAction extends Action
|
|||||||
if ($cur->id != $this->owner->id) {
|
if ($cur->id != $this->owner->id) {
|
||||||
// TRANS: Client error displayed trying to display an OAuth application for which the logged in user is not the owner.
|
// TRANS: Client error displayed trying to display an OAuth application for which the logged in user is not the owner.
|
||||||
$this->clientError(_('You are not the owner of this application.'), 401);
|
$this->clientError(_('You are not the owner of this application.'), 401);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -115,7 +112,6 @@ class ShowApplicationAction extends Action
|
|||||||
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.
|
// 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.'));
|
$this->clientError(_('There was a problem with your session token.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->arg('reset')) {
|
if ($this->arg('reset')) {
|
||||||
|
@ -104,7 +104,6 @@ class ShowfavoritesAction extends Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when trying to display favourite notices for a non-existing user.
|
// TRANS: Client error displayed when trying to display favourite notices for a non-existing user.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = $this->trimmed('page');
|
$this->page = $this->trimmed('page');
|
||||||
@ -132,7 +131,6 @@ class ShowfavoritesAction extends Action
|
|||||||
if (empty($this->notice)) {
|
if (empty($this->notice)) {
|
||||||
// TRANS: Server error displayed when favourite notices could not be retrieved from the database.
|
// TRANS: Server error displayed when favourite notices could not be retrieved from the database.
|
||||||
$this->serverError(_('Could not retrieve favorite notices.'));
|
$this->serverError(_('Could not retrieve favorite notices.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->page > 1 && $this->notice->N == 0){
|
if($this->page > 1 && $this->notice->N == 0){
|
||||||
|
@ -74,7 +74,6 @@ class ShowmessageAction extends Action
|
|||||||
if (!$this->message) {
|
if (!$this->message) {
|
||||||
// TRANS: Client error displayed requesting a single message that does not exist.
|
// TRANS: Client error displayed requesting a single message that does not exist.
|
||||||
$this->clientError(_('No such message.'), 404);
|
$this->clientError(_('No such message.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = common_current_user();
|
$this->user = common_current_user();
|
||||||
|
@ -97,7 +97,6 @@ class ShownoticeAction extends Action
|
|||||||
if (empty($this->profile)) {
|
if (empty($this->profile)) {
|
||||||
// TRANS: Server error displayed trying to show a notice without a connected profile.
|
// TRANS: Server error displayed trying to show a notice without a connected profile.
|
||||||
$this->serverError(_('Notice has no profile.'), 500);
|
$this->serverError(_('Notice has no profile.'), 500);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('id', $this->profile->id);
|
$this->user = User::getKV('id', $this->profile->id);
|
||||||
@ -230,7 +229,6 @@ class ShownoticeAction extends Action
|
|||||||
}
|
}
|
||||||
if ($target && $target != $this->selfUrl()) {
|
if ($target && $target != $this->selfUrl()) {
|
||||||
common_redirect($target, 301);
|
common_redirect($target, 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
@ -61,13 +61,11 @@ class ShowprofiletagAction extends Action
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('showprofiletag', $args), 301);
|
common_redirect(common_local_url('showprofiletag', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$tagger) {
|
if (!$tagger) {
|
||||||
// TRANS: Client error displayed when a tagger is expected but not provided.
|
// TRANS: Client error displayed when a tagger is expected but not provided.
|
||||||
$this->clientError(_('No tagger.'), 404);
|
$this->clientError(_('No tagger.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getKV('nickname', $tagger);
|
$user = User::getKV('nickname', $tagger);
|
||||||
@ -75,7 +73,6 @@ class ShowprofiletagAction extends Action
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = $user->getProfile();
|
$this->tagger = $user->getProfile();
|
||||||
@ -88,7 +85,6 @@ class ShowprofiletagAction extends Action
|
|||||||
if (!$can_see) {
|
if (!$can_see) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
@ -114,7 +110,6 @@ class ShowprofiletagAction extends Action
|
|||||||
if (!$this->peopletag) {
|
if (!$this->peopletag) {
|
||||||
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
// TRANS: Client error displayed trying to perform an action related to a non-existing user.
|
||||||
$this->clientError(_('No such user.'));
|
$this->clientError(_('No such user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
@ -62,7 +62,6 @@ class SilenceAction extends ProfileFormAction
|
|||||||
if (!$cur->hasRight(Right::SILENCEUSER)) {
|
if (!$cur->hasRight(Right::SILENCEUSER)) {
|
||||||
// TRANS: Client error displayed trying to silence a user on a site where the feature is not enabled.
|
// TRANS: Client error displayed trying to silence a user on a site where the feature is not enabled.
|
||||||
$this->clientError(_('You cannot silence users on this site.'));
|
$this->clientError(_('You cannot silence users on this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!empty($this->profile)); // checked by parent
|
assert(!empty($this->profile)); // checked by parent
|
||||||
@ -70,7 +69,6 @@ class SilenceAction extends ProfileFormAction
|
|||||||
if ($this->profile->isSilenced()) {
|
if ($this->profile->isSilenced()) {
|
||||||
// TRANS: Client error displayed trying to silence an already silenced user.
|
// TRANS: Client error displayed trying to silence an already silenced user.
|
||||||
$this->clientError(_('User is already silenced.'));
|
$this->clientError(_('User is already silenced.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -173,7 +173,6 @@ class SiteadminpanelAction extends AdminPanelAction
|
|||||||
!in_array($values['site']['timezone'], DateTimeZone::listIdentifiers())) {
|
!in_array($values['site']['timezone'], DateTimeZone::listIdentifiers())) {
|
||||||
// TRANS: Client error displayed trying to save site settings without a timezone.
|
// TRANS: Client error displayed trying to save site settings without a timezone.
|
||||||
$this->clientError(_('Timezone not selected.'));
|
$this->clientError(_('Timezone not selected.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate language
|
// Validate language
|
||||||
|
@ -299,7 +299,6 @@ class SmssettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error updating SMS preferences.
|
// TRANS: Server error thrown on database error updating SMS preferences.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->query('COMMIT');
|
$user->query('COMMIT');
|
||||||
@ -363,7 +362,6 @@ class SmssettingsAction extends SettingsAction
|
|||||||
common_log_db_error($confirm, 'INSERT', __FILE__);
|
common_log_db_error($confirm, 'INSERT', __FILE__);
|
||||||
// TRANS: Server error thrown on database error adding SMS confirmation code.
|
// TRANS: Server error thrown on database error adding SMS confirmation code.
|
||||||
$this->serverError(_('Could not insert confirmation code.'));
|
$this->serverError(_('Could not insert confirmation code.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$carrier = Sms_carrier::getKV($carrier_id);
|
$carrier = Sms_carrier::getKV($carrier_id);
|
||||||
@ -411,7 +409,6 @@ class SmssettingsAction extends SettingsAction
|
|||||||
common_log_db_error($confirm, 'DELETE', __FILE__);
|
common_log_db_error($confirm, 'DELETE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error canceling SMS phone number confirmation.
|
// TRANS: Server error thrown on database error canceling SMS phone number confirmation.
|
||||||
$this->serverError(_('Could not delete SMS confirmation.'));
|
$this->serverError(_('Could not delete SMS confirmation.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TRANS: Message given after successfully canceling SMS phone number confirmation.
|
// TRANS: Message given after successfully canceling SMS phone number confirmation.
|
||||||
@ -452,7 +449,6 @@ class SmssettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error thrown on database error removing a registered SMS phone number.
|
// TRANS: Server error thrown on database error removing a registered SMS phone number.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$user->query('COMMIT');
|
$user->query('COMMIT');
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ class SubeditAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
@ -40,7 +39,6 @@ class SubeditAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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. '.
|
$this->clientError(_('There was a problem with your session token. '.
|
||||||
'Try again, please.'));
|
'Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->trimmed('profile');
|
$id = $this->trimmed('profile');
|
||||||
@ -48,7 +46,6 @@ class SubeditAction extends Action
|
|||||||
if (!$id) {
|
if (!$id) {
|
||||||
// TRANS: Client error displayed trying a change a subscription without providing a profile.
|
// TRANS: Client error displayed trying a change a subscription without providing a profile.
|
||||||
$this->clientError(_('No profile specified.'));
|
$this->clientError(_('No profile specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = Profile::getKV('id', $id);
|
$this->profile = Profile::getKV('id', $id);
|
||||||
@ -56,7 +53,6 @@ class SubeditAction extends Action
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Client error displayed trying a change a subscription for a non-existant profile ID.
|
// TRANS: Client error displayed trying a change a subscription for a non-existant profile ID.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -74,7 +70,6 @@ class SubeditAction extends Action
|
|||||||
if (!$sub) {
|
if (!$sub) {
|
||||||
// TRANS: Client error displayed trying a change a subscription for a non-subscribed profile.
|
// TRANS: Client error displayed trying a change a subscription for a non-subscribed profile.
|
||||||
$this->clientError(_('You are not subscribed to that profile.'));
|
$this->clientError(_('You are not subscribed to that profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$orig = clone($sub);
|
$orig = clone($sub);
|
||||||
@ -88,12 +83,9 @@ class SubeditAction extends Action
|
|||||||
common_log_db_error($sub, 'UPDATE', __FILE__);
|
common_log_db_error($sub, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed when updating a subscription fails with a database error.
|
// TRANS: Server error displayed when updating a subscription fails with a database error.
|
||||||
$this->serverError(_('Could not save subscription.'));
|
$this->serverError(_('Could not save subscription.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
common_redirect(common_local_url('subscriptions',
|
common_redirect(common_local_url('subscriptions', array('nickname' => $cur->nickname)), 303);
|
||||||
array('nickname' => $cur->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,6 @@ class SubqueueAction extends GalleryAction
|
|||||||
if (!$cur || $cur->id != $this->profile->id) {
|
if (!$cur || $cur->id != $this->profile->id) {
|
||||||
// TRANS: Client error displayed when trying to approve group applicants without being a group administrator.
|
// TRANS: Client error displayed when trying to approve group applicants without being a group administrator.
|
||||||
$this->clientError(_('You may only approve your own pending subscriptions.'));
|
$this->clientError(_('You may only approve your own pending subscriptions.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,6 @@ class SubscribeAction extends Action
|
|||||||
// TRANS: Client error displayed trying to perform any request method other than POST.
|
// TRANS: Client error displayed trying to perform any request method other than POST.
|
||||||
// TRANS: Do not translate POST.
|
// TRANS: Do not translate POST.
|
||||||
$this->clientError(_('This action only accepts POST requests.'));
|
$this->clientError(_('This action only accepts POST requests.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
@ -85,7 +84,6 @@ class SubscribeAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token is not okay.
|
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only for logged-in users
|
// Only for logged-in users
|
||||||
@ -95,7 +93,6 @@ class SubscribeAction extends Action
|
|||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Profile to subscribe to
|
// Profile to subscribe to
|
||||||
@ -107,7 +104,6 @@ class SubscribeAction extends Action
|
|||||||
if (empty($this->other)) {
|
if (empty($this->other)) {
|
||||||
// TRANS: Client error displayed trying to subscribe to a non-existing profile.
|
// 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 true;
|
return true;
|
||||||
|
@ -57,14 +57,12 @@ class SubscribepeopletagAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to perform an action while not logged in.
|
// TRANS: Client error displayed when trying to perform an action while not logged in.
|
||||||
$this->clientError(_('You must be logged in to unsubscribe from a list.'));
|
$this->clientError(_('You must be logged in to unsubscribe from a list.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// Only allow POST requests
|
// Only allow POST requests
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||||
// TRANS: Client error displayed when trying to use another method than POST.
|
// TRANS: Client error displayed when trying to use another method than POST.
|
||||||
$this->clientError(_('This action only accepts POST requests.'));
|
$this->clientError(_('This action only accepts POST requests.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
@ -75,7 +73,6 @@ class SubscribepeopletagAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$tagger_arg = $this->trimmed('tagger');
|
$tagger_arg = $this->trimmed('tagger');
|
||||||
@ -87,13 +84,11 @@ class SubscribepeopletagAction extends Action
|
|||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when trying to perform an action without providing an ID.
|
// TRANS: Client error displayed when trying to perform an action without providing an ID.
|
||||||
$this->clientError(_('No ID given.'), 404);
|
$this->clientError(_('No ID given.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->peopletag || $this->peopletag->private) {
|
if (!$this->peopletag || $this->peopletag->private) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = Profile::getKV('id', $this->peopletag->tagger);
|
$this->tagger = Profile::getKV('id', $this->peopletag->tagger);
|
||||||
|
@ -34,13 +34,10 @@ class TagAction extends Action
|
|||||||
|
|
||||||
if (!$this->tag) {
|
if (!$this->tag) {
|
||||||
common_redirect(common_local_url('publictagcloud'), 301);
|
common_redirect(common_local_url('publictagcloud'), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->tag != $taginput) {
|
if ($this->tag != $taginput) {
|
||||||
common_redirect(common_local_url('tag', array('tag' => $this->tag)),
|
common_redirect(common_local_url('tag', array('tag' => $this->tag)), 301);
|
||||||
301);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
|
@ -46,7 +46,6 @@ class TagprofileAction extends Action
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Client error displayed when referring to non-existing profile ID.
|
// TRANS: Client error displayed when referring to non-existing profile ID.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +54,6 @@ class TagprofileAction extends Action
|
|||||||
// TRANS: Client error displayed when trying to tag a user that cannot be tagged.
|
// TRANS: Client error displayed when trying to tag a user that cannot be tagged.
|
||||||
$this->clientError(_('You cannot tag this user.'));
|
$this->clientError(_('You cannot tag this user.'));
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
|
@ -33,7 +33,6 @@ class TagrssAction extends Rss10Action
|
|||||||
if (!$this->tag) {
|
if (!$this->tag) {
|
||||||
// TRANS: Client error when requesting a tag feed for a non-existing tag.
|
// TRANS: Client error when requesting a tag feed for a non-existing tag.
|
||||||
$this->clientError(_('No such tag.'));
|
$this->clientError(_('No such tag.'));
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
$this->notices = $this->getNotices($this->limit);
|
$this->notices = $this->getNotices($this->limit);
|
||||||
return true;
|
return true;
|
||||||
|
@ -57,7 +57,6 @@ class UnblockAction extends ProfileFormAction
|
|||||||
if (!$cur->hasBlocked($this->profile)) {
|
if (!$cur->hasBlocked($this->profile)) {
|
||||||
// TRANS: Client error displayed when trying to unblock a non-blocked user.
|
// TRANS: Client error displayed when trying to unblock a non-blocked user.
|
||||||
$this->clientError(_("You haven't blocked that user."));
|
$this->clientError(_("You haven't blocked that user."));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -84,7 +83,6 @@ class UnblockAction extends ProfileFormAction
|
|||||||
if (!$result) {
|
if (!$result) {
|
||||||
// TRANS: Server error displayed when removing a user block.
|
// TRANS: Server error displayed when removing a user block.
|
||||||
$this->serverError(_('Error removing the block.'));
|
$this->serverError(_('Error removing the block.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,6 @@ class UnsandboxAction extends ProfileFormAction
|
|||||||
if (!$cur->hasRight(Right::SANDBOXUSER)) {
|
if (!$cur->hasRight(Right::SANDBOXUSER)) {
|
||||||
// TRANS: Client error on page to unsandbox a user when the feature is not enabled.
|
// TRANS: Client error on page to unsandbox a user when the feature is not enabled.
|
||||||
$this->clientError(_('You cannot sandbox users on this site.'));
|
$this->clientError(_('You cannot sandbox users on this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!empty($this->profile)); // checked by parent
|
assert(!empty($this->profile)); // checked by parent
|
||||||
@ -70,7 +69,6 @@ class UnsandboxAction extends ProfileFormAction
|
|||||||
if (!$this->profile->isSandboxed()) {
|
if (!$this->profile->isSandboxed()) {
|
||||||
// TRANS: Client error on page to unsilence a user when the to be unsandboxed user has not been sandboxed.
|
// TRANS: Client error on page to unsilence a user when the to be unsandboxed user has not been sandboxed.
|
||||||
$this->clientError(_('User is not sandboxed.'));
|
$this->clientError(_('User is not sandboxed.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -62,7 +62,6 @@ class UnsilenceAction extends ProfileFormAction
|
|||||||
if (!$cur->hasRight(Right::SILENCEUSER)) {
|
if (!$cur->hasRight(Right::SILENCEUSER)) {
|
||||||
// TRANS: Client error on page to unsilence a user when the feature is not enabled.
|
// TRANS: Client error on page to unsilence a user when the feature is not enabled.
|
||||||
$this->clientError(_('You cannot silence users on this site.'));
|
$this->clientError(_('You cannot silence users on this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!empty($this->profile)); // checked by parent
|
assert(!empty($this->profile)); // checked by parent
|
||||||
@ -70,7 +69,6 @@ class UnsilenceAction extends ProfileFormAction
|
|||||||
if (!$this->profile->isSilenced()) {
|
if (!$this->profile->isSilenced()) {
|
||||||
// TRANS: Client error on page to unsilence a user when the to be unsilenced user has not been silenced.
|
// TRANS: Client error on page to unsilence a user when the to be unsilenced user has not been silenced.
|
||||||
$this->clientError(_('User is not silenced.'));
|
$this->clientError(_('User is not silenced.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -50,13 +50,11 @@ class UnsubscribeAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||||
common_redirect(common_local_url('subscriptions',
|
common_redirect(common_local_url('subscriptions',
|
||||||
array('nickname' => $this->scoped->nickname)));
|
array('nickname' => $this->scoped->nickname)));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use a session token for CSRF protection. */
|
/* Use a session token for CSRF protection. */
|
||||||
@ -67,7 +65,6 @@ class UnsubscribeAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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. ' .
|
$this->clientError(_('There was a problem with your session token. ' .
|
||||||
'Try again, please.'));
|
'Try again, please.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$other_id = $this->arg('unsubscribeto');
|
$other_id = $this->arg('unsubscribeto');
|
||||||
@ -75,7 +72,6 @@ class UnsubscribeAction extends Action
|
|||||||
if (!$other_id) {
|
if (!$other_id) {
|
||||||
// TRANS: Client error displayed when trying to unsubscribe without providing a profile ID.
|
// TRANS: Client error displayed when trying to unsubscribe without providing a profile ID.
|
||||||
$this->clientError(_('No profile ID in request.'));
|
$this->clientError(_('No profile ID in request.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$other = Profile::getKV('id', $other_id);
|
$other = Profile::getKV('id', $other_id);
|
||||||
@ -83,7 +79,6 @@ class UnsubscribeAction extends Action
|
|||||||
if (!($other instanceof Profile)) {
|
if (!($other instanceof Profile)) {
|
||||||
// TRANS: Client error displayed when trying to unsubscribe while providing a non-existing profile ID.
|
// TRANS: Client error displayed when trying to unsubscribe while providing a non-existing profile ID.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -104,9 +99,7 @@ class UnsubscribeAction extends Action
|
|||||||
$this->elementEnd('body');
|
$this->elementEnd('body');
|
||||||
$this->endHTML();
|
$this->endHTML();
|
||||||
} else {
|
} else {
|
||||||
common_redirect(common_local_url('subscriptions',
|
common_redirect(common_local_url('subscriptions', array('nickname' => $this->scoped->nickname)), 303);
|
||||||
array('nickname' => $this->scoped->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,14 +58,12 @@ class UnsubscribepeopletagAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Client error displayed when trying to perform an action while not logged in.
|
// TRANS: Client error displayed when trying to perform an action while not logged in.
|
||||||
$this->clientError(_('You must be logged in to unsubscribe from a list.'));
|
$this->clientError(_('You must be logged in to unsubscribe from a list.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// Only allow POST requests
|
// Only allow POST requests
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||||
// TRANS: Client error displayed when trying to use another method than POST.
|
// TRANS: Client error displayed when trying to use another method than POST.
|
||||||
$this->clientError(_('This action only accepts POST requests.'));
|
$this->clientError(_('This action only accepts POST requests.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF protection
|
// CSRF protection
|
||||||
@ -76,7 +74,6 @@ class UnsubscribepeopletagAction extends Action
|
|||||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
// 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.'.
|
$this->clientError(_('There was a problem with your session token.'.
|
||||||
' Try again, please.'));
|
' Try again, please.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$tagger_arg = $this->trimmed('tagger');
|
$tagger_arg = $this->trimmed('tagger');
|
||||||
@ -88,13 +85,11 @@ class UnsubscribepeopletagAction extends Action
|
|||||||
} else {
|
} else {
|
||||||
// TRANS: Client error displayed when trying to perform an action without providing an ID.
|
// TRANS: Client error displayed when trying to perform an action without providing an ID.
|
||||||
$this->clientError(_('No ID given.'), 404);
|
$this->clientError(_('No ID given.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->peopletag || $this->peopletag->private) {
|
if (!$this->peopletag || $this->peopletag->private) {
|
||||||
// TRANS: Client error displayed trying to reference a non-existing list.
|
// TRANS: Client error displayed trying to reference a non-existing list.
|
||||||
$this->clientError(_('No such list.'), 404);
|
$this->clientError(_('No such list.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tagger = Profile::getKV('id', $this->peopletag->tagger);
|
$this->tagger = Profile::getKV('id', $this->peopletag->tagger);
|
||||||
@ -137,11 +132,8 @@ class UnsubscribepeopletagAction extends Action
|
|||||||
} else {
|
} else {
|
||||||
if (common_get_returnto()) {
|
if (common_get_returnto()) {
|
||||||
common_redirect(common_get_returnto(), 303);
|
common_redirect(common_get_returnto(), 303);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('peopletagsbyuser',
|
common_redirect(common_local_url('peopletagsbyuser', array('nickname' => $this->tagger->nickname)), 303);
|
||||||
array('nickname' => $this->tagger->nickname)),
|
|
||||||
303);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,6 @@ class UrlsettingsAction extends SettingsAction
|
|||||||
common_log_db_error($user, 'UPDATE', __FILE__);
|
common_log_db_error($user, 'UPDATE', __FILE__);
|
||||||
// TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server.
|
// TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server.
|
||||||
$this->serverError(_('Could not update user.'));
|
$this->serverError(_('Could not update user.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$prefs = User_urlshortener_prefs::getPrefs($user);
|
$prefs = User_urlshortener_prefs::getPrefs($user);
|
||||||
|
@ -85,7 +85,6 @@ class UsergroupsAction extends ProfileAction
|
|||||||
$args['page'] = $this->arg['page'];
|
$args['page'] = $this->arg['page'];
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('usergroups', $args), 301);
|
common_redirect(common_local_url('usergroups', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('nickname', $nickname);
|
$this->user = User::getKV('nickname', $nickname);
|
||||||
@ -93,7 +92,6 @@ class UsergroupsAction extends ProfileAction
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed requesting groups for a non-existing user.
|
// TRANS: Client error displayed requesting groups for a non-existing user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $this->user->getProfile();
|
$this->profile = $this->user->getProfile();
|
||||||
@ -101,7 +99,6 @@ class UsergroupsAction extends ProfileAction
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = $this->trimmed('page', 1);
|
$this->page = $this->trimmed('page', 1);
|
||||||
|
@ -286,7 +286,6 @@ function main()
|
|||||||
// If the request is HTTP and it should be HTTPS...
|
// If the request is HTTP and it should be HTTPS...
|
||||||
if ($site_ssl != 'never' && !StatusNet::isHTTPS() && common_is_sensitive($args['action'])) {
|
if ($site_ssl != 'never' && !StatusNet::isHTTPS() && common_is_sensitive($args['action'])) {
|
||||||
common_redirect(common_local_url($args['action'], $args));
|
common_redirect(common_local_url($args['action'], $args));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$args = array_merge($args, $_REQUEST);
|
$args = array_merge($args, $_REQUEST);
|
||||||
@ -297,7 +296,6 @@ function main()
|
|||||||
|
|
||||||
if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) {
|
if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) {
|
||||||
common_redirect(common_local_url('public'));
|
common_redirect(common_local_url('public'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the site is private, and they're not on one of the "public"
|
// If the site is private, and they're not on one of the "public"
|
||||||
@ -324,7 +322,6 @@ function main()
|
|||||||
common_set_returnto(common_local_url($action, $rargs));
|
common_set_returnto(common_local_url($action, $rargs));
|
||||||
|
|
||||||
common_redirect(common_local_url('login'));
|
common_redirect(common_local_url('login'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$action_class = ucfirst($action).'Action';
|
$action_class = ucfirst($action).'Action';
|
||||||
|
@ -69,7 +69,6 @@ class AdminPanelAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -94,7 +93,6 @@ class AdminPanelAction extends Action
|
|||||||
if (!$user->hasRight(Right::CONFIGURESITE)) {
|
if (!$user->hasRight(Right::CONFIGURESITE)) {
|
||||||
// TRANS: Client error message thrown when a user tries to change admin settings but has no access rights.
|
// TRANS: Client error message thrown when a user tries to change admin settings but has no access rights.
|
||||||
$this->clientError(_('You cannot make changes to this site.'));
|
$this->clientError(_('You cannot make changes to this site.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This panel must be enabled
|
// This panel must be enabled
|
||||||
@ -106,7 +104,6 @@ class AdminPanelAction extends Action
|
|||||||
if (!self::canAdmin($name)) {
|
if (!self::canAdmin($name)) {
|
||||||
// TRANS: Client error message throw when a certain panel's settings cannot be changed.
|
// TRANS: Client error message throw when a certain panel's settings cannot be changed.
|
||||||
$this->clientError(_('Changes to that panel are not allowed.'), 403);
|
$this->clientError(_('Changes to that panel are not allowed.'), 403);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -220,7 +217,6 @@ class AdminPanelAction extends Action
|
|||||||
{
|
{
|
||||||
// TRANS: Client error message.
|
// TRANS: Client error message.
|
||||||
$this->clientError(_('showForm() not implemented.'));
|
$this->clientError(_('showForm() not implemented.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -248,7 +244,6 @@ class AdminPanelAction extends Action
|
|||||||
{
|
{
|
||||||
// TRANS: Client error message
|
// TRANS: Client error message
|
||||||
$this->clientError(_('saveSettings() not implemented.'));
|
$this->clientError(_('saveSettings() not implemented.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function canAdmin($name)
|
function canAdmin($name)
|
||||||
|
@ -1324,7 +1324,6 @@ class ApiAction extends Action
|
|||||||
default:
|
default:
|
||||||
// TRANS: Client error on an API request with an unsupported data format.
|
// TRANS: Client error on an API request with an unsupported data format.
|
||||||
$this->clientError(_('Not a supported data format.'));
|
$this->clientError(_('Not a supported data format.'));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -1351,7 +1350,6 @@ class ApiAction extends Action
|
|||||||
default:
|
default:
|
||||||
// TRANS: Client error on an API request with an unsupported data format.
|
// TRANS: Client error on an API request with an unsupported data format.
|
||||||
$this->clientError(_('Not a supported data format.'));
|
$this->clientError(_('Not a supported data format.'));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1406,7 +1404,6 @@ class ApiAction extends Action
|
|||||||
default:
|
default:
|
||||||
// TRANS: Client error on an API request with an unsupported data format.
|
// TRANS: Client error on an API request with an unsupported data format.
|
||||||
$this->clientError(_('Not a supported data format.'));
|
$this->clientError(_('Not a supported data format.'));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,6 @@ class ApiListUsersAction extends ApiBareAuthAction
|
|||||||
if (empty($this->list)) {
|
if (empty($this->list)) {
|
||||||
// TRANS: Client error displayed when referring to a non-existing list.
|
// TRANS: Client error displayed when referring to a non-existing list.
|
||||||
$this->clientError(_('List not found.'), 404, $this->format);
|
$this->clientError(_('List not found.'), 404, $this->format);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->create && !$this->delete) {
|
if(!$this->create && !$this->delete) {
|
||||||
|
@ -51,7 +51,6 @@ class GalleryAction extends ProfileAction
|
|||||||
$args['page'] = $this->arg['page'];
|
$args['page'] = $this->arg['page'];
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url($this->trimmed('action'), $args), 301);
|
common_redirect(common_local_url($this->trimmed('action'), $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = User::getKV('nickname', $nickname);
|
$this->user = User::getKV('nickname', $nickname);
|
||||||
@ -59,7 +58,6 @@ class GalleryAction extends ProfileAction
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when trying to perform a gallery action with an unknown user.
|
// TRANS: Client error displayed when trying to perform a gallery action with an unknown user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = $this->user->getProfile();
|
$this->profile = $this->user->getProfile();
|
||||||
@ -67,7 +65,6 @@ class GalleryAction extends ProfileAction
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Error message displayed when referring to a user without a profile.
|
// TRANS: Error message displayed when referring to a user without a profile.
|
||||||
$this->serverError(_('User has no profile.'));
|
$this->serverError(_('User has no profile.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||||
@ -91,7 +88,6 @@ class GalleryAction extends ProfileAction
|
|||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
common_redirect($this->selfUrl(), 303);
|
common_redirect($this->selfUrl(), 303);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
@ -61,13 +61,11 @@ class GroupAction extends Action
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('showgroup', $args), 301);
|
common_redirect(common_local_url('showgroup', $args), 301);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
// TRANS: Client error displayed if no nickname argument was given requesting a group page.
|
// TRANS: Client error displayed if no nickname argument was given requesting a group page.
|
||||||
$this->clientError(_('No nickname.'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$local = Local_group::getKV('nickname', $nickname);
|
$local = Local_group::getKV('nickname', $nickname);
|
||||||
@ -80,12 +78,10 @@ class GroupAction extends Action
|
|||||||
$args['page'] = $this->page;
|
$args['page'] = $this->page;
|
||||||
}
|
}
|
||||||
common_redirect(common_local_url('groupbyid', $args), 301);
|
common_redirect(common_local_url('groupbyid', $args), 301);
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
common_log(LOG_NOTICE, "Couldn't find local group for nickname '$nickname'");
|
common_log(LOG_NOTICE, "Couldn't find local group for nickname '$nickname'");
|
||||||
// TRANS: Client error displayed if no remote group with a given name was found requesting group page.
|
// TRANS: Client error displayed if no remote group with a given name was found requesting group page.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +90,6 @@ class GroupAction extends Action
|
|||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
// TRANS: Client error displayed if no local group with a given name was found requesting group page.
|
// TRANS: Client error displayed if no local group with a given name was found requesting group page.
|
||||||
$this->clientError(_('No such group.'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,16 +77,13 @@ class MailboxAction extends Action
|
|||||||
if (!$this->user) {
|
if (!$this->user) {
|
||||||
// TRANS: Client error displayed when trying to access a mailbox without providing a user.
|
// TRANS: Client error displayed when trying to access a mailbox without providing a user.
|
||||||
$this->clientError(_('No such user.'), 404);
|
$this->clientError(_('No such user.'), 404);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
|
||||||
if (!$cur || $cur->id != $this->user->id) {
|
if (!$cur || $cur->id != $this->user->id) {
|
||||||
// TRANS: Client error displayed when trying to access a mailbox that is not of the logged in user.
|
// TRANS: Client error displayed when trying to access a mailbox that is not of the logged in user.
|
||||||
$this->clientError(_('Only the user can read their own mailboxes.'),
|
$this->clientError(_('Only the user can read their own mailboxes.'), 403);
|
||||||
403);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
@ -77,7 +77,6 @@ class ProfileFormAction extends RedirectingAction
|
|||||||
if (!$id) {
|
if (!$id) {
|
||||||
// TRANS: Client error displayed when trying to change user options without specifying a user to work on.
|
// TRANS: Client error displayed when trying to change user options without specifying a user to work on.
|
||||||
$this->clientError(_('No profile specified.'));
|
$this->clientError(_('No profile specified.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->profile = Profile::getKV('id', $id);
|
$this->profile = Profile::getKV('id', $id);
|
||||||
@ -85,7 +84,6 @@ class ProfileFormAction extends RedirectingAction
|
|||||||
if (!$this->profile) {
|
if (!$this->profile) {
|
||||||
// TRANS: Client error displayed when trying to change user options without specifying an existing user to work on.
|
// TRANS: Client error displayed when trying to change user options without specifying an existing user to work on.
|
||||||
$this->clientError(_('No profile with that ID.'));
|
$this->clientError(_('No profile with that ID.'));
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -71,7 +71,6 @@ class SettingsAction extends Action
|
|||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_('Not logged in.'));
|
||||||
return;
|
|
||||||
} else if (!common_is_real_login()) {
|
} else if (!common_is_real_login()) {
|
||||||
// Cookie theft means that automatic logins can't
|
// Cookie theft means that automatic logins can't
|
||||||
// change important settings or see private info, and
|
// change important settings or see private info, and
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user