Jump to content
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 16

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

Soma: through API or with advanced mode?

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 Tyssen
      I have a client who is reporting that in the last couple of days they can no longer login to their site with their normal browser (Chrome). Using another browser or an incognito window works.
      I've tried logging into the site using the same login details in my usual browser (Firefox) and have had no problems.
      The site is a membership site and today other members are reporting the same problem.
      The site is running 3.0.148 and has the session handler DB and login throttle modules installed. It was recently upgraded to 3.x from 2.x. But no changes have been made to the site between the time when they were able to login OK and when the problem started happening.
    • By derelektrischemoench
      Hi guys,
      I'm facing a somewhat strange issue here which I can't quite wrap my head around. 
      I have a PW site in development which runs on three machines simultaneously, one staging server which is accessible as a preview instance for my customer, my PC and my laptop. 
      I have three completely identical settings on each of the three machines (same apache version, same php version, same codebase, same database); however on my PC I am unable to log into the backend. I get no error message or anything, when I try to login; i just get redirected to the login  page. I have already enabled database driven sessions (I enabled them on my laptop, then I dumped the database and copied it to my pc); I have cleared the cache directory; I cleared the sessions in the database; I cleared my browser caches, I tried different browsers, all to no avail; I am unable to login when using my pc, the instances all have the same .htaccess.
      Is there something I'm missing here or does anyone have a clue as to what my issue here might be? I'm using processwire 3.0.123
      Thanks for any input, greetings
      derelektrischemoench
       
      //edit: I've noticed something interesting; despite the directories of my web folders being the same layout; when I open the admin page i get a 404 on the processwire/ resource in the networks panel of chrome; on my laptop I get a  200.... I guess this is where my problem is; but why?
       
       
    • By derelektrischemoench
      Hi guys,
      I'm facing a somewhat strange issue here which I can't quite wrap my head around. 
      I have a PW site in development which runs on three machines simultaneously, one staging server which is accessible as a preview instance for my customer, my PC and my laptop. 
      I have three completely identical settings on each of the three machines (same apache version, same php version, same codebase, same database); however on my PC I am unable to log into the backend. I get no error message or anything, when I try to login; i just get redirected to the login  page. I have already enabled database driven sessions (I enabled them on my laptop, then I dumped the database and copied it to my pc); I have cleared the cache directory; I cleared the sessions in the database; I cleared my browser caches, I tried different browsers, all to no avail; I am unable to login when using my pc, the instances all have the same .htaccess.
      Is there something I'm missing here or does anyone have a clue as to what my issue here might be? I'm using processwire 3.0.123
      Thanks for any input, greetings
      derelektrischemoench
       
       
    • By neophron
      Hi there,
      I have a site with a lot of pages (more than 200, growing), where every page shows only one image.
      I noticed that in the backend of the Skyscrapers website, every page with a skyscraper has a thumbnail. I suppose, that ListerPro is behind this.
      Can I achieve this (thumbnails) only with ListerPro or are there other solutions? 

    • By gebeer
      Although the PW backend is really intuitive, ever so often my clients need some assistance. Be it they are not so tech savvy or they are not working in the backend often.
      For those cases it is nice to make some help videos available to editors. This is what this module does.
      ProcessHelpVideos Module
      A Process module to display help videos for the ProcessWire CMS. It can be used to make help videos (screencasts) available to content editors.
      This module adds a 'Help Videos" section to the ProcessWire backend. The help videos are accessible through an automatically created page in the Admin page tree. You can add your help videos as pages in the page tree. The module adds a hidden page to the page tree that acts as parent page for the help video pages. All necessary fields and templates will be installed automatically. If there are already a CKEditor field and/or a file field for mp4 files installed in the system, the module will use those. Otherwise it will create the necessary fields. Also the necessary templates for the parent help videos page and it's children are created on module install. The module installs a permission process-helpvideos. Every user role that should have access to the help video section, needs this permission. I use the help video approach on quite a few production sites. It is stable so far and well received by site owners/editors. Up until now I installed required fields, templates and pages manually and then added the module. Now I added all this logic to the install method of the module and it should be ready to share.
      The module and further description on how to use it is available on github: https://github.com/gebeer/ProcessHelpVideos
      If you like to give it a try, I am happy to receive your comments/suggestions here.
×
×
  • Create New...