Skip to content

Commit

Permalink
Merge branch hotfix/v2.3.28
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Sep 24, 2024
1 parent 6d3b3f4 commit dbae576
Show file tree
Hide file tree
Showing 46 changed files with 515 additions and 404 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2023 Ambroise Maupate, Julien Blanchet
Copyright © 2024 Ambroise Maupate, Julien Blanchet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ roadiz_rozier:
open_id:
# Verify User info in JWT at each login
verify_user_info: false
# Force generating redirect uri with https scheme. (required by some OpenID providers)
force_ssl_on_redirect_uri: true
# Standard OpenID autodiscovery URL, required to enable OpenId login in Roadiz CMS.
discovery_url: '%env(string:OPEN_ID_DISCOVERY_URL)%'
# For public identity providers (such as Google), restrict users emails by their domain.
Expand Down
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
}
],
"type": "symfony-bundle",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"symfony/framework-bundle": "5.4.*",
"roadiz/core-bundle": "2.2.*",
"roadiz/rozier": "2.2.*",
"roadiz/compat-bundle": "2.2.*",
"roadiz/openid": "2.2.*"
"symfony/framework-bundle": "6.4.*",
"roadiz/core-bundle": "2.3.*",
"roadiz/rozier": "2.3.*",
"roadiz/compat-bundle": "2.3.*",
"roadiz/openid": "2.3.*"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
Expand Down Expand Up @@ -54,8 +55,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-main": "2.3.x-dev",
"dev-develop": "2.4.x-dev"
}
}
}
1 change: 1 addition & 0 deletions config/packages/roadiz_rozier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ roadiz_rozier:
# OpenID identity provider OAuth2 client secret
oauth_client_secret: '%env(string:OPEN_ID_CLIENT_SECRET)%'
requires_local_user: false
force_ssl_on_redirect_uri: true
# Only when local users are not required, creating virtual users
# with following roles.
granted_roles:
Expand Down
4 changes: 0 additions & 4 deletions config/routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ webhooksRoutes:
# CSS to style with main color
# NOT SECURED ROUTES
#
cssMainColor:
path : /css/main-color.css
controller: Themes\Rozier\RozierApp::cssAction

loginImagePage:
path: /css/login/image
controller: Themes\Rozier\Controllers\LoginController::imageAction
Expand Down
3 changes: 3 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ services:
$addNodeFormTypeClass: '%roadiz_rozier.add_node_form.class%'
$googleServerId: '%roadiz_core.medias.google_server_id%'
$soundcloudClientId: '%roadiz_core.medias.soundcloud_client_id%'
$allowNodeTypeEdition: '%kernel.debug%'
$forceSslOnRedirectUri: '%roadiz_rozier.open_id.force_ssl_on_redirect_uri%'
$useGravatar: '%roadiz_core.use_gravatar%'

RZ\Roadiz\RozierBundle\:
resource: '../src/'
Expand Down
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 6
level: 7
paths:
- src
doctrine:
Expand All @@ -9,6 +9,8 @@ parameters:
- */bower_components/*
- */static/*
ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
- '#Call to an undefined method RZ\\Roadiz\\CoreBundle\\Repository#'
- '#Call to an undefined method RZ\\Roadiz\\UserBundle\\Repository#'
- '#Call to an undefined method Doctrine\\Persistence\\ObjectRepository#'
Expand All @@ -32,8 +34,6 @@ parameters:
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'

reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-doctrine/rules.neon
6 changes: 1 addition & 5 deletions src/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ final class Aliases
*/
public static function getAliases(): array
{
return [
\RZ\Roadiz\RozierBundle\Form\DocumentTranslationType::class => \Themes\Rozier\Forms\DocumentTranslationType::class,
\RZ\Roadiz\RozierBundle\Form\CustomFormType::class => \Themes\Rozier\Forms\CustomFormType::class,
\RZ\Roadiz\RozierBundle\ListManager\SessionListFilters::class => \Themes\Rozier\Utils\SessionListFilters::class,
];
return [];
}
}
17 changes: 7 additions & 10 deletions src/Controller/Document/DocumentArchiveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace RZ\Roadiz\RozierBundle\Controller\Document;

use Doctrine\Persistence\ManagerRegistry;
use League\Flysystem\FilesystemException;
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\Documents\DocumentArchiver;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
Expand All @@ -16,21 +17,15 @@
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Contracts\Translation\TranslatorInterface;
use Themes\Rozier\RozierApp;
use Twig\Error\RuntimeError;

final class DocumentArchiveController extends RozierApp
{
private ManagerRegistry $managerRegistry;
private TranslatorInterface $translator;
private DocumentArchiver $documentArchiver;

public function __construct(
ManagerRegistry $managerRegistry,
TranslatorInterface $translator,
DocumentArchiver $documentArchiver
private readonly ManagerRegistry $managerRegistry,
private readonly TranslatorInterface $translator,
private readonly DocumentArchiver $documentArchiver
) {
$this->managerRegistry = $managerRegistry;
$this->translator = $translator;
$this->documentArchiver = $documentArchiver;
}

/**
Expand All @@ -39,6 +34,8 @@ public function __construct(
* @param Request $request
*
* @return Response
* @throws FilesystemException
* @throws RuntimeError
*/
public function bulkDownloadAction(Request $request): Response
{
Expand Down
10 changes: 2 additions & 8 deletions src/Controller/Document/DocumentDuplicatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@
use Doctrine\Persistence\ManagerRegistry;
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\ListManager\QueryBuilderListManager;
use RZ\Roadiz\CoreBundle\ListManager\SessionListFilters;
use RZ\Roadiz\CoreBundle\Repository\DocumentRepository;
use RZ\Roadiz\RozierBundle\ListManager\SessionListFilters;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Themes\Rozier\RozierApp;

final class DocumentDuplicatesController extends RozierApp
{
private ManagerRegistry $managerRegistry;

/**
* @param ManagerRegistry $managerRegistry
*/
public function __construct(ManagerRegistry $managerRegistry)
public function __construct(private readonly ManagerRegistry $managerRegistry)
{
$this->managerRegistry = $managerRegistry;
}

/**
Expand Down
10 changes: 1 addition & 9 deletions src/Controller/Document/DocumentLimitationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,20 @@
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\Documents\Events\DocumentUpdatedEvent;
use RZ\Roadiz\RozierBundle\Form\DocumentLimitationsType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Themes\Rozier\RozierApp;

final class DocumentLimitationsController extends RozierApp
{
private ManagerRegistry $managerRegistry;

/**
* @param ManagerRegistry $managerRegistry
*/
public function __construct(ManagerRegistry $managerRegistry)
public function __construct(private readonly ManagerRegistry $managerRegistry)
{
$this->managerRegistry = $managerRegistry;
}

public function limitationsAction(Request $request, Document $document): Response
{
$this->denyAccessUnlessGranted('ROLE_ACCESS_DOCUMENTS_LIMITATIONS');

/** @var FormInterface $form */
$form = $this->createForm(DocumentLimitationsType::class, $document, [
'referer' => $request->get('referer'),
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Document/DocumentPublicListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\Entity\Folder;
use RZ\Roadiz\CoreBundle\Entity\Translation;
use RZ\Roadiz\CoreBundle\ListManager\SessionListFilters;
use RZ\Roadiz\Documents\Events\DocumentInFolderEvent;
use RZ\Roadiz\Documents\Events\DocumentOutFolderEvent;
use Symfony\Component\Form\ClickableInterface;
Expand All @@ -19,7 +20,6 @@
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotNull;
use Themes\Rozier\RozierApp;
use Themes\Rozier\Utils\SessionListFilters;
use Twig\Error\RuntimeError;

class DocumentPublicListController extends RozierApp
Expand Down
14 changes: 5 additions & 9 deletions src/Controller/Document/DocumentUnusedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,25 @@
use Doctrine\Persistence\ManagerRegistry;
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\ListManager\QueryBuilderListManager;
use RZ\Roadiz\CoreBundle\ListManager\SessionListFilters;
use RZ\Roadiz\CoreBundle\Repository\DocumentRepository;
use RZ\Roadiz\RozierBundle\ListManager\SessionListFilters;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Themes\Rozier\RozierApp;
use Twig\Error\RuntimeError;

final class DocumentUnusedController extends RozierApp
{
private ManagerRegistry $managerRegistry;

/**
* @param ManagerRegistry $managerRegistry
*/
public function __construct(ManagerRegistry $managerRegistry)
public function __construct(private readonly ManagerRegistry $managerRegistry)
{
$this->managerRegistry = $managerRegistry;
}

/**
* See unused documents.
*
* @param Request $request
* @param Request $request
* @return Response
* @throws RuntimeError
*/
public function unusedAction(Request $request): Response
{
Expand Down
23 changes: 12 additions & 11 deletions src/Controller/Login/LoginRequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace RZ\Roadiz\RozierBundle\Controller\Login;

use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use Psr\Log\LoggerInterface;
use RZ\Roadiz\CoreBundle\Form\LoginRequestForm;
use RZ\Roadiz\CoreBundle\Security\User\UserViewer;
Expand All @@ -12,20 +14,17 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Themes\Rozier\RozierApp;
use Twig\Error\RuntimeError;

final class LoginRequestController extends RozierApp
{
use LoginRequestTrait;

private LoggerInterface $logger;
private UrlGeneratorInterface $urlGenerator;
private UserViewer $userViewer;

public function __construct(LoggerInterface $logger, UrlGeneratorInterface $urlGenerator, UserViewer $userViewer)
{
$this->logger = $logger;
$this->urlGenerator = $urlGenerator;
$this->userViewer = $userViewer;
public function __construct(
private readonly LoggerInterface $logger,
private readonly UrlGeneratorInterface $urlGenerator,
private readonly UserViewer $userViewer
) {
}

protected function getUserViewer(): UserViewer
Expand All @@ -37,8 +36,9 @@ protected function getUserViewer(): UserViewer
* @param Request $request
*
* @return Response
* @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException
* @throws RuntimeError
* @throws ORMException
* @throws OptimisticLockException
*/
public function indexAction(Request $request): Response
{
Expand Down Expand Up @@ -70,6 +70,7 @@ public function indexAction(Request $request): Response

/**
* @return Response
* @throws RuntimeError
*/
public function confirmAction(): Response
{
Expand Down
21 changes: 5 additions & 16 deletions src/Controller/Node/RealmNodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@

final class RealmNodeController extends RozierApp
{
private ManagerRegistry $managerRegistry;
private TranslatorInterface $translator;
private EventDispatcherInterface $eventDispatcher;

public function __construct(
ManagerRegistry $managerRegistry,
TranslatorInterface $translator,
EventDispatcherInterface $eventDispatcher
private readonly ManagerRegistry $managerRegistry,
private readonly TranslatorInterface $translator,
private readonly EventDispatcherInterface $eventDispatcher
) {
$this->managerRegistry = $managerRegistry;
$this->translator = $translator;
$this->eventDispatcher = $eventDispatcher;
}

public function defaultAction(Request $request, Node $id): Response
Expand Down Expand Up @@ -65,9 +58,7 @@ public function defaultAction(Request $request, Node $id): Response
'node.%node%.joined.%realm%',
[
'%node%' => $nodeSource->getTitle(),
'%realm%' => $realmNode->getRealm() ?
$realmNode->getRealm()->getName() :
$this->translator->trans('node.no_realm')
'%realm%' => $realmNode->getRealm()->getName()
]
);
$this->publishConfirmMessage($request, $msg);
Expand Down Expand Up @@ -118,9 +109,7 @@ public function deleteAction(Request $request, int $id, int $realmNodeId): Respo
'node.%node%.left.%realm%',
[
'%node%' => $nodeSource->getTitle(),
'%realm%' => $realmNode->getRealm() ?
$realmNode->getRealm()->getName() :
$this->translator->trans('node.no_realm')
'%realm%' => $realmNode->getRealm()->getName()
]
);
$this->publishConfirmMessage($request, $msg);
Expand Down
8 changes: 1 addition & 7 deletions src/Controller/Node/SeoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,8 @@

final class SeoController extends RozierApp
{
private FormFactoryInterface $formFactory;

/**
* @param FormFactoryInterface $formFactory
*/
public function __construct(FormFactoryInterface $formFactory)
public function __construct(private readonly FormFactoryInterface $formFactory)
{
$this->formFactory = $formFactory;
}

public function editAliasesAction(
Expand Down
8 changes: 1 addition & 7 deletions src/Controller/Node/TranslateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@

final class TranslateController extends RozierApp
{
private NodeTranslator $nodeTranslator;

/**
* @param NodeTranslator $nodeTranslator
*/
public function __construct(NodeTranslator $nodeTranslator)
public function __construct(private readonly NodeTranslator $nodeTranslator)
{
$this->nodeTranslator = $nodeTranslator;
}

public function translateAction(Request $request, Node $nodeId): Response
Expand Down
Loading

0 comments on commit dbae576

Please sign in to comment.