danielholanda

forgot backend password, how do you reset?!

Recommended Posts

Hello,

I see that the backend of processwire is simple. I like that but... I've forgotton my email for my backend project I'm creating locally with MAMP. Simple but... where is the button such as, "forgot password". I suppose I missing something obviuos but I cannot find it in the display neither in google or in these forums.

So,

How do you reset/retieve your password from you backend of processwire?

Greetings,

Dani

Share this post


Link to post
Share on other sites

There's a Password Forgot module but not installed by default.

I think only solution would be to install new, or do this:

Create a /tool.php in the same directory as the /index.php in the root of PW install.

Paste in this code:

<?php
include("index.php");
wire("modules")->get("ProcessForgotPassword");

Save it and if necessary upload it to your server. Remember the file as you'll need it shortly.

Now call it from the browser http://yourdomain.com/tool.php and the Module will get installed and a Password forgot link should show up on the login screen.

Delete the tool.php.

Edit: You can, using this technique, also set a new password for the admin, see on the link Diogo posted.

Share this post


Link to post
Share on other sites

Thanks... Luckily I dodnt do too much, I will resintall and activate module. There should be a PDF with instructions and one of the first should be reset password module. If you have a lot of work already done... ufffff I would get mad. Thanks for your answers

Share this post


Link to post
Share on other sites

As being said you can set a new password through a script, install the module through the php script or if nothing helps reinstall (of course only if you haven't done anything yet). So no biggy at all if you have access to your files, which I assume you should have. This would be a matter of 1 minute and no need to reinstall.

So no need to going mad even if you developed for days on it.

The password is something you shouldn't forget, and the forgot password module isn't installed by default for security reasons.

Share this post


Link to post
Share on other sites

You can always reset your password just by pasting this temporarily into any one of your templates, and then viewing a page that uses the template:

$u = $users->get('admin'); // or whatever your username is
$u->of(false); 
$u->pass = 'your-new-password';
$u->save();
  • Like 15

Share this post


Link to post
Share on other sites

BTW, what is the location of login/password in the database? I didn't go into it but it would be practical to know.

Share this post


Link to post
Share on other sites

I think from memory that the table is called users (can't check from my phone) but the password would of course be encrypted so that wouldn't do you much good if you we're intending to reset it there.

Share this post


Link to post
Share on other sites

Passwords are in a table called field_password. They are hashed and salted, and not reversible, so no way to set or change them without going directly through the API.

Share this post


Link to post
Share on other sites

Little OT: is it possible to use password field on other templates?

Share this post


Link to post
Share on other sites

Where getting a little old!

It's field_pass not field_password

And yes you can put a "password" field in other templates :P

Share this post


Link to post
Share on other sites

Add new field, select "password" field and enter name..

Ahhh you mean so it get's used as a real password field with encryption? I don't think but should be possible to add functionality through a module?

Edit: look normal so far, it works without anything!

  • Like 1

Share this post


Link to post
Share on other sites

Ah, brilliant! I tried to add the existing password field into a template without any luck on that :) Never realized that I could create new password fields, but it is indeed possible! Thanks Soma! Of course need to know how to calculate the password hash (to compare the one that gets added into a db), but that should be easy enough.

Share this post


Link to post
Share on other sites

you can use the $page->passwordfield->match("somepasswordstring") function to compare hashs.

  • Like 1

Share this post


Link to post
Share on other sites

Passwords are in a table called field_password. They are hashed and salted, and not reversible, so no way to set or change them without going directly through the API.

But... if you just need to reset a password and using a Mysql prompt feels easier than adding temporary .php files, this brutal SQL clause sets admin's password to 'admin1': 

UPDATE field_pass f, pages p, templates t SET f.data='rO65UGbDmOQYVanmOznTp1zJMhM1p2e', salt='$2y$11$Y89v0EVaoVB7Vg/Yiq7xqO' WHERE f.pages_id=p.id AND p.name="admin" AND p.templates_id=t.id AND t.name="user";

Just remember to change it later on. :)

Update: this doesn't work since PW also uses a static salt in config.

Share this post


Link to post
Share on other sites

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.

  • Similar Content

    • By anttila
      We are developing an App that sends data over the Internet to ProcessWire (POST/JSON). We want password to be protected somehow when sending it, but I should be able to compare it to PW's passwords. We were thinking of using md5 encryption, but PW uses different encryption.
      How can I be sure that user has active account when they use the App?
    • By Margus Tamm | OnlineExpo
      Hi
       
      We need Processwire guru for our project onlineexpo.com. Project is "long term" and constantly evolving.
      We have Frontend developer, but we don't have backend guru yet.
      So, if you are interested at work, please contact me at "processwire@onlineexpo.com" and let's discuss about conditions.
       
      Margus
    • By activestate
      Hi,
      I have project done on localhost, all works fine. When i'm attempting to upload this project into live server all looks ok, but when i'll login as admin, i cannot edit anything. After saving, i see message that data is saved, but nothing happens. Impossible to edit nothing...
      Thanks for any tips.
      PS: No errors in  logs, data can be changed manually using phpmyadmin, so looks like no problems with database too....
      I've also noticed, that if some page has blank field i can add text and save. And this will be saved, but cannot be edit again.
    • By GWColeman
      Hi,
      I am working on a processwire project for my college. I created an entire site about a year ago without any problem. Today however, I was making some changes to the site and I was experimenting with duplicating data across multiple pages. There is a repeater on one of the pages that I need to be the same across all pages.

      I clicked the checkbox to autojoin within the field options for the repeater and processwire crashed. I am not able to make any changes to the page to uncheck and I cannot view the site any longer.
      This is the message I get on the page.
      Fatal error: Exception: Could not execute User::__construct() (in /var/www/html/wire/core/Pages.php line 323) #0 /var/www/html/wire/core/Pages.php(323): mysqli_result->fetch_object('User', Array) #1 /var/www/html/wire/core/PagesType.php(101): Pages->getById(Array, Object(Template), 29) #2 /var/www/html/wire/core/Session.php(64): PagesType->get(41) #3 /var/www/html/wire/core/ProcessWire.php(138): Session->__construct() #4 /var/www/html/wire/core/ProcessWire.php(46): ProcessWire->load(Object(Config)) #5 /var/www/html/index.php(185): ProcessWire->__construct(Object(Config)) #6 {main} in /var/www/html/index.php on line 217

      I tried to comment out 323 without any luck. I also took a look in the database to see if I could manually turn off the autojoin option. However, I was not able to figure out where the option was located within the database.
       
      Any help or suggestions would appreciated.
      EDIT:
      I was able to solve the issue on my own. I did a google search and found that I needed to change he flag for the field from 1 to 0 in the database, and everything works again.

      Here is the post that I found that solved the issue.
       
       
    • By Maxplex
      Hey there, 
      i have a big Problem. I migrate Processwire with a Plugin from my local Mama Server to a 1&1 web server. After few Problems with Internal Error (.htaccess), the site looks greta and its work. But my Admin Panel are not working correctly. Before I installed the AdminThemeUIKit but now I can't install ist anymore and I can't refresh my modules. Nothing happens after a mouse click on it. If I am going to the pages, I can't see anything. There isn't a Site Tree or anything else. I can not change anything there. Please help me, it is a huge Problem for me... The admin looks like the very beginning of Processwire !!!