]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/register_functions.php
Heacy rewrite/cleanup:
[mailer.git] / inc / libs / register_functions.php
index 94826655e798ffb00230aee4882da57763f91239..9fdf938c698c4f5008ce37e29ab1d281430bd439 100644 (file)
@@ -141,12 +141,13 @@ function registerOutputFailedMessage ($messageId, $extra='') {
 // 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... :)
        //
@@ -192,6 +193,7 @@ function isRegistrationDataComplete () {
                if ((isExtensionInstalledAndNewer('register', '0.5.5')) && (isRegisterGeneratePasswordEmptyEnabled())) {
                        // Generate a random password
                        $randomPassword = generatePassword();
+                       $isRandom = TRUE;
 
                        // Set it in both entries
                        setPostRequestElement('password1', $randomPassword);
@@ -235,9 +237,9 @@ function isRegistrationDataComplete () {
                $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