Return HTTP 403 instead of 400 when silenced users try to post via API

This commit is contained in:
Zach Copley 2010-07-29 18:47:28 +00:00
parent db90bcb329
commit 4e8e77f6b0
2 changed files with 2 additions and 2 deletions

View File

@ -332,7 +332,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$options
);
} catch (Exception $e) {
$this->clientError($e->getMessage());
$this->clientError($e->getMessage(), $e->getCode());
return;
}

View File

@ -275,7 +275,7 @@ class Notice extends Memcached_DataObject
if (!$profile->hasRight(Right::NEWNOTICE)) {
common_log(LOG_WARNING, "Attempted post from user disallowed to post: " . $profile->nickname);
throw new ClientException(_('You are banned from posting notices on this site.'));
throw new ClientException(_('You are banned from posting notices on this site.'), 403);
}
$notice = new Notice();