From 02974c2d9827f1e8280b4223cf204a823d01f6b7 Mon Sep 17 00:00:00 2001 From: Ala Eddine khefifi Date: Fri, 4 Apr 2014 18:11:20 +0200 Subject: [PATCH 01/10] Update testing.rst --- book/testing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/book/testing.rst b/book/testing.rst index 4d1a635d08f..9f26f024e03 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -492,6 +492,11 @@ If you want the client to automatically follow all redirects, you can force him with the ``followRedirects()`` method:: $client->followRedirects(); + +Also if you want to prevent the client from following any redirect, you can +force him by adding false as parameter to ``followRedirects()`` method:: + + $client->followRedirects(false); .. index:: single: Tests; Crawler From 9878be675023e5308b50bfad697c79f365b2f850 Mon Sep 17 00:00:00 2001 From: Ala Eddine khefifi Date: Fri, 4 Apr 2014 22:04:54 +0200 Subject: [PATCH 02/10] Update testing.rst --- book/testing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/testing.rst b/book/testing.rst index 9f26f024e03..0368e180275 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -492,9 +492,9 @@ If you want the client to automatically follow all redirects, you can force him with the ``followRedirects()`` method:: $client->followRedirects(); - -Also if you want to prevent the client from following any redirect, you can -force him by adding false as parameter to ``followRedirects()`` method:: + +Also, if you want to prevent the client from following any redirect, you can +force him by passing ``false`` to ``followRedirects()`` method:: $client->followRedirects(false); From 804b686f795d231c9a7a01fbf852e08e246c2671 Mon Sep 17 00:00:00 2001 From: Ala Eddine Khefifi Date: Wed, 21 May 2014 12:56:52 +0200 Subject: [PATCH 03/10] Update testing.rst --- book/testing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/testing.rst b/book/testing.rst index 0368e180275..7fc2c1e2ac1 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -492,9 +492,9 @@ If you want the client to automatically follow all redirects, you can force him with the ``followRedirects()`` method:: $client->followRedirects(); - -Also, if you want to prevent the client from following any redirect, you can -force him by passing ``false`` to ``followRedirects()`` method:: + +If you pass ``false`` to the ``followRedirects()`` method, the redirects +will no longer be followed:: $client->followRedirects(false); From fb179c0ad284f47672876b61e70461d0a34a4c83 Mon Sep 17 00:00:00 2001 From: Tom Van Looy Date: Thu, 22 May 2014 22:18:22 +0200 Subject: [PATCH 04/10] Update scopes.rst Error in XML --- cookbook/service_container/scopes.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbook/service_container/scopes.rst b/cookbook/service_container/scopes.rst index bcbdb188fc6..cb71b5f63f7 100644 --- a/cookbook/service_container/scopes.rst +++ b/cookbook/service_container/scopes.rst @@ -237,10 +237,10 @@ Changing the scope of a service should be done in its definition: - + class="Acme\HelloBundle\Mail\GreetingCardManager" + scope="request"> + + .. code-block:: php From a7b8bc4aa3ecb4cd1dcb330faa5948f2bd4951c6 Mon Sep 17 00:00:00 2001 From: Abdellatif AitBoudad Date: Sun, 25 May 2014 20:45:37 +0100 Subject: [PATCH 05/10] [Security]fixed Login when there is no session. --- book/security.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/book/security.rst b/book/security.rst index b63abe37d11..15b072952b4 100644 --- a/book/security.rst +++ b/book/security.rst @@ -449,16 +449,21 @@ Next, create the controller that will display the login form:: $error = $request->attributes->get( SecurityContextInterface::AUTHENTICATION_ERROR ); - } else { + } elseif (null !== $session && $session->has(SecurityContextInterface::AUTHENTICATION_ERROR)) { $error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR); $session->remove(SecurityContextInterface::AUTHENTICATION_ERROR); + } else { + $error = ''; } + + // last username entered by the user + $lastUsername = (null === $session) ? '' : $session->get(SecurityContextInterface::LAST_USERNAME); return $this->render( 'AcmeSecurityBundle:Security:login.html.twig', array( // last username entered by the user - 'last_username' => $session->get(SecurityContextInterface::LAST_USERNAME), + 'last_username' => $lastUsername, 'error' => $error, ) ); From 48e8ba724557d60e1968c696f651c87f7d4cdefc Mon Sep 17 00:00:00 2001 From: Abdellatif AitBoudad Date: Sun, 25 May 2014 21:32:23 +0100 Subject: [PATCH 06/10] fixed missing info about FosUserBundle. --- book/security.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/security.rst b/book/security.rst index b63abe37d11..80a546a2d04 100644 --- a/book/security.rst +++ b/book/security.rst @@ -1130,7 +1130,7 @@ this by creating a ``User`` class and configuring the ``entity`` provider. .. tip:: A high-quality open source bundle is available that allows your users - to be stored via the Doctrine ORM or ODM. Read more about the `FOSUserBundle`_ + to be stored in a database. Read more about the `FOSUserBundle`_ on GitHub. With this approach, you'll first create your own ``User`` class, which will From fff25ce2b37344f98f902ac5de37ed3704b065b2 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Sun, 25 May 2014 23:09:07 +0100 Subject: [PATCH 07/10] Add a missing argument to the PdoSessionHandler. --- components/http_foundation/session_configuration.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index ca1332cfaa1..bcd992128eb 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -83,7 +83,8 @@ Example usage:: use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler; - $storage = new NativeSessionStorage(array(), new PdoSessionHandler()); + $pdo = new \PDO('mysql:dbname=testdb;host=127.0.0.1'); + $storage = new NativeSessionStorage(array(), new PdoSessionHandler($pdo)); $session = new Session($storage); Configuring PHP Sessions From f9f5b74fef8b29fb8e2599ae054583dafbc939c7 Mon Sep 17 00:00:00 2001 From: DOEO Date: Wed, 21 May 2014 12:52:44 +0200 Subject: [PATCH 08/10] Add filter cssrewrite According to : http://symfony.com/doc/current/cookbook/assetic/asset_management.html#cookbook-assetic-cssrewrite For keep link to image in CSS --- cookbook/assetic/uglifyjs.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cookbook/assetic/uglifyjs.rst b/cookbook/assetic/uglifyjs.rst index 19413842ca9..1c0d4d11a58 100644 --- a/cookbook/assetic/uglifyjs.rst +++ b/cookbook/assetic/uglifyjs.rst @@ -232,15 +232,16 @@ helper: .. code-block:: html+jinja - {% stylesheets '@AcmeFooBundle/Resources/public/css/*' filter='uglifycss' %} + {% stylesheets 'bundles/AcmeFoo/css/*' filter='uglifycss' filter='cssrewrite' %} {% endstylesheets %} .. code-block:: html+php stylesheets( - array('@AcmeFooBundle/Resources/public/css/*'), - array('uglifycss') + array('bundles/AcmeFoo/css/*'), + array('uglifycss'), + array('cssrewrite') ) as $url): ?> From be94cf7f9621c4f54bceeb1d86486c1ed71a3dba Mon Sep 17 00:00:00 2001 From: MarcomTeam Date: Tue, 20 May 2014 13:27:50 +0200 Subject: [PATCH 09/10] Update voters_data_permission.rst Strange $product variable... --- cookbook/security/voters_data_permission.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cookbook/security/voters_data_permission.rst b/cookbook/security/voters_data_permission.rst index 7e2db803b36..2af09241734 100644 --- a/cookbook/security/voters_data_permission.rst +++ b/cookbook/security/voters_data_permission.rst @@ -204,20 +204,18 @@ from the security context is called. class PostController extends Controller { - public function showAction() + public function showAction($id) { // get a Post instance - $post = ...; + $post = $this->getDoctrine() + ->getRepository('AcmeStoreBundle:Post') + ->find($id); // keep in mind, this will call all registered security voters if (false === $this->get('security.context')->isGranted('view', $post)) { throw new AccessDeniedException('Unauthorised access!'); } - $product = $this->getDoctrine() - ->getRepository('AcmeStoreBundle:Post') - ->find($id); - return new Response('

'.$post->getName().'

'); } } From 5794371a036ad6d826b0c1bad8bbf0c4e73609d1 Mon Sep 17 00:00:00 2001 From: MarcomTeam Date: Wed, 21 May 2014 09:52:23 +0200 Subject: [PATCH 10/10] Update voters_data_permission.rst agreed --- cookbook/security/voters_data_permission.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cookbook/security/voters_data_permission.rst b/cookbook/security/voters_data_permission.rst index 2af09241734..f6f52904f7a 100644 --- a/cookbook/security/voters_data_permission.rst +++ b/cookbook/security/voters_data_permission.rst @@ -207,10 +207,8 @@ from the security context is called. public function showAction($id) { // get a Post instance - $post = $this->getDoctrine() - ->getRepository('AcmeStoreBundle:Post') - ->find($id); - + $post = ...; + // keep in mind, this will call all registered security voters if (false === $this->get('security.context')->isGranted('view', $post)) { throw new AccessDeniedException('Unauthorised access!');