diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-08 23:27:43 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-08 23:27:43 -0800 |
commit | 9319f37c4f157c5b0787df9116889e4e9ea5df78 (patch) | |
tree | 17a8f9085b9562e47aea613f3522f6632c5f92bc /modules/rest/controllers/rest.php | |
parent | 837396ca2889b9e4e4a7b33a31409a2cd12a483c (diff) |
Correct the error message when the item is not found; remove the check for no request_key (access_token) as athat is treated as public permissions
Diffstat (limited to 'modules/rest/controllers/rest.php')
-rw-r--r-- | modules/rest/controllers/rest.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php index 0c88877a..1ec24493 100644 --- a/modules/rest/controllers/rest.php +++ b/modules/rest/controllers/rest.php @@ -48,16 +48,10 @@ class Rest_Controller extends Controller { public function __call($function, $args) { $request = $this->_normalize_request($args); - - if (empty($request->access_token)) { - print rest::forbidden("No access token supplied."); - return; - } - try { if ($this->_set_active_user($request->access_token)) { $handler_class = "{$function}_rest"; - $handler_method = "{$request->method}"; + $handler_method = $request->method; if (!method_exists($handler_class, $handler_method)) { print rest::not_implemented("$handler_class::$handler_method is not implemented"); @@ -67,7 +61,7 @@ class Rest_Controller extends Controller { print call_user_func(array($handler_class, $handler_method), $request); } } catch (Exception $e) { - print rest::internal_error($e); + print rest::internal_error($e->__toString()); } } @@ -83,9 +77,6 @@ class Rest_Controller extends Controller { } else { $request = new stdClass(); foreach (array_keys($_GET) as $key) { - if ($key == "request_key") { - continue; - } $request->$key = $this->input->get($key); } } |