This topic contains 2 replies, has 2 voices, and was last updated by Artem Liubeznyi 9 years, 2 months ago.
- Topic
Hi again,
I was given a task to allow admin users to change the passwords of their subordinates.
So given obviously Admin probably dont know user passwords, I have taken over the following classes:
Oro\Bundle\UserBundle\Form\Type\ChangePasswordType
Oro\Bundle\UserBundle\Form\Type\UserType
Oro\Bundle\UserBundle\Form\EventListener\UserSubscriberIn effort to change the function isCurrentUser in the UserSubscriber class to return true for users with the admin role. Further within ChangePasswordType I have checked for the admin role so that the builder resembles:
123456789101112131415161718$builder->add('plainPassword','repeated',array('required' => true,'type' => 'password','invalid_message' => 'The password fields must match.','options' => array('attr' => array('class' => 'password-field')),'first_options' => array('label' => 'New password'),'second_options' => array('label' => 'Repeat new password'),'mapped' => false,'cascade_validation' => true));The above all currently works. What I am having trouble doing is taking over the ChangePasswordSubscriber class in order to not remove the PlainPassword field if the original password does not exist.
Any help would be appreciated,
Thanks in advance,
Alex
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.