You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (preg_match($pattern, $object_called, $matches)) {
354
355
$object_called = $matches[1];
355
356
}
@@ -367,8 +368,8 @@ public function _remap($object_called, $arguments)
367
368
if (config_item('rest_enable_logging') and$log_method) {
368
369
$this->_log_request();
369
370
}
370
-
371
-
$this->response(array('status' => false, 'error' => 'Invalid API Key.'), 403);
371
+
372
+
$this->response(array(config_item('rest_status_field_name') => false, config_item('rest_message_field_name') => 'Invalid API Key'.$this->rest->key), 403);
372
373
}
373
374
374
375
// Check to see if this key has access to the requested controller.
@@ -377,19 +378,19 @@ public function _remap($object_called, $arguments)
377
378
$this->_log_request();
378
379
}
379
380
380
-
$this->response(array('status' => false, 'error' => 'This API key does not have access to the requested controller.'), 401);
381
+
$this->response(array(config_item('rest_status_field_name') => false, config_item('rest_message_field_name') => 'This API key does not have access to the requested controller.'), 401);
381
382
}
382
383
383
384
// Sure it exists, but can they do anything with it?
384
385
if ( ! method_exists($this, $controller_method)) {
// Doing key related stuff? Can only do it if they have a key right?
389
390
if (config_item('rest_enable_keys') and !empty($this->rest->key)) {
390
391
// Check the limit
391
392
if (config_item('rest_enable_limits') and !$this->_check_limit($controller_method)) {
392
-
$response = array('status' => false, 'error' => 'This API key has reached the hourly limit for this method.');
393
+
$response = array(config_item('rest_status_field_name') => false, config_item('rest_message_field_name') => 'This API key has reached the hourly limit for this method.');
393
394
$this->response($response, 401);
394
395
}
395
396
@@ -405,7 +406,7 @@ public function _remap($object_called, $arguments)
405
406
}
406
407
407
408
// They don't have good enough perms
408
-
$response = array('status' => false, 'error' => 'This API key does not have enough permissions.');
409
+
$response = array(config_item('rest_status_field_name') => false, config_item('rest_message_field_name') => 'This API key does not have enough permissions.');
409
410
$authorizedor$this->response($response, 401);
410
411
}
411
412
@@ -560,6 +561,7 @@ protected function _detect_output_format()
0 commit comments