Moodle – Disable Forgot Password Page
For our Moodle, when I upload users, I give them a fake email address. With the low usage of tech here, I can’t require our students to input real addresses. This causes me to get a ton of mail from the server because students are constantly trying to log in through the forgotten password form. (Even though I have edited the Japanese to tell them that they should consult with their teacher instead of using the page!)
So, for a quick fix I decided to disable the forgotten password link on the login page and the form itself. I eventually want to replace the forgot_password.php with a custom file, but until I can do that this will have to suffice.
So click on Read More to see how I did it.
1. Go to your_moodle_files/blocks/login/block_login.php and comment out the following line: (around line 36)
$forgot = $wwwroot . ‘/login/forgot_password.php’;
(use a double slash “//” to comment it out.)
2. Go to your_moodle_files/login/index_form.html and comment out the following line: (around line 52)
<div class=”forgetpass”><a href=”forgot_password.php”><?php print_string(“forgotten”) ?></a></div>
for html add these characters (don’t forget the exclamation mark): <!–The line you don’t want to be read–>
3. Lastly, go to your_moodle_files/login and rename the forgot_password.php file to something like UNUSED_forgot_password.php
That seems to have worked for me. However, I just made the changes so we will need to see how well it holds up.
If anybody has any better method to do this, or any links on how to customize the forgot_password.php file please leave a comment. I’ll make sure to edit this article if I find any problems.