Jump to content

[SOLVED] Do the reset password tricks work for you? They don't work for me.


Recommended Posts

Posted

Hei guys,

All the password resets in this forum don't work for me. I have the admin username with ID 41, but no luck. I noticed that all the examples for the password reset use username + password for the login. In my case, I use an email and password. Could that be the reason? Any ideas?

Posted

hi,

no ? this one only resets the password (i think it's @bernhard who gave it)
first, put this in you _init.php file or on top of your _main.php

if($input->get->resetpassword == 1) {
  $admin = $users->get(41);
  $admin->setAndSave('pass', 'yournewpassword');
  die("admin url = {$pages->get(2)->httpUrl}, admin username = {$admin->name}");
}

then go to http://www.yoursite.com/?resetpassword=1
and, of course, immediatly remove this code from your template, goes without saying...

it only uses and targets the first admin user (id 41) whichever login you're using

have a nice day

Posted

Hi @Boost

funny, i just had to use it for a friend yesterday and, once more (he often looses his password :)) it worked fine

the thing is, using this trick, first go to the domain url (not the admin login one) with the ?reset... as it works on the frontend of course and as you can see it doesn't use any user name or email to do the trick, only the user id
to check if it does something you may try having the "field_pass" table opened, refreshing it after you've gone to the homepage with the reset get var to see if it worked or at least did something

have a nice day

 

Posted
30 minutes ago, virtualgadjo said:

to check if it does something you may try having the "field_pass" table opened, refreshing it after you've gone to the homepage with the reset get var to see if it worked or at least did something

Hi. How would you do that?

Posted

You have to open the database + table (field_pass) in an SQL administration tool, e.g. PHPMyAdmin (Or if you have installed Tracy with Adminer, you can also use this)

Posted

@Boost oh yes, being an old guy, i like to see if what i do actually does something, i don't totally rely on my brain ?

the important thing here is the homepage with the get var one as using the snippet in your _main ou _init only works on the front side

have a nice day

 

Posted

When I run the script I get 

admin url = http://acme.local:8080/backend/, admin username = admin

But nothing changes in the DB.

Posted

@Boost

funny, maybe try on top of your _main.php file just after the namespace... but this seems to show it does work
what i don't really get is your url using a :8000 port being used to set virtualhosts, looks like an url sent by vs code live server...

 

Posted

Yeah. I'm using it on my local machine. I set up a virtualbox to server the LAMP. That's why I need to use 8080 for the port forward ? 

Posted

maybe (really maybe...) your issue comes from the mysql port in your virtualbox but if the website works it shouldn't
i must say i'm a litte stuck here as using this trick quite often i never ran into that kind of problem be it online or locally

Posted

As a follow-up, I got it working with the @virtualgadjo script. Thank you!.

My issue was within the Apache setup. My directives were not right. Fixing that, and the reset worked like a charm.

  • Boost changed the title to [SOLVED] Do the reset password tricks work for you? They don't work for me.
Posted

Well, actually it might be even more fun to do this:

// site/ready.php
// REMOVE THIS AFTER PASSWORD RESET!!!
if ($input->get('logmein') == 'yesplease') {
  $wire->session->forceLogin($users->get("roles=superuser"));
}

Then visit any page of your website with ?logmein=yesplease and reset your password from within the PW backend ?

  • Like 3
  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...