C5.6 - Login not working and no reset email sent

My login isn’t working. It was initially but now showing error “A user and password are required” after I put in admin and pw.
Also tried the ‘Forgot Password’. Wont recognise my email address use when I installed C5.
I have changed the email address via PHPMyAdmin but still wont work.
Also tried changing password but no luck. Any ideas please?

Tried all these.

  • no log created so cant get the reset link
  • changed code in login.php but get error
  • forgot password says invalid email

If you have access to the php files, you can try adding this code somewhere:

Note that this is highly dangerous if your IP is shared since it will let anyone in as the super admin.

if ($_SERVER['REMOTE_ADDR'] === {your.ip.address}) {
User::getByUserID(1, true);

This will log you in as the super admin. You can add it to a theme template, or a package controller’s on_start method. If using a template you may need to us the cli to clear the cache first.

Once you’re in as admin, you might want to check your email settings and the logs to find out why no reset message is being sent.