-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Enable validation of password via hooks during password
changes Add a new $_param variable "passwordValid" and "passwordInvalidMessage" process via Hook. In the Hook to can do your own validation or other stuff and set "passwordValid" to false an generate a Message to "passwordInvalidMessage". If $hookPasswordValid is false then the password is not set in DB and the script runs its normal way. (it will redirect to the PasswordChange Form an prints the "passwordInvalidMessage") Resolves: #87726 Releases: master Change-Id: I89f37e7c5036254b40aa4fffe65a4e6cf2cc213f Reviewed-on: https://review.typo3.org/c/59714 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Susanne Moog <susanne.moog@typo3.org> Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by: Susanne Moog <susanne.moog@typo3.org> Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
- Loading branch information
Showing
2 changed files
with
73 additions
and
26 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...og/master/Feature-87726-ExtendFrontendLoginControllerHookToValidatePassword.rst
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,36 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
========================================================================== | ||
Feature: #87726 - Extend FrontendLoginController Hook to validate password | ||
========================================================================== | ||
|
||
See :issue:`87726` | ||
|
||
Description | ||
=========== | ||
|
||
The Hook `$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['password_changed']` is extended to validiade the given password. | ||
In the Hook you can set a custom validation Message. | ||
|
||
|
||
Impact | ||
====== | ||
|
||
You can now use the hook via: | ||
|
||
.. code-block:: php | ||
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['password_changed'][] = \Your\Namespace\Hooks\MyBeautifulHook::class . '->passwordChanged'; | ||
Example implementation: | ||
----------------------- | ||
.. code-block:: php | ||
public function passwordChanged(array &$params) | ||
{ | ||
if($params['newPasswordUnencrypted']==='password'){ | ||
$params['passwordValid']=FALSE; | ||
$params['passwordInvalidMessage']='<p class="text-danger">Do not use password as password</p>'; | ||
} | ||
} | ||
.. index:: Frontend, ext:felogin, PHP-API |
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