Jump to content

Password Validation - How is it done?


Recommended Posts

Hi,

I have an issue with the password validation failing for new accounts so I wondering how it works so that it can be fixed.

 

Where are the Tool files located that concern the validation of passwords, in particular, their length?

 

In this situation, when the new user enteres a password and submitts the form, the following error is displayed:

"There is 1 error(s):

  1. An error occurred while creating your account.."

Then in the form next to the passwork filed is: "(five characters min.)"

 

Debug was turned on and the above info is the only clues provided.

 

I can not work out what the issue is as the passwords are entered correctly. All I can try and do for the moment is to work out how the validation happens, and if I can't solve it, hack it.

 

Until this is sorted one way or the other, users can not register so looking for help please.

 

Thanks

 

------------------------

Solved

It had nothing to do with the password. It was a missing hidden form input that triggered the error and as it didn't have any information about that input, it did not pass anything back other than that there was an error.


 

Thanks to those that tried to assist.

Edited by IeM (see edit history)
Link to comment
Share on other sites

in contorllers you can change $size param Validate::isPasswd($passwd,99)

where 99 is a min length of password

 

 

but in my opinion it will be much easier to change it in validate class


/**
* Check for password validity
*
* @param string $passwd Password to validate
* @param int $size
* @return boolean Validity is ok or not
*/
public static function isPasswd($passwd, $size = 5)
Link to comment
Share on other sites

Hi and thanks.

 

It's now more involved.

 

I'm happy with the min length being at least 5 as that is not the problem.

 

In testing I use passwords about 16 characters long.

 

The issue is that there is an error somewhere that is returning a false error saying that the password entered is too short even though it is 16 characters long.

 

For testing I have just added a "return = 1" and the new customer is now accepted. See below.

 

public static function isPasswd($passwd, $size = 5)
    {   return 1;
        return (Tools::strlen($passwd) >= $size && Tools::strlen($passwd) < 255);
    }

 

While this is not a solution, stops the form error message, however, the new record is not added to the database, and the shipping options do not present them selves, or of course the payment options.

 

So this probably has noting to do with the isPasswd function.

 

Where to go from here?

Link to comment
Share on other sites

×
×
  • Create New...