Users cannot login to Our Moodle site and forgot password link not working

Re: Users cannot login to Our Moodle site and forgot password link not working

by Ken Task -
Number of replies: 7
Picture of Particularly helpful Moodlers

Ike ... are there two problems?

1. Users cannot login

2. forgot password link not working

They seem to be related but involve different pieces to Moodle and depending upon #1 (authentication) may involve EMail only with problem 2.

Which of the authentications is your site using?

https://docs.moodle.org/32/en/Table_of_Contents#Authentication

From what you've shared, am guessing email based self-registration:

https://docs.moodle.org/32/en/Email-based_self-registration

The 2nd problem ... clicking the link produces a blank page? or does nothing when clicked?

Those a different behaviors but have different tracks to follow in trouble shooting.

Might look into:

https://docs.moodle.org/32/en/Debugging

Turn it on ... via Site Admin menu, try things that are broke then come back here and post a response with the text seen in the debug output.


'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Users cannot login to Our Moodle site and forgot password link not working

by Ike Chimbandi -

Hi Ken,


Thank you for responding.

We use self registration.

I'm essentially locked out so i cant even access the site admin menu.

The message below is what i get when you use the forgot password option :-

Error sending password change confirmation

emailerror/moodle/cannotmailconfirm

It was working before and no changes have occurred (as far as I know)


In reply to Ike Chimbandi

Re: Users cannot login to Our Moodle site and forgot password link not working

by Ken Task -
Picture of Particularly helpful Moodlers

Uhhhh ... "working before and no changes ..." if working before and now not working, then????

When the Moodle was first installed, there were two users created.  User id #1 is guest - whether you use guest access or not.   User id #2 was/is the original 'superuser' whose default login was 'admin' - IF the installer accepted the defaults during install.   Don't suppose you re-call your user ID do ya? (most folks don't but it would be a good idea to know it once this is resolved).  Both of those accounts should be left to authenticate as manual - that means the Moodle DB retains that user's information/profile, etc..   They should not be changed to use other authentications or things could result in no one being able to login.

There is a way to assure your account is admin levels to be able to get to the site admin menu but it does require knowledge of user ID numbers to use.   The only way to do that is to be able to query the DB for the Moodle.    So you have any tool to access the DB?

The login/password for the DB is in the config.php file.

Do you have command line access to the server? (ssh)

If so, this query will find user ID 2:

select username,auth,email from mdl_user where id = "2";

Is that your account?

Then you could add the following line to your config.php file to re-gain access to the site as an admin level.

$CFG->siteadmins = '2,[youruserid';

where [youruserid] IS your user id number.  The config file is sensitive to case and ticks and the ending ";".

Save the config.php file then attempt to login with your user name and password you had originally.

If user ID is not your account, then this query:

select id,username,auth,email from mdl_user where email = 'youremailadress';

Then you know your ID number .. use that ID number in the siteadmins line of the config.php file.

Let's do that before we tackle anything about changing password.

'spirit of sharing', Ken

In reply to Ken Task

Re: Users cannot login to Our Moodle site and forgot password link not working

by Ike Chimbandi -


I have the Admin password and confirmed that it is the same that is in the config.php file. Still no luck!!


In reply to Ike Chimbandi

Re: Users cannot login to Our Moodle site and forgot password link not working

by Ken Task -
Picture of Particularly helpful Moodlers

The password seen in config.php is for the DB user ... not normally for a Moodle user account.

Have you acquired your account ID number?

Did you add the line as suggested to config.php file and then try to login?

'spirit of sharing', Ken

In reply to Ike Chimbandi

Re: Users cannot login to Our Moodle site and forgot password link not working

by Ken Task -
Picture of Particularly helpful Moodlers

Have been in communication with Ike offlist and the situation is one seen before ... Ike has taken over as entities IT support person and inherited the Moodle as well.   Former IT person left no information concerning the Moodle.

All is not lost however .. IF one has ssh access to the server. (below assumes a version 2 of Moodle that had the script mentioned below).   If not, a work-around attempt might be to copy the script mentioned from a downloaded higher version of 2.   Get the reset_password.php script into proper location and then try the following.

Briefly:

ssh into server

cd /path/to/moodle/code/admin/cli/

there is a script called reset_password.php therein.   It will reset a manual account password only.

The assumption is the first user created during initial install is/was 'admin' so attempt changing the password for the user 'admin' first.

If that's not the case .. admin user doesn't exist ... then one might need to borrow an account of any user known to be an admin level user.   Let's say bjones is known to be an admin level user.   Change bjones password.   Login as bjones.

From there one can create another account called admin, set the password, then also set 'admin' to super user levels.

Test the new admin user access ... can login and see if Site Admin Menu appears.  Ok, good to go.

Suggest to bjones they change their password.

The last resort is using the DB ... will reserve that for another day. ;)

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Forgot password link not giving me an error message

by Ronnie Izzo -

After we enter a username or email on the Forgot Password page we keep getting this error.  I've looked at the SMTP settings and can't find the problem.  Would appreciate any help if anyone has seen this issue?


Thanks, Ronnie








In reply to Ronnie Izzo

Re: Forgot password link not giving me an error message

by Ronnie Izzo -

Sorry - here's the error message: