Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nucleos/NucleosUserBundle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.4.3
Choose a base ref
...
head repository: nucleos/NucleosUserBundle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.5.x
Choose a head ref
  • 19 commits
  • 57 files changed
  • 3 contributors

Commits on Mar 6, 2024

  1. Bumps changelog version to 3.5.0

    Updates the CHANGELOG.md file to add a changelog entry for a new 3.5.0 version.
    nucleos-bot committed Mar 6, 2024
    Copy the full SHA
    897ec86 View commit details

Commits on May 25, 2024

  1. Update dependency Pygments to v2.18.0

    renovate[bot] authored and core23 committed May 25, 2024

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    MylesBorins Myles Borins
    Copy the full SHA
    a1e8679 View commit details

Commits on May 26, 2024

  1. Fix bagdes in README

    core23 committed May 26, 2024
    Copy the full SHA
    21b16ff View commit details
  2. Bumps changelog version to 3.4.1

    Updates the CHANGELOG.md file to add a changelog entry for a new 3.4.1 version.
    nucleos-bot authored and core23 committed May 26, 2024
    Copy the full SHA
    17902e4 View commit details
  3. Update tools

    core23 committed May 26, 2024
    Copy the full SHA
    cd283cd View commit details
  4. Copy the full SHA
    efe4685 View commit details
  5. Copy the full SHA
    58f53b0 View commit details
  6. Copy the full SHA
    eb29f0b View commit details
  7. 3.4.1 readiness

    Updates the CHANGELOG.md to set the release date.
    nucleos-bot authored and core23 committed May 26, 2024
    Copy the full SHA
    9391908 View commit details

Commits on Aug 14, 2024

  1. Bumps changelog version to 3.4.2

    Updates the CHANGELOG.md file to add a changelog entry for a new 3.4.2 version.
    nucleos-bot authored and core23 committed Aug 14, 2024
    Copy the full SHA
    7890064 View commit details
  2. Fix unsetting locale

    core23 committed Aug 14, 2024
    Copy the full SHA
    ca8d198 View commit details
  3. 3.4.2 readiness

    Updates the CHANGELOG.md to set the release date.
    nucleos-bot authored and core23 committed Aug 14, 2024
    Copy the full SHA
    872f39a View commit details
  4. Bumps changelog version to 3.4.3

    Updates the CHANGELOG.md file to add a changelog entry for a new 3.4.3 version.
    nucleos-bot authored and core23 committed Aug 14, 2024
    Copy the full SHA
    082aa5d View commit details
  5. Fix setting locale

    core23 committed Aug 14, 2024
    Copy the full SHA
    bb873a5 View commit details
  6. 3.4.3 readiness

    Updates the CHANGELOG.md to set the release date.
    nucleos-bot authored and core23 committed Aug 14, 2024
    Copy the full SHA
    65877d8 View commit details
  7. Fix symfony deprecation

    core23 committed Aug 14, 2024
    Copy the full SHA
    727fe8a View commit details
  8. 3.5.0 readiness

    Updates the CHANGELOG.md to set the release date.
    nucleos-bot committed Aug 14, 2024
    Copy the full SHA
    f3b0c15 View commit details

Commits on Feb 8, 2025

  1. Copy the full SHA
    5ffe4fd View commit details
  2. Fix CS

    core23 committed Feb 8, 2025
    Copy the full SHA
    59cf7d0 View commit details
Showing with 2,069 additions and 2,592 deletions.
  1. +0 −2 .gitattributes
  2. +3 −0 .php-cs-fixer.dist.php
  3. +84 −0 CHANGELOG.md
  4. +0 −4 Makefile
  5. +1 −1 README.md
  6. +2 −0 composer.json
  7. +1 −1 docs/requirements.txt
  8. +7 −0 phpunit.xml.dist
  9. +0 −59 psalm-baseline.xml
  10. +0 −15 psalm.xml
  11. +6 −2 src/Action/ResetAction.php
  12. +1 −1 src/Command/ActivateUserCommand.php
  13. +1 −1 src/Command/ChangePasswordCommand.php
  14. +1 −1 src/Command/CreateUserCommand.php
  15. +1 −1 src/Command/DeactivateUserCommand.php
  16. +3 −3 src/Command/DemoteUserCommand.php
  17. +3 −3 src/Command/PromoteUserCommand.php
  18. +6 −10 src/DependencyInjection/NucleosUserExtension.php
  19. +1 −1 src/Event/GetResponseLoginEvent.php
  20. +1 −1 src/Event/UserEvent.php
  21. +21 −17 src/EventListener/LocaleEventListener.php
  22. +1 −1 src/Form/Type/LoginFormType.php
  23. +2 −2 src/Model/User.php
  24. +2 −2 src/Model/UserInterface.php
  25. +1 −1 src/Noop/Exception/NoDriverException.php
  26. +0 −1 src/NucleosUserBundle.php
  27. +1 −1 src/Security/LoginManager.php
  28. +1 −1 src/Security/SimpleLoginManager.php
  29. +4 −4 src/Security/UserProvider.php
  30. +1 −1 src/Util/SimpleUserManipulator.php
  31. +11 −13 src/Validator/Constraints/Pattern.php
  32. +1 −1 src/Validator/Constraints/PatternValidator.php
  33. +8 −2 tests/App/AppKernel.php
  34. +11 −1 tests/App/Entity/TestGroup.php
  35. +34 −1 tests/App/Entity/TestUser.php
  36. +37 −2 tests/App/config/config.php
  37. +1 −1 tests/Command/ActivateUserCommandTest.php
  38. +1 −1 tests/Command/ChangePasswordCommandTest.php
  39. +1 −1 tests/Command/CreateUserCommandTest.php
  40. +1 −1 tests/Command/DeactivateUserCommandTest.php
  41. +1 −1 tests/Command/DemoteUserCommandTest.php
  42. +1 −1 tests/Command/PromoteUserCommandTest.php
  43. +2 −2 tests/DependencyInjection/NucleosUserExtensionTest.php
  44. +178 −0 tests/EventListener/LocaleEventListenerTest.php
  45. +1 −1 tests/Form/Type/ResettingFormTypeTest.php
  46. +76 −0 tests/Functional/Action/AccountDeletionWebTest.php
  47. +73 −0 tests/Functional/Action/LoginWebTest.php
  48. +95 −0 tests/Functional/Action/RequestPasswordWebTest.php
  49. +66 −0 tests/Functional/Action/UpdateSecurityWebTest.php
  50. +74 −0 tests/Functional/DoctrineSetupTrait.php
  51. +3 −3 tests/Resources/XliffTest.php
  52. +1 −1 tests/Routing/RoutingTest.php
  53. +1 −1 tests/Security/SimpleLoginManagerTest.php
  54. +1 −1 tests/Validator/Constraints/PatternValidatorTest.php
  55. +33 −0 tests/bootstrap.php
  56. +1 −4 vendor-bin/tools/composer.json
  57. +1,200 −2,416 vendor-bin/tools/composer.lock
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@ infection.json export-ignore
Makefile export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
psalm-baseline.xml export-ignore
psalm.xml export-ignore
phpunit.xml.dist export-ignore
/docs export-ignore
/tests export-ignore
3 changes: 3 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -35,6 +35,9 @@
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
],
'phpdoc_to_comment' => [
'ignored_tags' => [],
],
'php_unit_internal_class' => false,
'php_unit_test_class_requires_covers' => false,
'no_superfluous_phpdoc_tags' => [
84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,90 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 3.5.0 - 2024-08-14


-----

### Release Notes for [3.5.0](https://github.com/nucleos/NucleosUserBundle/milestone/42)

Feature release (minor)

### 3.5.0

- Total issues resolved: **0**
- Total pull requests resolved: **2**
- Total contributors: **2**

#### Enhancement

- [764: Fix symfony deprecation](https://github.com/nucleos/NucleosUserBundle/pull/764) thanks to @core23

#### dependency

- [753: Update dependency Pygments to v2.18.0](https://github.com/nucleos/NucleosUserBundle/pull/753) thanks to @renovate[bot]

## 3.4.3 - 2024-07-07


-----

### Release Notes for [3.4.3](https://github.com/nucleos/NucleosUserBundle/milestone/44)

3.4.x bugfix release (patch)

### 3.4.3

- Total issues resolved: **0**
- Total pull requests resolved: **1**
- Total contributors: **1**

#### Bug

- [759: Fix setting locale](https://github.com/nucleos/NucleosUserBundle/pull/759) thanks to @core23

## 3.4.2 - 2024-07-07


-----

### Release Notes for [3.4.2](https://github.com/nucleos/NucleosUserBundle/milestone/43)

3.4.x bugfix release (patch)

### 3.4.2

- Total issues resolved: **0**
- Total pull requests resolved: **1**
- Total contributors: **1**

#### Bug

- [757: Fix unsetting locale](https://github.com/nucleos/NucleosUserBundle/pull/757) thanks to @core23

## 3.4.1 - 2024-05-20


-----

### Release Notes for [3.4.1](https://github.com/nucleos/NucleosUserBundle/milestone/41)

3.4.x bugfix release (patch)

### 3.4.1

- Total issues resolved: **0**
- Total pull requests resolved: **2**
- Total contributors: **1**

#### Bug

- [754: Fix translation of auth provider messages](https://github.com/nucleos/NucleosUserBundle/pull/754) thanks to @core23

#### Enhancement

- [751: Add functional tests for all actions](https://github.com/nucleos/NucleosUserBundle/pull/751) thanks to @core23

## 3.4.0 - 2024-03-06


4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -51,10 +51,6 @@ cs: vendor-bin/tools/vendor
cs-fix: vendor-bin/tools/vendor
vendor/bin/php-cs-fixer fix --verbose

.PHONY: psalm
psalm: vendor-bin/tools/vendor
vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4

.PHONY: phpstan
phpstan: vendor-bin/tools/vendor
vendor/bin/phpstan analyse
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ NucleosUserBundle
[![Monthly Downloads](https://poser.pugx.org/nucleos/user-bundle/d/monthly)](https://packagist.org/packages/nucleos/user-bundle)
[![Daily Downloads](https://poser.pugx.org/nucleos/user-bundle/d/daily)](https://packagist.org/packages/nucleos/user-bundle)

[![Continuous Integration](https://github.com/nucleos/NucleosUserBundle/workflows/Continuous%20Integration/badge.svg?event=push)](https://github.com/nucleos/NucleosUserBundle/actions?query=workflow%3A"Continuous+Integration"+event%3Apush)
[![Continuous Integration](https://github.com/nucleos/NucleosUserBundle/actions/workflows/continuous-integration.yml/badge.svg?event=push)](https://github.com/nucleos/NucleosUserBundle/actions?query=workflow%3A"Continuous+Integration"+event%3Apush)
[![Code Coverage](https://codecov.io/gh/nucleos/NucleosUserBundle/graph/badge.svg)](https://codecov.io/gh/nucleos/NucleosUserBundle)
[![Type Coverage](https://shepherd.dev/github/nucleos/NucleosUserBundle/coverage.svg)](https://shepherd.dev/github/nucleos/NucleosUserBundle)

2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -69,12 +69,14 @@
},
"require-dev": {
"ext-mongodb": "*",
"dama/doctrine-test-bundle": "^8.0",
"doctrine/doctrine-bundle": "^2.4",
"doctrine/mongodb-odm": "^2.3",
"doctrine/mongodb-odm-bundle": "^4.4 || ^5.0",
"doctrine/orm": "^2.18 || ^3.0",
"ergebnis/composer-normalize": "^2.0.1",
"symfony/browser-kit": "^6.4 || ^7.0",
"symfony/css-selector": "^6.4 || ^7.0",
"symfony/doctrine-bridge": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0"
},
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Pygments==2.17.2
Pygments==2.18.0
sphinx==6.2.1
sphinx_rtd_theme==2.0.0
7 changes: 7 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -3,12 +3,19 @@
<coverage/>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
<env name="APP_DEBUG" value="false"/>
<env name="APP_ENV" value="test"/>
<env name="KERNEL_CLASS" value="Nucleos\UserBundle\Tests\App\AppKernel"/>
<ini name="date.timezone" value="UTC"/>
</php>
<testsuites>
<testsuite name="UserBundle Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<extensions>
<bootstrap class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension"/>
</extensions>
<source>
<include>
<directory suffix=".php">./src/</directory>
59 changes: 0 additions & 59 deletions psalm-baseline.xml

This file was deleted.

15 changes: 0 additions & 15 deletions psalm.xml

This file was deleted.

8 changes: 6 additions & 2 deletions src/Action/ResetAction.php
Original file line number Diff line number Diff line change
@@ -115,11 +115,15 @@ public function __invoke(Request $request, string $token): Response

private function changePassword(UserInterface $user, Resetting $formModel): void
{
$user->setPlainPassword($formModel->getPlainPassword());
$password = $formModel->getPlainPassword();

\assert(null !== $password);

$user->setPlainPassword($password);
$this->userManager->updateUser($user);

if (null !== $this->userManipulator) {
$this->userManipulator->changePassword($user->getUsername(), $formModel->getPlainPassword());
$this->userManipulator->changePassword($user->getUsername(), $password);
}
}
}
2 changes: 1 addition & 1 deletion src/Command/ActivateUserCommand.php
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$this->userManipulator->activate($username);

$output->writeln(sprintf('User "%s" has been activated.', $username));
$output->writeln(\sprintf('User "%s" has been activated.', $username));

return 0;
}
2 changes: 1 addition & 1 deletion src/Command/ChangePasswordCommand.php
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$this->userManipulator->changePassword($username, $password);

$output->writeln(sprintf('Changed password for user <comment>%s</comment>', $username));
$output->writeln(\sprintf('Changed password for user <comment>%s</comment>', $username));

return 0;
}
2 changes: 1 addition & 1 deletion src/Command/CreateUserCommand.php
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$this->userManipulator->create($username, $password, $email, !$inactive, $superadmin);

$output->writeln(sprintf('Created user <comment>%s</comment>', $username));
$output->writeln(\sprintf('Created user <comment>%s</comment>', $username));

return 0;
}
2 changes: 1 addition & 1 deletion src/Command/DeactivateUserCommand.php
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$this->userManipulator->deactivate($username);

$output->writeln(sprintf('User "%s" has been deactivated.', $username));
$output->writeln(\sprintf('User "%s" has been deactivated.', $username));

return 0;
}
6 changes: 3 additions & 3 deletions src/Command/DemoteUserCommand.php
Original file line number Diff line number Diff line change
@@ -40,11 +40,11 @@ protected function executeRoleCommand(UserManipulator $manipulator, OutputInterf
{
if ($super) {
$manipulator->demote($username);
$output->writeln(sprintf('User "%s" has been demoted as a simple user. This change will not apply until the user logs out and back in again.', $username));
$output->writeln(\sprintf('User "%s" has been demoted as a simple user. This change will not apply until the user logs out and back in again.', $username));
} elseif ($manipulator->removeRole($username, $role)) {
$output->writeln(sprintf('Role "%s" has been removed from user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
$output->writeln(\sprintf('Role "%s" has been removed from user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
} else {
$output->writeln(sprintf('User "%s" didn\'t have "%s" role.', $username, $role));
$output->writeln(\sprintf('User "%s" didn\'t have "%s" role.', $username, $role));
}
}
}
6 changes: 3 additions & 3 deletions src/Command/PromoteUserCommand.php
Original file line number Diff line number Diff line change
@@ -40,11 +40,11 @@ protected function executeRoleCommand(UserManipulator $manipulator, OutputInterf
{
if ($super) {
$manipulator->promote($username);
$output->writeln(sprintf('User "%s" has been promoted as a super administrator. This change will not apply until the user logs out and back in again.', $username));
$output->writeln(\sprintf('User "%s" has been promoted as a super administrator. This change will not apply until the user logs out and back in again.', $username));
} elseif ($manipulator->addRole($username, $role)) {
$output->writeln(sprintf('Role "%s" has been added to user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
$output->writeln(\sprintf('Role "%s" has been added to user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
} else {
$output->writeln(sprintf('User "%s" did already have "%s" role.', $username, $role));
$output->writeln(\sprintf('User "%s" did already have "%s" role.', $username, $role));
}
}
}
16 changes: 6 additions & 10 deletions src/DependencyInjection/NucleosUserExtension.php
Original file line number Diff line number Diff line change
@@ -23,15 +23,15 @@
use Symfony\Component\Config\Loader\FileLoader;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

final class NucleosUserExtension extends Extension implements PrependExtensionInterface
{
/**
* @var array<string, array<string, string>>
* @var array<array{registry: string, tag: string, events: string[]}>
*/
private static array $doctrineDrivers = [
'orm' => [
@@ -73,7 +73,7 @@ public function load(array $configs, ContainerBuilder $container): void
$loader->load('doctrine.php');
$container->setAlias('nucleos_user.doctrine_registry', new Alias(self::$doctrineDrivers[$config['db_driver']]['registry'], false));
} else {
$loader->load(sprintf('%s.php', $config['db_driver']));
$loader->load(\sprintf('%s.php', $config['db_driver']));
}
$container->setParameter($this->getAlias().'.backend_type_'.$config['db_driver'], true);
}
@@ -84,7 +84,7 @@ public function load(array $configs, ContainerBuilder $container): void
}

foreach (['validator', 'security', 'util', 'mailer', 'listeners', 'commands'] as $basename) {
$loader->load(sprintf('%s.php', $basename));
$loader->load(\sprintf('%s.php', $basename));
}

if (!$config['use_authentication_listener']) {
@@ -103,10 +103,6 @@ public function load(array $configs, ContainerBuilder $container): void

if ($config['use_listener'] && isset(self::$doctrineDrivers[$config['db_driver']])) {
$listenerDefinition = $container->getDefinition('nucleos_user.user_listener');
if (isset(self::$doctrineDrivers[$config['db_driver']]['listener_class'])) {
$listenerDefinition->setClass(self::$doctrineDrivers[$config['db_driver']]['listener_class']);
}

foreach (self::$doctrineDrivers[$config['db_driver']]['events'] as $event) {
$listenerDefinition->addTag(self::$doctrineDrivers[$config['db_driver']]['tag'], ['event' => $event]);
}
@@ -190,7 +186,7 @@ private function remapParametersNamespaces(array $config, ContainerBuilder $cont
$this->remapParameters($namespaceConfig, $container, $map);
} else {
foreach ($namespaceConfig as $name => $value) {
$container->setParameter(sprintf($map, $name), $value);
$container->setParameter(\sprintf($map, $name), $value);
}
}
}
@@ -238,7 +234,7 @@ private function loadGroups(array $config, ContainerBuilder $container, FileLoad
if (isset(self::$doctrineDrivers[$dbDriver])) {
$loader->load('doctrine_group.php');
} else {
$loader->load(sprintf('%s_group.php', $dbDriver));
$loader->load(\sprintf('%s_group.php', $dbDriver));
}
}

Loading