modify the change_password page

modify the change_password page

by Guillermo Biot -
Number of replies: 5

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: -
In reply to Guillermo Biot

Re: modify the change_password page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

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.

In reply to Guillermo Biot

Re: modify the change_password page

by Darko Miletić -

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.

In reply to Darko Miletić

Re: modify the change_password page

by Guillermo Biot -
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.

In reply to Darko Miletić

Re: modify the change_password page

by Guillermo Biot -

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

In reply to Guillermo Biot

Re: modify the change_password page

by Márcio Quimbundo -

can you share how u did step by step?? I want to do it with my users