expose permission exceptions to the API
This commit is contained in:
parent
df408c1e82
commit
7794915172
1 changed files with 14 additions and 9 deletions
|
@ -196,15 +196,20 @@ class Controller
|
||||||
*/
|
*/
|
||||||
private function _create()
|
private function _create()
|
||||||
{
|
{
|
||||||
// Ensure last paste from visitors IP address was more than configured amount of seconds ago.
|
try {
|
||||||
TrafficLimiter::setConfiguration($this->_conf);
|
// Ensure last paste from visitors IP address was more than configured amount of seconds ago.
|
||||||
if (!TrafficLimiter::canPass()) {
|
TrafficLimiter::setConfiguration($this->_conf);
|
||||||
$this->_return_message(
|
if (!TrafficLimiter::canPass()) {
|
||||||
1, I18n::_(
|
$this->_return_message(
|
||||||
'Please wait %d seconds between each post.',
|
1, I18n::_(
|
||||||
$this->_conf->getKey('limit', 'traffic')
|
'Please wait %d seconds between each post.',
|
||||||
)
|
$this->_conf->getKey('limit', 'traffic')
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->_return_message(1, I18n::_($e->getMessage()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue