(Puctuation) consistency in clientError() calls.
This commit is contained in:
parent
954eb411e0
commit
745e35ac1f
@ -72,7 +72,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
|
|||||||
$this->original = Notice::staticGet('id', $id);
|
$this->original = Notice::staticGet('id', $id);
|
||||||
|
|
||||||
if (empty($this->original)) {
|
if (empty($this->original)) {
|
||||||
$this->clientError(_('No such notice'),
|
$this->clientError(_('No such notice.'),
|
||||||
400, $this->format);
|
400, $this->format);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
|
|||||||
$this->user = $this->auth_user;
|
$this->user = $this->auth_user;
|
||||||
|
|
||||||
if ($this->user->id == $notice->profile_id) {
|
if ($this->user->id == $notice->profile_id) {
|
||||||
$this->clientError(_('Cannot repeat your own notice'));
|
$this->clientError(_('Cannot repeat your own notice.'));
|
||||||
400, $this->format);
|
400, $this->format);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
|
|||||||
$profile = $this->user->getProfile();
|
$profile = $this->user->getProfile();
|
||||||
|
|
||||||
if ($profile->hasRepeated($id)) {
|
if ($profile->hasRepeated($id)) {
|
||||||
$this->clientError(_('Already repeated that notice'),
|
$this->clientError(_('Already repeated that notice.'),
|
||||||
400, $this->format);
|
400, $this->format);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
|
|||||||
$this->original = Notice::staticGet('id', $id);
|
$this->original = Notice::staticGet('id', $id);
|
||||||
|
|
||||||
if (empty($this->original)) {
|
if (empty($this->original)) {
|
||||||
$this->clientError(_('No such notice'),
|
$this->clientError(_('No such notice.'),
|
||||||
400, $this->format);
|
400, $this->format);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -31,15 +31,15 @@ class FileAction extends Action
|
|||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
$this->id = $this->trimmed('notice');
|
$this->id = $this->trimmed('notice');
|
||||||
if (empty($this->id)) {
|
if (empty($this->id)) {
|
||||||
$this->clientError(_('No notice id'));
|
$this->clientError(_('No notice ID.'));
|
||||||
}
|
}
|
||||||
$notice = Notice::staticGet('id', $this->id);
|
$notice = Notice::staticGet('id', $this->id);
|
||||||
if (empty($notice)) {
|
if (empty($notice)) {
|
||||||
$this->clientError(_('No notice'));
|
$this->clientError(_('No notice.'));
|
||||||
}
|
}
|
||||||
$atts = $notice->attachments();
|
$atts = $notice->attachments();
|
||||||
if (empty($atts)) {
|
if (empty($atts)) {
|
||||||
$this->clientError(_('No attachments'));
|
$this->clientError(_('No attachments.'));
|
||||||
}
|
}
|
||||||
foreach ($atts as $att) {
|
foreach ($atts as $att) {
|
||||||
if (!empty($att->filename)) {
|
if (!empty($att->filename)) {
|
||||||
@ -48,7 +48,7 @@ class FileAction extends Action
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($this->filerec)) {
|
if (empty($this->filerec)) {
|
||||||
$this->clientError(_('No uploaded attachments'));
|
$this->clientError(_('No uploaded attachments.'));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -88,14 +88,14 @@ class groupRssAction extends Rss10Action
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$nickname) {
|
if (!$nickname) {
|
||||||
$this->clientError(_('No nickname'), 404);
|
$this->clientError(_('No nickname.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->group = User_group::staticGet('nickname', $nickname);
|
$this->group = User_group::staticGet('nickname', $nickname);
|
||||||
|
|
||||||
if (!$this->group) {
|
if (!$this->group) {
|
||||||
$this->clientError(_('No such group'), 404);
|
$this->clientError(_('No such group.'), 404);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,13 +30,13 @@ class TagotherAction extends Action
|
|||||||
{
|
{
|
||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
$this->clientError(_('Not logged in'), 403);
|
$this->clientError(_('Not logged in.'), 403);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $this->trimmed('id');
|
$id = $this->trimmed('id');
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
$this->clientError(_('No id argument.'));
|
$this->clientError(_('No ID argument.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,17 +47,17 @@ class UserbyidAction extends Action
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Is read only?
|
* Is read only?
|
||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class handler.
|
* Class handler.
|
||||||
*
|
*
|
||||||
* @param array $args array of arguments
|
* @param array $args array of arguments
|
||||||
*
|
*
|
||||||
* @return nothing
|
* @return nothing
|
||||||
@ -67,7 +67,7 @@ class UserbyidAction extends Action
|
|||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
$id = $this->trimmed('id');
|
$id = $this->trimmed('id');
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
$this->clientError(_('No id.'));
|
$this->clientError(_('No ID.'));
|
||||||
}
|
}
|
||||||
$user = User::staticGet($id);
|
$user = User::staticGet($id);
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
@ -88,4 +88,3 @@ class UserbyidAction extends Action
|
|||||||
common_redirect($url, 303);
|
common_redirect($url, 303);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class ProfileFormAction extends Action
|
|||||||
if ($action) {
|
if ($action) {
|
||||||
common_redirect(common_local_url($action, $args), 303);
|
common_redirect(common_local_url($action, $args), 303);
|
||||||
} else {
|
} else {
|
||||||
$this->clientError(_("No return-to arguments"));
|
$this->clientError(_("No return-to arguments."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,6 +134,6 @@ class ProfileFormAction extends Action
|
|||||||
|
|
||||||
function handlePost()
|
function handlePost()
|
||||||
{
|
{
|
||||||
$this->serverError(_("unimplemented method"));
|
$this->serverError(_("Unimplemented method."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ class OpenidserverAction extends Action
|
|||||||
$response = $this->generateDenyResponse($request);
|
$response = $this->generateDenyResponse($request);
|
||||||
} else {
|
} else {
|
||||||
//invalid
|
//invalid
|
||||||
$this->clientError(sprintf(_m('You are not authorized to use the identity %s'),$request->identity),$code=403);
|
$this->clientError(sprintf(_m('You are not authorized to use the identity %s.'),$request->identity),$code=403);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$response = $this->oserver->handleRequest($request);
|
$response = $this->oserver->handleRequest($request);
|
||||||
|
@ -300,7 +300,7 @@ class TemplateAction extends Action
|
|||||||
|
|
||||||
// verify that user is admin
|
// verify that user is admin
|
||||||
if (!($user->id == 1))
|
if (!($user->id == 1))
|
||||||
$this->clientError(_('only User #1 can update the template'), $code = 401);
|
$this->clientError(_('Only User #1 can update the template.'), $code = 401);
|
||||||
|
|
||||||
// open the old template
|
// open the old template
|
||||||
$tpl_file = $this->templateFolder() . '/index.html';
|
$tpl_file = $this->templateFolder() . '/index.html';
|
||||||
|
Loading…
Reference in New Issue
Block a user