Resolve conflict.
authorhiroto
Wed, 04 Sep 2013 02:52:43 +0900
changeset 22 b738e9a337a2
parent 21 043a5ae4eba7
child 23 42066035b11d
Resolve conflict.
autotweet-php/app/config/security.yml
autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php
autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml
js/w3c_talks.js
--- a/autotweet-php/app/config/security.yml	Tue Sep 03 23:05:08 2013 +0900
+++ b/autotweet-php/app/config/security.yml	Wed Sep 04 02:52:43 2013 +0900
@@ -5,13 +5,25 @@
     role_hierarchy:
         ROLE_ADMIN:       ROLE_USER
         ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
-
+   
     providers:
+        chain_provider:
+          chain:
+#            providers: [in_memory, user_db]
+            providers: [in_memory]
         in_memory:
-            memory:
-                users:
-                    user:  { password: userpass, roles: [ 'ROLE_USER' ] }
-                    admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
+          memory:
+            users:
+              admin: { password: Test, roles: [ 'ROLE_ADMIN' ] }
+        #user_db: 
+          #entity: { class: Acme\UserBundle\Entity\User, property: username }
+#############default####
+#    providers:
+#        in_memory:
+#            memory:
+#                users:
+#                    user:  { password: userpass, roles: [ 'ROLE_USER' ] }
+#                    admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
 
     firewalls:
         dev:
@@ -23,17 +35,19 @@
             security: false
 
         secured_area:
-            pattern:    ^/demo/secured/
+            pattern:    ^/
             form_login:
-                check_path: _security_check
-                login_path: _demo_login
+                check_path: login_check
+                login_path: login
             logout:
-                path:   _demo_logout
-                target: _demo
-            #anonymous: ~
+                path:   logout
+                target: login
+            anonymous: ~
             #http_basic:
             #    realm: "Secured Demo Area"
 
     access_control:
         - { path: ^/demo/secured/hello/admin/, roles: ROLE_ADMIN }
-        #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
+        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
+        - { path: ^/post, roles: IS_AUTHENTICATED_ANONYMOUSLY }
+    
--- a/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php	Tue Sep 03 23:05:08 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Controller/DefaultController.php	Wed Sep 04 02:52:43 2013 +0900
@@ -19,10 +19,16 @@
         return array('name' => $name);
 	//$connection = new \W3TweetTwitterOAuth('hxg6thsXDcNByjBKwGtvdg', 'gJcfbddJPMydmvpaSP3qO283rI257ZtmlbghWjpmB28');
     }
-    public function testAction()
-    {
-    return $this->render('OrgW3AutotweetBundle:Default:test.html.twig', array());                 
+    
+    public function listAction($name){
+        return $this->render('OrgW3AutotweetBundle:Default:index.html.twig', array('name' => $name));
     }
+    
+    public function testAction(){
+
+        return $this->render('OrgW3AutotweetBundle:Default:test.html.twig', array());                 
+    }
+
 
     public function postAction(Request $request)
     {
--- a/autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml	Tue Sep 03 23:05:08 2013 +0900
+++ b/autotweet-php/src/Org/W3/AutotweetBundle/Resources/config/routing.yml	Wed Sep 04 02:52:43 2013 +0900
@@ -1,6 +1,16 @@
 org_w3_autotweet_post:
     pattern:  /post
     defaults: { _controller: OrgW3AutotweetBundle:Default:post }
+org_w3_autotweet_post:
+    pattern:  /list/{name}
+    defaults: { _controller: OrgW3AutotweetBundle:Default:list }
 org_w3_autotweet_test:
     pattern:  /test
-    defaults: { _controller: OrgW3AutotweetBundle:Default:test }
\ No newline at end of file
+    defaults: { _controller: OrgW3AutotweetBundle:Default:test }
+login:
+    pattern:   /login
+    defaults:  { _controller: OrgW3AutotweetBundle:Security:login }
+login_check:
+    pattern:   /login_check
+logout:
+    pattern:   /logout
\ No newline at end of file
--- a/js/w3c_talks.js	Tue Sep 03 23:05:08 2013 +0900
+++ b/js/w3c_talks.js	Wed Sep 04 02:52:43 2013 +0900
@@ -129,6 +129,7 @@
                     data += '&author=' + encodeURIComponent(author);
                     data += '&title=' + encodeURIComponent(title);
                     data += '&accesskey=' + window.sessionStorage['accesskey'];
+                    console.log(data);
                     doPost(url, data);
                 }
             } catch(e) {