Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function onBeforeSetPassword(Event $event)
- {
- $user = $event->params['user'];
- $password = $event->params['password'];
- if (mb_strlen($password) < 8)
- {
- $user->addError('password', 'Sorry but your password must be at least 8 characters.');
- $event->performAction = false;
- }
- if (!preg_match('/(d.*[A-Z]|[A-Z].*d)/', $password))
- {
- $user->addError('password', 'Sorry but your password must contain at least one uppercase letter and one number.');
- $event->performAction = false;
- }
- }
- {% if account is defined and account.getErrors('password') %}
- {% include '_includes/formError' with { error : account.getErrors('password')|join('<br>') } %}
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement