Jump to content

PS Password Generator


MrBaseball34

Recommended Posts

There have been times when I needed to regenerate the admin password for my shop.
I created this form so I can regenerate the password. It can also be used for users if you need to
generate a new password for a user.

Place it in your shop's admin directory and change your .htaccess to allow only your IP to access it.


<html >
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Prestashop - Password Hashing</title>
 </head>
 <body>
<?php
 include('../config/settings.inc.php');

 $cookieKey = _COOKIE_KEY_;
?>
   <form method="POST" action="<?php $_SERVER['PHP_SELF'] ?>" name="form">
     Enter your new password: <input type="text" name="newPassword" /><br />
     <input type="submit" value="Submit" />
   </form>
<?php

 if(isset($_POST['newPassword'])) {
   $newPassword = $_POST['newPassword'];
   // Your correct Password Hash will be below the submit button
   // SELECT and COPY the Hash
   // Go to phpMyAdmin
   // Navigate to the 'employee' table, default 'ps_employee'
   // Open the record with the correct email address
   // Replace the value for 'passwd' with the Hash
   // Save and try to login in again, you should be able to now
   echo md5($cookieKey.$newPassword);
 }
?>
 </body>
</html>

Link to comment
Share on other sites

  • 1 year later...

How does this work - there's no email address to define the user

 

 

this code only creates a hashcode to insert into correct row in phpmyadmin

 

you can read it in instructions writed by MrBaseball34:

 

 

// Your correct Password Hash will be below the submit button

// SELECT and COPY the Hash

// Go to phpMyAdmin

// Navigate to the 'employee' table, default 'ps_employee'

// Open the record with the correct email address

// Replace the value for 'passwd' with the Hash

// Save and try to login in again, you should be able to now

Edited by vekia (see edit history)
Link to comment
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
×
×
  • Create New...