General developer forum

modify the change_password page

 
Picture of Guillermo Biot
modify the change_password page
 

I would like to communicate with Mailchimp. My students are manually enrolled and they have to change their password on their first login. So my idea is to include a checkbox in that page to give them the option to subscribe to our newsletters.

I found that the code which generates that page is in login/change_password.php and login/change_password_form.php. But I don't want to modify any core file of moodle and I don't know where else I should put my code. Where should I put it? Thank you in advance.


 
Average of ratings: -
Picture of Helen Foster
Re: modify the change_password page
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators

Hello,

Unfortunately I can't help you, though I'm just going to move your post to the General Developer forum where you're most likely to receive an answer regarding the code.

 
Average of ratings: -
Picture of Darko Miletić
Re: modify the change_password page
Core developersParticularly helpful Moodlers

You need to write your own authentication plugin that will implement custom password change page.

See https://docs.moodle.org/dev/Authentication_plugins#change_password_url.28.29

Of course only the users that use that new authentication method will see the new page.

If you want to modify change password page for any authentication plugin you would need to use Customscripts approach.

 
Average of ratings: -
Picture of Guillermo Biot
Re: modify the change_password page
 
Thank you for the info!

I don't know if I got it correctly, the content of the plugin would be the call to change_password_url(plugin URL) and the php file implementing the new change password page?

This would be my first plugin in moodle and I am still a bit confused.

 
Average of ratings: -
Picture of Guillermo Biot
Re: modify the change_password page
 

Thanks for your help, Darko. Finally I implemented the feature using Customscripts.

 
Average of ratings: -
Picture of Márcio Quimbundo
Re: modify the change_password page
 

can you share how u did step by step?? I want to do it with my users
 
Average of ratings: -