Key validation.
--- a/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php Wed Sep 04 13:07:30 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php Wed Sep 04 14:21:35 2013 +0900
@@ -36,6 +36,18 @@
return $this->render('OrgW3AutotweetBundle:Default:note.html.twig', array('post' => $post, 'talk' => $talk));
}
+ public function checkKeyAction($key){
+ //$key=$this->get('request')->request->get('accesskey');
+ $talk = $this->getDoctrine()->getRepository('OrgW3AutotweetBundle:Talk')->findOneBy(array('accesskey'=>$key));
+ if(0!=count($talk)){
+ $valid='true';
+ }else{
+ $valid='false';
+ }
+
+ return $this->render('OrgW3AutotweetBundle:Default:checkkey.json.twig', array('valid' => $valid));
+ }
+
public function newTalkAction(Request $request)
{
--- a/autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml Wed Sep 04 13:07:30 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml Wed Sep 04 14:21:35 2013 +0900
@@ -13,6 +13,9 @@
org_w3_autotweet_test:
pattern: /test
defaults: { _controller: OrgW3AutotweetBundle:Default:test }
+org_w3_autotweet_checkkey:
+ pattern: /checkkey/{key}
+ defaults: { _controller: OrgW3AutotweetBundle:Default:checkKey }
login:
pattern: /login
defaults: { _controller: OrgW3AutotweetBundle:Security:login }