2012-11-09, 03:20 PM
I'm having a problem registering users.
The verify_password function is saying my password length is incorrect, but it isn't. Settings say between 6-30 and mine is 9...last time I checked my math that was between 6 and 30 :p
So I threw a couple emails in the userhandler for debugging (see code below) and when it tries to get the values for those settings, they're empty (see email text). I'm assuming that's why my password is failing.
So my question is, why would those be empty? They're set in the config. Any ideas what's going on?
I added the following code to the beginning of the verify_password function to verify the settings are empty and everything worked correctly. So those settings are not set.
Is this a bug that is causing the settings to not be available here? I'd rather not do core edits..
The verify_password function is saying my password length is incorrect, but it isn't. Settings say between 6-30 and mine is 9...last time I checked my math that was between 6 and 30 :p
So I threw a couple emails in the userhandler for debugging (see code below) and when it tries to get the values for those settings, they're empty (see email text). I'm assuming that's why my password is failing.
function verify_password()
{
global $mybb;
$user = &$this->data;
mail('[email protected]', 'Pass lengths', "Min: {$mybb->settings['minpasswordlength']}\r\nMax: {$mybb->settings['maxpasswordlength']}");
// Always check for the length of the password.
if(my_strlen($user['password']) < $mybb->settings['minpasswordlength'] || my_strlen($user['password']) > $mybb->settings['maxpasswordlength'])
{
$this->set_error('invalid_password_length', array($mybb->settings['minpasswordlength'], $mybb->settings['maxpasswordlength']));
return false;
}
Quote:Min:
Max:
So my question is, why would those be empty? They're set in the config. Any ideas what's going on?
I added the following code to the beginning of the verify_password function to verify the settings are empty and everything worked correctly. So those settings are not set.
$mybb->settings['minpasswordlength'] = (!isset($mybb->settings['minpasswordlength']) || empty($mybb->settings['minpasswordlength'])) ? 6 : $mybb->settings['minpasswordlength'];
$mybb->settings['maxpasswordlength'] = (!isset($mybb->settings['maxpasswordlength']) || empty($mybb->settings['maxpasswordlength'])) ? 30 : $mybb->settings['maxpasswordlength'];
Is this a bug that is causing the settings to not be available here? I'd rather not do core edits..