diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-03-21 20:45:22 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-03-21 20:45:22 -0700 |
commit | 7b35091b47f0b1ed2677795885553c07fd7bf168 (patch) | |
tree | e76ae8e30506da2661699b26de5b8ed05af85e6c /modules/rest | |
parent | 846a835e13b5d213cfecfb7915b9250bea6b528a (diff) |
If the access token is not set, then look in the post data.
Diffstat (limited to 'modules/rest')
-rw-r--r-- | modules/rest/controllers/rest.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php index 3db5e9b1..13594763 100644 --- a/modules/rest/controllers/rest.php +++ b/modules/rest/controllers/rest.php @@ -41,6 +41,7 @@ class Rest_Controller extends Controller { public function __call($function, $args) { $input = Input::instance(); $request = new stdClass(); + switch ($method = strtolower($input->server("REQUEST_METHOD"))) { case "get": $request->params = (object) $input->get(); @@ -56,6 +57,11 @@ class Rest_Controller extends Controller { $request->method = strtolower($input->server("HTTP_X_GALLERY_REQUEST_METHOD", $method)); $request->access_token = $input->server("HTTP_X_GALLERY_REQUEST_KEY"); + + if (empty($request->access_token) && !empty($request->params->access_token)) { + $request->access_token = $request->params->access_token; + } + $request->url = url::abs_current(true); rest::set_active_user($request->access_token); |