From cd2974d340da8d755f3214d589d56b947ab27c30 Mon Sep 17 00:00:00 2001 From: Andras Ratz Date: Sat, 1 Nov 2014 13:15:16 +0100 Subject: [PATCH] fix suggessions from sensiolabs insight --- .gitignore | 2 +- .../views/Page/index.html.twig | 2 +- .../LiipSearchBundle/views/layout.html.twig | 2 +- .../views/Exception/error.html.twig | 2 +- app/autoload.php | 2 +- app/config/config.yml | 3 +- app/config/parameters.yml.dist | 7 +- app/config/security.yml | 10 +- jack | 1 - .../SandboxMainExtension.php | 7 +- .../MainBundle/Resources/config/services.xml | 19 +++ .../MainBundle/Resources/config/services.yml | 11 -- web/config.php | 124 ------------------ 13 files changed, 41 insertions(+), 151 deletions(-) create mode 100644 src/Sandbox/MainBundle/Resources/config/services.xml delete mode 100644 src/Sandbox/MainBundle/Resources/config/services.yml delete mode 100644 web/config.php diff --git a/.gitignore b/.gitignore index c3ff56ce..d8d767a7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,4 @@ app/bootstrap.php.cache app/SymfonyRequirements.php /bin/ /app/app.sqlite -app/check.php \ No newline at end of file +app/check.php diff --git a/app/Resources/CmfSimpleCmsBundle/views/Page/index.html.twig b/app/Resources/CmfSimpleCmsBundle/views/Page/index.html.twig index 8cfbc3ae..e211243e 100644 --- a/app/Resources/CmfSimpleCmsBundle/views/Page/index.html.twig +++ b/app/Resources/CmfSimpleCmsBundle/views/Page/index.html.twig @@ -6,4 +6,4 @@ {{ rdf|raw }} {% endcreatephp %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/Resources/LiipSearchBundle/views/layout.html.twig b/app/Resources/LiipSearchBundle/views/layout.html.twig index 098b644c..821b1b6d 100644 --- a/app/Resources/LiipSearchBundle/views/layout.html.twig +++ b/app/Resources/LiipSearchBundle/views/layout.html.twig @@ -1 +1 @@ -{% extends "SandboxMainBundle::skeleton.html.twig" %} \ No newline at end of file +{% extends "SandboxMainBundle::skeleton.html.twig" %} diff --git a/app/Resources/TwigBundle/views/Exception/error.html.twig b/app/Resources/TwigBundle/views/Exception/error.html.twig index 41b7638d..c73ade77 100644 --- a/app/Resources/TwigBundle/views/Exception/error.html.twig +++ b/app/Resources/TwigBundle/views/Exception/error.html.twig @@ -16,4 +16,4 @@ reload-fixtures.php

- \ No newline at end of file + diff --git a/app/autoload.php b/app/autoload.php index 5fdae46c..5876176e 100644 --- a/app/autoload.php +++ b/app/autoload.php @@ -21,4 +21,4 @@ AnnotationRegistry::registerLoader(array($loader, 'loadClass')); AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php'); -return $loader; \ No newline at end of file +return $loader; diff --git a/app/config/config.yml b/app/config/config.yml index 25d0cbc9..eb37c45e 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -13,7 +13,8 @@ framework: validation: { enable_annotations: true } templating: { engines: ['twig'] } #assets_version: SomeVersionScheme default_locale: %locale% - session: ~ + session: + name: symfony-cmf trusted_proxies: ~ # Twig Configuration diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index b16bb33e..2e7eb4a8 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -2,7 +2,7 @@ parameters: locale: en locales: [en, fr, de] - secret: ThisTokenIsNotSoSecretChangeIt + secret: bcd39bfa638e42bfd1628d8d7c269841 # a little hack to avoid errors on missing node/coffeescript. # remove -disabled if you want coffee. @@ -22,3 +22,8 @@ parameters: mailer_host: localhost mailer_user: ~ mailer_password: ~ + + #user + security_user_password: $2y$12$zoziRrBLGcLloghFoj6rje1DVgmngducslRKduhQy9HVGCXKP0WYi + #admin + security_admin_password: $2y$12$j1vardxXG7oBRg/0MXqNP.oXdTlR0foxgeLGqnlypTpmFMiMtdlry \ No newline at end of file diff --git a/app/config/security.yml b/app/config/security.yml index dec235d1..6d58f70e 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -1,6 +1,8 @@ security: encoders: - Symfony\Component\Security\Core\User\User: plaintext + Symfony\Component\Security\Core\User\User: + algorithm: bcrypt + cost: 12 role_hierarchy: ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN, CAN_VIEW_NON_PUBLISHED] @@ -10,8 +12,8 @@ security: in_memory: memory: users: - user: { password: user, roles: [ 'ROLE_USER' ] } - admin: { password: admin, roles: [ 'ROLE_ADMIN' ] } + user: { password: %security_user_password%, roles: [ 'ROLE_USER' ] } + admin: { password: %security_admin_password%, roles: [ 'ROLE_ADMIN' ] } firewalls: dev: @@ -28,4 +30,4 @@ security: - { path: ^(/(de|fr|en))?/admin, roles: ROLE_ADMIN } #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/efconnect, role: ROLE_USER } - - { path: ^/elfinder, role: ROLE_USER } \ No newline at end of file + - { path: ^/elfinder, role: ROLE_USER } diff --git a/jack b/jack index 0dde3566..f2c67636 100755 --- a/jack +++ b/jack @@ -133,7 +133,6 @@ case "$action" in flush:article) [ -z $args ] && args=$(date +%Y/%m/%d) [ $args = "all" ] && args="" - # TODO extract port from $args curl -X DELETE http://admin:admin@localhost:8080/server/nzz/jcr:root/article/$args ;; diff --git a/src/Sandbox/MainBundle/DependencyInjection/SandboxMainExtension.php b/src/Sandbox/MainBundle/DependencyInjection/SandboxMainExtension.php index 2b846a1e..3ac6176e 100644 --- a/src/Sandbox/MainBundle/DependencyInjection/SandboxMainExtension.php +++ b/src/Sandbox/MainBundle/DependencyInjection/SandboxMainExtension.php @@ -3,15 +3,14 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\ContainerBuilder; -//TODO: make config xml instead of yml -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\Config\FileLocator; class SandboxMainExtension extends Extension { public function load(array $configs, ContainerBuilder $container) { - $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.yml'); + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.xml'); } } diff --git a/src/Sandbox/MainBundle/Resources/config/services.xml b/src/Sandbox/MainBundle/Resources/config/services.xml new file mode 100644 index 00000000..c02338c3 --- /dev/null +++ b/src/Sandbox/MainBundle/Resources/config/services.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Sandbox/MainBundle/Resources/config/services.yml b/src/Sandbox/MainBundle/Resources/config/services.yml deleted file mode 100644 index 0c40b0df..00000000 --- a/src/Sandbox/MainBundle/Resources/config/services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - sandbox_main.controller: - class: Sandbox\MainBundle\Controller\ContentController - parent: cmf_content.controller - - sandbox_main.debugListener: - class: Sandbox\MainBundle\EventListener\SandboxExceptionListener - calls: - - [ setContainer, [@service_container] ] - tags: - - {name: "kernel.event_subscriber"} diff --git a/web/config.php b/web/config.php deleted file mode 100644 index 162acfc7..00000000 --- a/web/config.php +++ /dev/null @@ -1,124 +0,0 @@ -getFailedRequirements(); -$minorProblems = $symfonyRequirements->getFailedRecommendations(); - -?> - - - - - - Symfony Configuration - - - - - -
-
- - - -
- -
-
-
-

Welcome!

-

Welcome to your new Symfony project.

-

- This script will guide you through the basic configuration of your project. - You can also do the same by editing the ‘app/config/parameters.yml’ file directly. -

- - -

Major problems

-

Major problems have been detected and must be fixed before continuing:

-
    - -
  1. getHelpHtml() ?>
  2. - -
- - - -

Recommendations

-

- Additionally, toTo enhance your Symfony experience, - it’s recommended that you fix the following: -

-
    - -
  1. getHelpHtml() ?>
  2. - -
- - - hasPhpIniConfigIssue()): ?> -

* - getPhpIniConfigPath()): ?> - Changes to the php.ini file must be done in "getPhpIniConfigPath() ?>". - - To change settings, create a "php.ini". - -

- - - -

Your configuration looks good to run Symfony.

- - - -
-
-
-
Symfony Standard Edition
-
- -