Update Session controller

This commit is contained in:
Nicolas Le Goff
2012-10-24 11:57:29 +02:00
parent 618f81d207
commit a3f0bcedd9

View File

@@ -41,7 +41,7 @@ class Session implements ControllerProviderInterface
* *
* return : JSON Response * return : JSON Response
*/ */
$controllers->get('/update/', $this->call('updateSession')) $controllers->post('/update/', $this->call('updateSession'))
->bind('update_session'); ->bind('update_session');
return $controllers; return $controllers;
@@ -56,6 +56,10 @@ class Session implements ControllerProviderInterface
*/ */
public function updateSession(Application $app, Request $request) public function updateSession(Application $app, Request $request)
{ {
if(!$request->isXmlHttpRequest()) {
$app->abort(400);
}
$ret = array( $ret = array(
'status' => 'unknown', 'status' => 'unknown',
'message' => '', 'message' => '',