]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/register_functions.php
Renamed function, used more "pool functions":
[mailer.git] / inc / libs / register_functions.php
index 2c9c46a57aa0d8d21b2b7122dfa30e7c28a875e4..2d6c8e719eb6647449807a168632aa4dad4910ca 100644 (file)
@@ -257,13 +257,12 @@ function isRegistrationDataComplete () {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay) . ',selected=' . $GLOBALS['registration_selected_cats'] . '/' . getLeastCats());
        $isOkay = (($isOkay) && ($GLOBALS['registration_selected_cats'] >= getLeastCats()));
 
-       if ((postRequestElement('email') != '!') && (isCheckDoubleEmailEnabled())) {
-               // Does the email address already exists in our database?
-               if ((isEmailTaken(postRequestElement('email'))) && (!isAdmin())) {
-                       setPostRequestElement('email', '?');
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did enter a already used email address.');
-                       $isOkay = FALSE;
-               } // END - if
+       // Check if email is taken, if configured
+       if ((isExtensionInstalledAndNewer('other', '0.3.0')) && (isCheckDoubleEmailEnabled()) && (postRequestElement('email') != '!') && (isEmailTaken(postRequestElement('email'))) && (!isAdmin())) {
+               // Is already used
+               setPostRequestElement('email', '?');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did enter a already used email address.');
+               $isOkay = FALSE;
        } // END - if
 
        // Check for IP timeout?
@@ -382,7 +381,7 @@ function doUserRegistration () {
        ), __FUNCTION__, __LINE__);
 
        // Get his userid
-       $filterData['register_insert_id'] = bigintval(SQL_INSERTID());
+       $filterData['register_insert_id'] = SQL_INSERT_ID();
 
        // Did this work?
        if (!isValidId($filterData['register_insert_id'])) {
@@ -537,7 +536,7 @@ function getDisplayRefid () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// Checks whether 'display_refid' is "YES"
+// Checks whether 'display_refid' is "Y"
 function isDisplayRefidEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
@@ -609,6 +608,18 @@ function isRegisterGeneratePasswordEmptyEnabled () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for least_cats
+function getLeastCats () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('least_cats');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // ----------------------------------------------------------------------------
 //                            Template helper functions
 // ----------------------------------------------------------------------------