// Checks whether the registration data is complete
function isRegistrationDataComplete () {
// Init elements
- $GLOBALS['registration_ip_timeout'] = FALSE;
- $GLOBALS['registration_short_password'] = FALSE;
- $GLOBALS['registration_selected_cats'] = '0';
+ $GLOBALS['registration_ip_timeout'] = FALSE;
+ $GLOBALS['registration_weak_password'] = FALSE;
+ $GLOBALS['registration_selected_cats'] = '0';
// Default is okay
$isOkay = TRUE;
+ $isRandom = FALSE;
// First we only check the submitted data then we continue... :)
//
if ((isExtensionInstalledAndNewer('register', '0.5.5')) && (isRegisterGeneratePasswordEmptyEnabled())) {
// Generate a random password
$randomPassword = generatePassword();
+ $isRandom = TRUE;
// Set it in both entries
setPostRequestElement('password1', $randomPassword);
$isOkay = FALSE;
} // END - if
- // Is the password long enouth?
- if ((strlen(postRequestElement('password1')) < getPassLen()) && ($isOkay === TRUE)) {
- $GLOBALS['registration_short_password'] = TRUE;
+ // Is the password strong enough?
+ if (($isRandom === FALSE) && (!isStrongPassword(postRequestElement('password1')))) {
+ $GLOBALS['registration_weak_password'] = TRUE;
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did enter a short password.');
$isOkay = FALSE;
} // END - if