Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Event::on(User::class, User::EVENT_BEFORE_SAVE, function(Event $event) {
- $formData = $_POST;
- $newPassword = $formData['newPassword'];
- $confirmPassword = $formData['confirmPassword'];
- if ($newPassword != $confirmPassword){
- Craft::$app->session->setError('Confirm password does not match new password');
- }
- });
- {% set error = craft.app.session.getFlash('error') %}
- {% if error|length > 0 %}
- {{error}}
- {% endif %}
- if ($newPassword != $confirmPassword){
- Craft::$app->session->setError('Confirm password does not match new password');
- $event->isValid = false;
- }
Add Comment
Please, Sign In to add comment