--- a/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php Wed Sep 04 16:39:58 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php Wed Sep 04 16:41:11 2013 +0900
@@ -37,15 +37,20 @@
return $this->render('OrgW3AutotweetBundle:Default:note.html.twig', array('post' => $post, 'talk' => $talk));
}
- public function checkKeyAction($key){
- //$key=$this->get('request')->request->get('accesskey');
+ public function checkKeyAction(){
+ $key=$this->get('request')->request->get('accesskey');
+ if(null!=$key){
$talk = $this->getDoctrine()->getRepository('OrgW3AutotweetBundle:Talk')->findOneBy(array('accesskey'=>$key));
if(0!=count($talk)){
- $valid='true';
+ $valid=true;
}else{
- $valid='false';
+ $valid=false;
+ }
+ }else{
+ $valid=false;
}
$response = new JsonResponse();
+ $response->headers->set('Access-Control-Allow-Origin','*');
$response->setData(array(
'accepted' => $valid
));
--- a/autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml Wed Sep 04 16:39:58 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml Wed Sep 04 16:41:11 2013 +0900
@@ -14,7 +14,7 @@
pattern: /test
defaults: { _controller: OrgW3AutotweetBundle:Default:test }
org_w3_autotweet_checkkey:
- pattern: /checkkey/{key}
+ pattern: /checkkey
defaults: { _controller: OrgW3AutotweetBundle:Default:checkKey }
login:
pattern: /login