Git Product home page Git Product logo

contao-password-validation's Introduction

terminal42/contao-password-validation

A Contao bundle that validates user passwords against your password policy.

Features

  • Validate a password against your organization policies
  • Force members to do a password-change

Installation

Choose the installation method that matches your workflow!

Installation via Contao Manager

Search for terminal42/contao-password-validation in the Contao Manager and add it to your installation. Finally, update the packages.

Manual installation

Add a composer dependency for this bundle. Therefore, change in the project root and run the following:

composer require terminal42/contao-password-validation

Depending on your environment, the command can differ, i.e. starting with php composer.phar … if you do not have composer installed globally.

Then, update the database via the Contao install tool.

Configuration

Password validation

Add the following configuration parameters to your app/config/config.yml:
(Skip options that you do not need)

terminal42_password_validation:
  Contao\FrontendUser:
    min_length: 10
    max_length: 20
    require:
      uppercase: 1
      lowercase: 1
      numbers: 1
      other: 1
    other_chars: "+*ç%&/()=?"
    password_history: 10
    change_days: 90
    haveibeenpwned: 1
  Contao\BackendUser:
    min_length: 10
    haveibeenpwned: 1
Parameter Purpose
password_history: Keep track of the latest n passwords, and force the users not to choose one of their recent passwords.
change_days: Ask the user to change their password after certain days.
haveibeenpwned: Check the user password against known data breaches reported to ';--have i been pwned?. The configuration allows you to specify an integer to define the minimum number of data breaches the password needs to occur in to fail password validation.

Password-change

  1. Create a "password-change" page and place a password-change module on it. Select this page as password-change page in the page root.
  2. You can now force members to change their passwords by ticking the corresponding checkbox in the member edit-mask.

Add your own password validator

You can add your own validation rule, e.g. a dictionary check.

Create a class that implements PasswordValidatorInterface. Then, create and tag a corresponding service.

  app.password_validation.validator.dictionary:
    class: App\PasswordValidation\Validator\Dictionary
    tags:
      - { name: terminal42_password_validation.validator, alias: dictionary }

License

This bundle is released under the MIT license

contao-password-validation's People

Contributors

aschempp avatar flyer303 avatar fritzmg avatar richardhj avatar taca avatar zonky2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

contao-password-validation's Issues

PHP 8?

Da Ticket #9 geschlossen wurde und mein nachträglicher Kommentar (vermutlich) deshalb nicht mehr berücksichtigt wurde, erlaube ich mir hierfür ein neues Ticket zu eröffnen.

Contao 4.11.19
Contao Manager 1.4.10
PHP Version 8.0.13

Inzwischen kann ich die Erweiterung zwar installieren, der Aufruf des Install-Tools fält dann aber auf die Nase (HTTP ERROR 500) und die anschliessende Systemprüfung oder auch die versuchte Systemwiederherstellung gibt folgenden Fehler aus (Konsolenausgabe):

vendor/bin/contao-console contao:version
$ /opt/plesk/php/8.0/bin/php -q -dmax_execution_time=0 -dmemory_limit=-1 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=Europe/Zurich /home/httpd/vhosts/ha/tld/vendor/contao/manager-bundle/bin/contao-console cache:clear --env=prod --no-warmup
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Symfony\Component\Config\Definition\Builder\TreeBuilder::__construct(), 0 passed in /home/httpd/vhosts/ha/tld/vendor/terminal42/contao-password-validation/src/DependencyInjection/Configuration.php on line 23 and at least 1 expected in /home/httpd/vhosts/ha/tld/vendor/symfony/config/Definition/Builder/TreeBuilder.php:26
Stack trace:
#0 /home/httpd/vhosts/ha/tld/vendor/terminal42/contao-password-validation/src/DependencyInjection/Configuration.php(23): Symfony\Component\Config\Definition\Builder\TreeBuilder->__construct()
#1 /home/httpd/vhosts/ha/tld/vendor/symfony/config/Definition/Processor.php(50): Terminal42\PasswordValidationBundle\DependencyInjection\Configuration->getConfigTreeBuilder()
#2 /home/httpd/vhosts/ha/tld/vendor/symfony/dependency-injection/Extension/Extension.php(111): Symfony\Component\Config\Definition\Processor->processConfiguration(Object(Terminal42\PasswordValidationBundle\DependencyInjection\Configuration), Array)
#3 /home/httpd/vhosts/ha/tld/vendor/terminal42/contao-password-validation/src/DependencyInjection/Terminal42PasswordValidationExtension.php(34): Symfony\Component\DependencyInjection\Extension\Extension->processConfiguration(Object(Terminal42\PasswordValidationBundle\DependencyInjection\Configuration), Array)
#4 /home/httpd/vhosts/ha/tld/vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php(76): Terminal42\PasswordValidationBundle\DependencyInjection\Terminal42PasswordValidationExtension->load(Array, Object(Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder))
#5 /home/httpd/vhosts/ha/tld/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php(39): Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process(Object(Contao\ManagerPlugin\Config\ContainerBuilder))
#6 /home/httpd/vhosts/ha/tld/vendor/symfony/dependency-injection/Compiler/Compiler.php(91): Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process(Object(Contao\ManagerPlugin\Config\ContainerBuilder))
#7 /home/httpd/vhosts/ha/tld/vendor/symfony/dependency-injection/ContainerBuilder.php(731): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Contao\ManagerPlugin\Config\ContainerBuilder))
#8 /home/httpd/vhosts/ha/tld/vendor/symfony/http-kernel/Kernel.php(541): Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#9 /home/httpd/vhosts/ha/tld/vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php(321): Symfony\Component\HttpKernel\Kernel->initializeContainer()
#10 /home/httpd/vhosts/ha/tld/vendor/symfony/http-kernel/Kernel.php(780): Contao\ManagerBundle\HttpKernel\ContaoKernel->initializeContainer()
#11 /home/httpd/vhosts/ha/tld/vendor/symfony/http-kernel/Kernel.php(121): Symfony\Component\HttpKernel\Kernel->preBoot()
#12 /home/httpd/vhosts/ha/tld/vendor/symfony/framework-bundle/Console/Application.php(168): Symfony\Component\HttpKernel\Kernel->boot()
#13 /home/httpd/vhosts/ha/tld/vendor/symfony/framework-bundle/Console/Application.php(74): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
#14 /home/httpd/vhosts/ha/tld/vendor/symfony/console/Application.php(166): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/httpd/vhosts/ha/tld/vendor/contao/manager-bundle/bin/contao-console(37): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#16 {main}
  thrown in /home/httpd/vhosts/ha/tld/vendor/symfony/config/Definition/Builder/TreeBuilder.php on line 26
# Process terminated with exit code 255
# Result: Unknown error

Backend und Installtool sind erst nach einer Deinstallation der Erweiterung im abgesicherten Modus wieder erreichbar.
Identisches Verhalten übrigens auch nach Update von Contao auf V4.12.3.

validation doesn't work with mod_lostPassword

The validation doesn't work with mod_lostPassword, do I have to activate it here... if so, how?

With mod_lostPassword, only the standard Contao password policy is valid, i.e. at least 8 characters and PW: 12345678 are also possible.

Contao: Version 4.9.35

Thanks

Contao 5.x

Hi,

is there already a date for Contao 5.x?

Regards, Andi

No config on fallback root pages

If I check the language fallback checkbox in a root page the palette for page selection is gone after page refresh.
If I remove the checkmark it works again.

Contao version 4.9.4

Wrong login causes error message

If an incorrect password is entered in the frontend (Member), an SQL error is generated.

A timestamp is set as value for the "disabled" field. But the corresponding field in the database at tl_meber is char(1).

Change the field to char(10) in contao/dca/tl_member.php fixed the problem.

request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'UPDATE tl_member SET id='3', tstamp='1600331516', firstname='XXX', lastname='xxxx', dateOfBirth='', gender='', company='', street='', postal='', city='', state='', country='', phone='', mobile='', fax='', email='xxx', website='', language='', groups='a:2:{i:0;s:1:"1";i:1;s:1:"8";}', login='1', username='xxx', password='xxx', assignDir='', homeDir=NULL, disable=1600331591, start='', stop='', dateAdded='1579170269', lastLogin='1600329817', currentLogin='1600329996', locked='0', session='a:0:{}', trustedTokenVersion='0', backupCodes=NULL, useTwoFactor='', secret=NULL, loginAttempts=1, iban='', pwChange='' WHERE id='3'': SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'disable' at row 1" at /var/www/html/gremienportal/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 110 {"exception":"[object] (Doctrine\DBAL\Exception\DriverException(code: 0): An exception occurred while executing 'UPDATE tl_member SET id='3', tstamp='1600331516', firstname='XXX', lastname='xxxx', dateOfBirth='', gender='', company='', street='', postal='', city='', state='', country='', phone='', mobile='', fax='', email='xxx', website='', language='', groups='a:2:{i:0;s:1:\"1\";i:1;s:1:\"8\";}', login='1', username='xxx', password='xxx', assignDir='', homeDir=NULL, disable=1600331591, start='', stop='', dateAdded='1579170269', lastLogin='1600329817', currentLogin='1600329996', locked='0', session='a:0:{}', trustedTokenVersion='0', backupCodes=NULL, useTwoFactor='', secret=NULL, loginAttempts=1, iban='', pwChange='' WHERE id='3'':\n\nSQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'disable' at row 1 at /var/www/html/gremienportal/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:110, Doctrine\DBAL\Driver\PDOException(code: 22001): SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'disable' at row 1 at /var/www/html/gremienportal/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:91, PDOException(code: 22001): SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'disable' at row 1 at /var/www/html/gremienportal/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:86)"} []

Contao Manager installation fails due to "Palette "rootfallback" not found in table "tl_page"

When I try to install the extension using Contao Manager, I get the following error message:

$ /usr/bin/php7.3 -q /srv/www/***/***/***/***/contao-manager.phar.php composer require terminal42/contao-password-validation --no-suggest --no-update --no-scripts --prefer-stable --sort-packages --no-ansi --no-interaction

Using version ^1.0 for terminal42/contao-password-validation
/srv/www/***/***/***/composer.json has been updated

# Process terminated with exit code 0
# Result: OK


> Resolving dependencies using Composer Cloud v2.4.3

# Job ID MGZ7i7pu5FTMThTU0hLuEyefNnW9AgR41jrqlbJNr8z4L6u1PTurbfpnzBKde7JdSNRQSzGOHxTub completed in 43 seconds
# Memory usage: 511.08MB (peak: 3068.44MB), time: 44.2s.

$ /usr/bin/php7.3 -q /srv/www/***/***/***/***/contao-manager.phar.php composer install --prefer-dist --no-dev --no-progress --no-suggest --no-ansi --no-interaction --optimize-autoloader

contao/manager-plugin: Generating plugin class...
contao/manager-plugin: ...done generating plugin class

 // Clearing the cache for the prod environment with debug                      
 // false                                                                       

 [OK] Cache for the "prod" environment (debug=false) was successfully cleared.  


 // Warming up the cache for the prod environment with debug                    
 // false                                                                       

16:30:50 ERROR     [console] Error thrown while running command "cache:warmup --env=prod". Message: "Palette "rootfallback" not found in table "tl_page"" ["exception" => Contao\CoreBundle\Exception\PaletteNotFoundException { …},"command" => "cache:warmup --env=prod","message" => "Palette "rootfallback" not found in table "tl_page""]

In PaletteManipulator.php line 123:
                                                       
  Palette "rootfallback" not found in table "tl_page"  
                                                       

cache:warmup [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 4 installs, 0 updates, 0 removals
As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' may remediate them.
  - Installing paragonie/constant_time_encoding (v2.3.0): Downloading (100%)
  - Installing paragonie/sodium_compat (v1.13.0): Downloading (100%)
  - Installing paragonie/hidden-string (v1.0.0): Downloading (100%)
  - Installing terminal42/contao-password-validation (1.0.4): Downloading (100%)
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
28 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication
Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-install-cmd event terminated with an exception

In ScriptHandler.php line 113:
                                                                               
  An error occurred while executing the "cache:warmup" command: 16:30:50 ERRO  
  R     [console] Error thrown while running command "cache:warmup --env=prod  
  ". Message: "Palette "rootfallback" not found in table "tl_page"" ["excepti  
  on" => Contao\CoreBundle\Exception\PaletteNotFoundException { …},"command"   
  => "cache:warmup --env=prod","message" => "Palette "rootfallback" not found  
   in table "tl_page""]                                                        
                                                                               
  In PaletteManipulator.php line 123:                                          
                                                                               
    Palette "rootfallback" not found in table "tl_page"                        
                                                                               
                                                                               
  cache:warmup [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--  
  verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--en  
  v ENV] [--no-debug] [--] <command>                                           
                                                                               

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>...]


# Process terminated with exit code 1
# Result: General error


---

### Der Hintergrundprozess wurde unerwartet beendet ###

"Password-change" page in the loop

I just want to add the Password-change option to my installation (v 4.9.41). The standard Contao password policy is fine for me. Therefore I did not add the configuration parameters to config.yml (app/config/config.yml)! Or do I have to do that anyway?!?

I created a "password-change" page, placed a password-change module on it (with redirect to a confirmation page) and selected this page as password-change page in the page root. Works fine if I force members to change their passwords by ticking the corresponding checkbox in the member edit-mask.

But when I changed the password and submit the confirmation page wont't show. I am trapped in a loop and cannot leave that page ...

Looking forward to any hints or solutions :)

Password validation inactive in BackendPassword controller

If you create/edit a new back end user and enable the pwChange option for a user, the password change procedure will not enforce the defined password validation rules. But what's even worse: somehow, the password that is entered will not be able to validate and thus the user cannot log in at all.

Tested in Contao 4.8.7.

Reproduction

Example configuration:

# config/config.yml
terminal42_password_validation:
  Contao\BackendUser:
    min_length: 10
    require:
      uppercase: 1
      lowercase: 1
      numbers: 1
    password_history: 2
  1. Edit your own back end user.
  2. Enable the pwChange option.
  3. Save - you will be automatically logged out by Contao and shown the forced password change form.
  4. Enter the following password two times: 123456789.
  5. Click Next.

Even though the password does not fit the validation rules, Contao reports that the password has been changed successfully.

  1. Put in your user name and the newly set password 123456789.
  2. Click Login.

You will not be able to log in with the previously, newly set password.

Error at update

Contao 4.9.21

at console:

> post-update-cmd: Contao\ManagerPlugin\Composer\ManagerPluginInstaller->dumpPlugins
contao/manager-plugin: Generating plugin class...
contao/manager-plugin: ...done generating plugin class
> post-update-cmd: ContaoCommunityAlliance\Composer\Plugin\Plugin->dumpRunonce
> post-update-cmd: Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication

In DataContainerCallbackPass.php line 72:
                                                                               
  [Symfony\Component\Config\Definition\Exception\InvalidDefinitionException]   
  Missing target attribute in tagged callback service ID "Terminal42\Password  
  ValidationBundle\EventListener\PasswordChangeListener"                       
                                                                               

Exception trace:
  at /html/dev-system/vendor/contao/core-bundle/src/DependencyInjection/Compiler/DataContainerCallbackPass.php:72
 Contao\CoreBundle\DependencyInjection\Compiler\DataContainerCallbackPass->addCallback() at /html/dev-system/vendor/contao/core-bundle/src/DependencyInjection/Compiler/DataContainerCallbackPass.php:58
 Contao\CoreBundle\DependencyInjection\Compiler\DataContainerCallbackPass->getCallbacks() at /html/dev-system/vendor/contao/core-bundle/src/DependencyInjection/Compiler/DataContainerCallbackPass.php:31
 Contao\CoreBundle\DependencyInjection\Compiler\DataContainerCallbackPass->process() at /html/dev-system/vendor/symfony/dependency-injection/Compiler/Compiler.php:94
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /html/dev-system/vendor/symfony/dependency-injection/ContainerBuilder.php:762
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /html/dev-system/vendor/symfony/http-kernel/Kernel.php:596
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /html/dev-system/vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php:326
 Contao\ManagerBundle\HttpKernel\ContaoKernel->initializeContainer() at /html/dev-system/vendor/symfony/http-kernel/Kernel.php:136
 Symfony\Component\HttpKernel\Kernel->boot() at /html/dev-system/vendor/symfony/framework-bundle/Console/Application.php:169
 Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /html/dev-system/vendor/symfony/framework-bundle/Console/Application.php:75
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /html/dev-system/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /html/dev-system/vendor/contao/manager-bundle/bin/contao-console:38

Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-update-cmd event terminated with an exception

In ScriptHandler.php line 89:
                                                                                                                                                                                                                       
  [RuntimeException]                                                                                                                                                                                                   
  An error occurred while executing the "contao:install-web-dir" command:                                                                                                                                              
  In DataContainerCallbackPass.php line 72:                                                                                                                                                                  
                                                                                                                                                                                                       
    [Symfony\Component\Config\Definition\Exception\InvalidDefinitionException]                                                                                                                         
    Missing target attribute in tagged callback service ID "Terminal42\Password                                                                                                                        
    ValidationBundle\EventListener\PasswordChangeListener"                                                                                                                                             
                                                                                                                                                                                                       
                                                                                                                                                                                                                       
  Exception trace:                                                                                                                                                                                           
    at /html/dev-system/vendor/contao/core-bundle/src/DependencyInjection/Compiler/DataContainerCallbackPass.php:72                                                                                          
   Contao\CoreBundle\DependencyInjection\Compiler\DataContainerCallbackPass->addCallback() at /html/dev-system/vendor/contao/core-bundle/src/DependencyInjection/Compiler/DataContainerCallbackPass.php:58   
   Contao\CoreBundle\DependencyInjection\Compiler\DataContainerCallbackPass->getCallbacks() at /html/dev-system/vendor/contao/core-bundle/src/DependencyInjection/Compiler/DataContainerCallbackPass.php:31  
   Contao\CoreBundle\DependencyInjection\Compiler\DataContainerCallbackPass->process() at /html/dev-system/vendor/symfony/dependency-injection/Compiler/Compiler.php:94                                      
   Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /html/dev-system/vendor/symfony/dependency-injection/ContainerBuilder.php:762                                                       
   Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /html/dev-system/vendor/symfony/http-kernel/Kernel.php:596                                                                           
   Symfony\Component\HttpKernel\Kernel->initializeContainer() at /html/dev-system/vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php:326                                                           
   Contao\ManagerBundle\HttpKernel\ContaoKernel->initializeContainer() at /html/dev-system/vendor/symfony/http-kernel/Kernel.php:136                                                                         
   Symfony\Component\HttpKernel\Kernel->boot() at /html/dev-system/vendor/symfony/framework-bundle/Console/Application.php:169                                                                               
   Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /html/dev-system/vendor/symfony/framework-bundle/Console/Application.php:75                                                     
   Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /html/dev-system/vendor/symfony/console/Application.php:149                                                                                
   Symfony\Component\Console\Application->run() at /html/dev-system/vendor/contao/manager-bundle/bin/contao-console:38                                                                                       
                                                                                                                                                                                                                       

Exception trace:
  at /html/dev-system/vendor/contao/manager-bundle/src/Composer/ScriptHandler.php:89
 Contao\ManagerBundle\Composer\ScriptHandler::executeCommand() at /html/dev-system/vendor/contao/manager-bundle/src/Composer/ScriptHandler.php:30
 Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php:388
 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php:237
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php:118
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Installer.php:364
 Composer\Installer->run() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Command/UpdateCommand.php:248
 Composer\Command\UpdateCommand->execute() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/symfony/console/Application.php:1009
 Symfony\Component\Console\Application->doRunCommand() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Console/Application.php:327
 Composer\Console\Application->doRun() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at phar:///html/dev-system/web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Console/Application.php:128
 Composer\Console\Application->run() at phar:///html/dev-system/web/contao-manager.phar.php/api/console:86
 require() at /html/dev-system/web/contao-manager.phar.php:41

Login wirft Fehlermeldung

Hallo,
nach Installtion der Erweiterung in einer Contao 4.4.43, wird beim Loginversuch ins Backend (als Admin) eine Fehlermeldung ausgegeben. Im Log steht:

[2019-09-17 11:25:47] app.CRITICAL: An exception occurred. {"exception":"[object] (Doctrine\\DBAL\\Exception\\NotNullConstraintViolationException(code: 0): An exception occurred while executing 'UPDATE tl_user SET id='3', tstamp='1568719032', username='XXXX', name='XXXX', email='XXXX', language='de', backendTheme='flexible', limitWidth='', uploader='', showHelp='1', thumbnails='1', useRTE='1', useCE='1', password='XXXX', pwChange='', admin='1', groups=NULL, inherit='', modules=NULL, themes=NULL, pagemounts='a:0:{}', alpty=NULL, filemounts='a:0:{}', fop=NULL, imageSizes=NULL, forms=NULL, formp=NULL, amg=NULL, disable='', start='', stop='', session='a:2:{s:23:\\\"tl_article_tl_page_tree\\\";a:1:{i:1;i:0;}s:12:\\\"tl_page_tree\\\";a:1:{i:1;i:0;}}', dateAdded='1568719032', lastLogin='1568719387', currentLogin=1568719547, loginCount=NULL, locked='0', calendars=NULL, calendarp=NULL, calendarfeeds=NULL, calendarfeedp=NULL, faqs=NULL, faqp=NULL, news=NULL, newp=NULL, newsfeeds=NULL, newsfeedp=NULL, newsletters=NULL, newsletterp=NULL, filterformp=NULL, filterform=NULL, catalogp=NULL, catalog=NULL, maeEventCatDefault=NULL, maeEventCat='', calendareventstagsrelationp=NULL, calendareventstagsp=NULL WHERE id='3'':\n\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'loginCount' cannot be null at C:\\laragon\\www\\templateboosting\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\AbstractMySQLDriver.php:123, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'loginCount' cannot be null at C:\\laragon\\www\\templateboosting\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDOConnection.php:109, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'loginCount' cannot be null at C:\\laragon\\www\\templateboosting\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\PDOConnection.php:107)"} []

Auf der Website selber wird zuerst die Standrd Fehlermeldung von Contao ausgegeben. Bei Reload (erneute Übermittlung bestätigen) der Seite zeigt sich aber die Fehlermeldung die auch in der Log Datei steht.

Entferne ich in diesem Zustand den Teil Login aus dem URL (/contao/login) komme ich angemeldet ins Backend.

PHP 8?

Die Erweiterung kann leide nicht installiert werden unter PHP 8.
Wird dies demnächst möglich sein?

Hatte die Erweiterung in einer älteren Installation im Einsatz und möchte diese gerne weiter nutzen.

Besten Dank!

Error in BE if click page structure

if click page structure

RuntimeException:
System::import() failed because class "terminal42_password_validation.listener.no_password_change_page_warning" is not a valid class name or does not exist.

  at vendor/contao/core-bundle/src/Resources/contao/library/Contao/System.php:197
  at Contao\System->import('terminal42_password_validation.listener.no_password_change_page_warning')
     (vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:202)
  at Contao\DC_Table->__construct('tl_page', array('tables' => array('tl_page')))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:411)
  at Contao\Backend->getBackendModule('page', null)
     (vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:167)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:48)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/index.php:31)
  at require('/html/dev-system/web/index.php')
     (web/app.php:4)       

Circulation with resetting the password

If the Contao user needs to change his password, the password form is displayed. After successfully changing the password, the user will be redirected to the login. If the user enters his new data there, he gets the message that he has to change his password again.
So the user can never log in.

  • Contao: 4.9
  • PHP: 7.3

config.yml

terminal42_password_validation:
    Contao\FrontendUser:
    Contao\BackendUser:
        min_length: 10
        change_days: 180
        require:
            uppercase: 1
            lowercase: 1
            numbers: 1
            other: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.