Jump to content

Removing characters (O0iIl1) from password generator


pranab13
 Share

Recommended Posts

Hello,

 

Does someone know how to remove some characters from the password generated by Prestashop when doing "Forgot your password ?".

 

I thought it was on the class Tools.php on the passwdGen function but it doesn't seem to work.

 

Is it somewhere else ?

 

Regards.

Share this post


Link to post
Share on other sites

The front controller PasswordController.php calls this:

$customer->passwd = Tools::encrypt($password = Tools::passwdGen(MIN_PASSWD_LENGTH, 'RANDOM'));

If you have written an override, you needed to delte cache/class_index.php before the override takes effect.

Share this post


Link to post
Share on other sites

Thank you. So it calls the RANDOM case in the Tools class I saw.

 

I'm not that advanced in coding for this bit of code :

 case 'RANDOM':
                $num_bytes = ceil($length * 0.75);
                $bytes = self::getBytes($num_bytes);
                return substr(rtrim(base64_encode($bytes), '='), 0, $length);

Do you know how I can change it so it removes these letters? I'm going to try and figure out but if ever you have the answer that would be great!

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More