diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php index fef0e766..d60b7bea 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RestController.php @@ -29,6 +29,19 @@ use Cadoles\CoreBundle\Form\UserType; class RestController extends Controller { + public function loginAction($key,Request $request) + { + $output=[]; + + // Vérification de la clé + $realkey = $this->getParameter("apikeyninegate"); + if($key!=$realkey) { + $output["error"]="error key"; + return new Response(json_encode($output), 400); + } + + return new Response(json_encode($output), 200); + } public function userAction($key, $login, Request $request) { diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml index b96d99ba..30b2042c 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/config/routing.yml @@ -492,6 +492,10 @@ cadoles_core_config_statistic: defaults: { _controller: CadolesCoreBundle:Statistic:list } #== REST ================================================================================================================== +cadoles_core_rest_login: + path: /rest/login/{key} + defaults: { _controller: CadolesCoreBundle:Rest:login } + cadoles_core_rest_user: path: /rest/user/{key}/{login} defaults: { _controller: CadolesCoreBundle:Rest:user }