-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nucleos/dev
Import sonata code
- Loading branch information
Showing
92 changed files
with
7,621 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,6 @@ jobs: | |
|
||
symfony: | ||
- ~4.4 | ||
- ~5.0 | ||
|
||
steps: | ||
- name: "Checkout" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,132 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#" | ||
count: 1 | ||
path: src/Action/LoginAction.php | ||
|
||
- | ||
message: "#^Call to method Symfony\\\\Component\\\\HttpFoundation\\\\Request\\:\\:hasSession\\(\\) will always evaluate to true\\.$#" | ||
count: 1 | ||
path: src/Action/LoginAction.php | ||
|
||
- | ||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$node of method Nucleos\\\\ProfileBundle\\\\DependencyInjection\\\\Configuration\\:\\:addRegistrationSection\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition, Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition given\\.$#" | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\DependencyInjection\\\\NucleosUserAdminExtension\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
path: src/DependencyInjection/NucleosUserAdminExtension.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$node of method Nucleos\\\\ProfileBundle\\\\DependencyInjection\\\\Configuration\\:\\:addProfileSection\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition, Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition given\\.$#" | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\DependencyInjection\\\\NucleosUserAdminExtension\\:\\:fixImpersonating\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
path: src/DependencyInjection/NucleosUserAdminExtension.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$node of method Nucleos\\\\ProfileBundle\\\\DependencyInjection\\\\Configuration\\:\\:addServiceSection\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition, Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition given\\.$#" | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\DependencyInjection\\\\NucleosUserAdminExtension\\:\\:fixImpersonating\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/Configuration.php | ||
path: src/DependencyInjection/NucleosUserAdminExtension.php | ||
|
||
- | ||
message: "#^Cannot call method end\\(\\) on Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\|null\\.$#" | ||
count: 3 | ||
path: src/DependencyInjection/Configuration.php | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\DependencyInjection\\\\NucleosUserAdminExtension\\:\\:configureAdminClass\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/NucleosUserAdminExtension.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\DependencyInjection\\\\NucleosUserAdminExtension\\:\\:configureTranslationDomain\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/NucleosUserAdminExtension.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\DependencyInjection\\\\NucleosUserAdminExtension\\:\\:configureController\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/DependencyInjection/NucleosUserAdminExtension.php | ||
|
||
- | ||
message: "#^Property Nucleos\\\\UserAdminBundle\\\\Form\\\\Transformer\\\\RestoreRolesTransformer\\:\\:\\$originalRoles type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Form/Transformer/RestoreRolesTransformer.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Form\\\\Transformer\\\\RestoreRolesTransformer\\:\\:setOriginalRoles\\(\\) has parameter \\$originalRoles with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Form/Transformer/RestoreRolesTransformer.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Form\\\\Type\\\\SecurityRolesType\\:\\:buildForm\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Form/Type/SecurityRolesType.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Form\\\\Type\\\\SecurityRolesType\\:\\:buildView\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Form/Type/SecurityRolesType.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\Authorization\\\\Voter\\\\UserAclVoter\\:\\:vote\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/Authorization/Voter/UserAclVoter.php | ||
|
||
- | ||
message: "#^Property Nucleos\\\\UserAdminBundle\\\\Security\\\\EditableRolesBuilder\\:\\:\\$rolesHierarchy type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/EditableRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\EditableRolesBuilder\\:\\:__construct\\(\\) has parameter \\$rolesHierarchy with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/EditableRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\AdminRolesBuilder\\:\\:getRoles\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/AdminRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\ExpandableRolesBuilderInterface\\:\\:getExpandedRoles\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/ExpandableRolesBuilderInterface.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\RolesBuilderInterface\\:\\:getRoles\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/RolesBuilderInterface.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\SecurityRolesBuilder\\:\\:__construct\\(\\) has parameter \\$rolesHierarchy with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/SecurityRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\SecurityRolesBuilder\\:\\:getHierarchy\\(\\) should return array\\<array\\> but returns array\\<int\\|string, array\\|string\\>\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/SecurityRolesBuilder.php | ||
|
||
- | ||
message: "#^Strict comparison using \\=\\=\\= between false and array\\<int\\|string, array\\(\\)\\|string\\> will always evaluate to false\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/SecurityRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\SecurityRolesBuilder\\:\\:getSecurityRoles\\(\\) has parameter \\$hierarchy with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/SecurityRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\SecurityRolesBuilder\\:\\:recursiveArraySearch\\(\\) has parameter \\$roles with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/Security/RolesBuilder/SecurityRolesBuilder.php | ||
|
||
- | ||
message: "#^Method Nucleos\\\\UserAdminBundle\\\\Tests\\\\Action\\\\LoginActionTest\\:\\:unauthenticatedProvider\\(\\) return type has no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: tests/Action/LoginActionTest.php | ||
|
||
- | ||
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with true and string will always evaluate to true\\.$#" | ||
count: 1 | ||
path: tests/Resources/XliffTest.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the NucleosUserAdminBundle package. | ||
* | ||
* (c) Christian Gripp <mail@core23.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nucleos\UserAdminBundle\Action; | ||
|
||
use Sonata\AdminBundle\Admin\Pool; | ||
use Sonata\AdminBundle\Templating\TemplateRegistryInterface; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | ||
use Twig\Environment; | ||
|
||
final class CheckEmailAction | ||
{ | ||
/** | ||
* @var Environment | ||
*/ | ||
private $twig; | ||
|
||
/** | ||
* @var UrlGeneratorInterface | ||
*/ | ||
private $urlGenerator; | ||
|
||
/** | ||
* @var Pool | ||
*/ | ||
private $adminPool; | ||
|
||
/** | ||
* @var TemplateRegistryInterface | ||
*/ | ||
private $templateRegistry; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $resetTtl; | ||
|
||
public function __construct( | ||
Environment $twig, | ||
UrlGeneratorInterface $urlGenerator, | ||
Pool $adminPool, | ||
TemplateRegistryInterface $templateRegistry, | ||
int $resetTtl | ||
) { | ||
$this->twig = $twig; | ||
$this->urlGenerator = $urlGenerator; | ||
$this->adminPool = $adminPool; | ||
$this->templateRegistry = $templateRegistry; | ||
$this->resetTtl = $resetTtl; | ||
} | ||
|
||
public function __invoke(Request $request): Response | ||
{ | ||
$username = trim($request->query->get('username', '')); | ||
|
||
if ('' === $username) { | ||
// the user does not come from the sendEmail action | ||
return new RedirectResponse($this->urlGenerator->generate('nucleos_user_admin_resetting_request')); | ||
} | ||
|
||
return new Response( | ||
$this->twig->render('@NucleosUserAdmin/Admin/Security/Resetting/checkEmail.html.twig', [ | ||
'base_template' => $this->templateRegistry->getTemplate('layout'), | ||
'admin_pool' => $this->adminPool, | ||
'tokenLifetime' => ceil($this->resetTtl / 3600), | ||
]) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the NucleosUserAdminBundle package. | ||
* | ||
* (c) Christian Gripp <mail@core23.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nucleos\UserAdminBundle\Action; | ||
|
||
use RuntimeException; | ||
|
||
final class CheckLoginAction | ||
{ | ||
public function __invoke(): void | ||
{ | ||
throw new RuntimeException( | ||
'You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.' | ||
); | ||
} | ||
} |
Oops, something went wrong.