Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
# Dedicated config for Admin Endpoint, these are the common rules for all environments (dev, prod, test)
# They specify the dedicated security rules and routing mostly
imports:
- { resource: security.yml }
- { resource: services.yml }
framework:
router:
resource: "%kernel.project_dir%/app/config/admin/routing.yml"
strict_requirements: ~
session:
cookie_secure: 'auto'
ux_icons:
icon_dir: '%prestashop.admin_dir%/themes/new-theme/icons'
api_platform:
# Swagger API doc is accessible from the BackOffice, you need to be logged in to access it
title: Backoffice API
version: 0.1.0
enable_docs: true
enable_entrypoint: false
enable_swagger: true
enable_swagger_ui: true
enable_re_doc: true
docs_formats:
# This is used to allow using the Swagger UI in HTML presentation
html: [ 'text/html' ]
json: [ 'application/json' ]
oauth:
enabled: true
type: 'oauth2'
flow: 'clientCredentials'
tokenUrl: '/admin-api/access_token'

View File

@@ -0,0 +1,9 @@
imports:
- { resource: ../config_dev.yml }
- { resource: config.yml }
framework:
router:
resource: "%kernel.project_dir%/app/config/admin/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }

View File

@@ -0,0 +1,8 @@
imports:
- { resource: ../config_prod.yml }
- { resource: config.yml }
# We use a custom error controller instead of templates override so that this is customized only for back office,
# or it messes with Admin API default error pages
framework:
error_controller: PrestaShopBundle\Controller\Admin\ErrorController::showAction

View File

@@ -0,0 +1,8 @@
imports:
- { resource: ../config_test.yml }
- { resource: config.yml }
framework:
router:
resource: "%kernel.project_dir%/app/config/admin/routing_test.yml"
strict_requirements: ~

View File

@@ -0,0 +1,9 @@
app:
# The main bundle is PrestaShopCoreBundle which will load other dependencies.
resource: "@PrestaShopBundle/Resources/config/routing.yml"
app_modules:
# Declare routing.yml file in modules/module-name/config folder.
# v1: only YAML format is supported for now.
resource: .
type: module

View File

@@ -0,0 +1,14 @@
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
_errors:
resource: "@FrameworkBundle/Resources/config/routing/errors.xml"
prefix: /_error
_main:
resource: routing.yml

View File

@@ -0,0 +1,5 @@
_main:
resource: routing.yml
test:
resource: "../../../tests/Resources/config/routes.yml"

View File

@@ -0,0 +1,51 @@
# Security rules for Admin Application
# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:
enable_authenticator_manager: true
password_hashers:
# auto hasher with custom options for all PasswordAuthenticatedUserInterface instances
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
algorithm: 'auto'
cost: 15
Symfony\Component\Security\Core\User\User: plaintext
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
in_memory:
memory: ~
admin:
id: prestashop.security.admin.provider
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: admin
form_login:
login_path: admin_login
check_path: admin_login
username_parameter: email
password_parameter: passwd
success_handler: PrestaShopBundle\Security\Admin\AdminAuthenticationSuccessHandler
remember_me:
secret: "%kernel.secret%"
lifetime: "%prestashop.admin_cookie_lifetime%"
remember_me_parameter: stay_logged_in
signature_properties: [ 'password' ]
logout:
path: /logout
target: admin_login
access_control:
- { route: 'admin_login', roles: PUBLIC_ACCESS }
- { route: 'admin_homepage', roles: PUBLIC_ACCESS }
- { route: 'admin_request_password_reset', roles: PUBLIC_ACCESS }
- { route: 'admin_reset_password', roles: PUBLIC_ACCESS }
# Check it the legacy anonymous attribute has been set on the request (set by LegacyRouterChecker)
- { path: ^/, roles: IS_AUTHENTICATED, allow_if: 'request.attributes.has("_anonymous_controller") and request.attributes.get("_anonymous_controller") == true' }

View File

@@ -0,0 +1,76 @@
# Dedicated services for Admin app
services:
_defaults:
public: false
autowire: true
autoconfigure: true
# SECURITY
PrestaShopBundle\EventListener\Admin\TokenizedUrlsListener:
autowire: true
arguments:
$map: '@security.access_map'
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
PrestaShopBundle\EventListener\Admin\EmployeeSessionSubscriber:
autowire: true
autoconfigure: true
arguments:
$entityManager: '@doctrine.orm.default_entity_manager'
# Priority 40 to be called before the RouterListener (which has priority 32)
PrestaShopBundle\EventListener\Admin\LegacyUrlListener:
arguments:
- "@prestashop.bundle.routing.converter.legacy_url_converter"
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 40 }
# Priority 30 to be called after the RouterListener
PrestaShopBundle\EventListener\Admin\LegacyParametersListener:
arguments:
- "@prestashop.bundle.routing.converter.legacy_parameters_converter"
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 30 }
PrestaShopBundle\EventListener\Admin\AccessDeniedListener:
autowire: true
tags:
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException }
PrestaShopBundle\EventListener\Admin\AdminSecurityListener:
autowire: true
tags:
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
PrestaShopBundle\EventListener\Admin\BackUrlRedirectResponseListener:
arguments:
- '@PrestaShop\PrestaShop\Core\Util\Url\BackUrlProvider'
- "@prestashop.adapter.legacy.context"
tags:
- { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }
# Locale listener to define translator locale correctly
PrestaShopBundle\EventListener\Admin\UserLocaleSubscriber: ~
PrestaShopBundle\EventListener\Admin\DemoModeEnabledListener: ~
# Context listeners, these are event subscribers, so they define their priority themselves
PrestaShopBundle\EventListener\Admin\Context\EmployeeContextSubscriber: ~
PrestaShopBundle\EventListener\Admin\Context\LanguageContextSubscriber: ~
PrestaShopBundle\EventListener\Admin\Context\ShopContextSubscriber: ~
PrestaShopBundle\EventListener\Admin\Context\CurrencyContextSubscriber: ~
PrestaShopBundle\EventListener\Admin\Context\CountryContextSubscriber: ~
PrestaShopBundle\EventListener\Admin\Context\LegacyControllerContextSubscriber: ~
PrestaShopBundle\EventListener\Admin\Context\LegacyContextSubscriber:
autowire: true
autoconfigure: true
arguments:
$legacyBuilders: !tagged_iterator core.legacy_context_builder
# SSL middleware
PrestaShopBundle\EventListener\Admin\SSLMiddlewareListener:
autowire: true
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }