]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/register_functions.php
Rewrote handling of extra SQL columns/data for registration. The very generic filter...
[mailer.git] / inc / libs / register_functions.php
index 667b83c0f78252f5da6a9d782ca7c1cbc1cbd491..3c750c2284a1e8433c7678f7c3de9cc994e12212 100644 (file)
@@ -159,7 +159,7 @@ function isRegistrationDataComplete () {
 
        // Did he enter a valid email address? (we really don't care about
        // that, he has to click on a confirmation link :P )
-       if ((!isPostRequestElementSet('email')) || (!isEmailValid(postRequestElement('email')))) {
+       if ((!isAdmin()) && ((!isPostRequestElementSet('email')) || (!isEmailValid(postRequestElement('email'))))) {
                setPostRequestElement('email', '!');
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'User did not enter proper email address.');
                $isOkay = false;
@@ -254,7 +254,7 @@ function isRegistrationDataComplete () {
        } // END - if
 
        // Enougth categories selected?
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',selected='.$GLOBALS['registration_selected_cats'].'/'.getLeastCats());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay) . ',selected=' . $GLOBALS['registration_selected_cats'] . '/' . getLeastCats());
        $isOkay = (($isOkay) && ($GLOBALS['registration_selected_cats'] >= getLeastCats()));
 
        if ((postRequestElement('email') != '!') && (isCheckDoubleEmailEnabled())) {
@@ -267,16 +267,16 @@ function isRegistrationDataComplete () {
        } // END - if
 
        // Check for IP timeout?
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay));
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay));
        if ((!isAdmin()) && (getIpTimeout() > 0)) {
                // Check his IP number
                $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr()  , 'user_data', 'userid', 'REMOTE_ADDR', true, ' AND ((UNIX_TIMESTAMP() - `joined`) < {?ip_timeout?} OR (UNIX_TIMESTAMP() - `last_update`) < {?ip_timeout?})') == 1);
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',timeout='.intval($GLOBALS['registration_ip_timeout']));
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay).',timeout='.intval($GLOBALS['registration_ip_timeout']));
                $isOkay = (($isOkay) && (!$GLOBALS['registration_ip_timeout']));
        } // END - if
 
        // Return result
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay));
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay=' . intval($isOkay) . ' - EXIT!');
        return $isOkay;
 }
 
@@ -498,6 +498,36 @@ function doUserRegistration () {
        return true;
 }
 
+// Initialize extra registration SQL
+function initExtraRegistrationSql () {
+       $GLOBALS['register_sql_columns'] = '';
+       $GLOBALS['register_sql_data']    = '';
+}
+
+// Add extra column for registration SQL
+function addExtraRegistrationColumns ($column) {
+       // Is it set?
+       if (!isset($GLOBALS['register_sql_columns'])) {
+               // Then initialize it
+               initExtraRegistrationSql();
+       } // END - if
+
+       // Add column
+       $GLOBALS['register_sql_columns'] .= $column;
+}
+
+// Add extra data for registration SQL
+function addExtraRegistrationData ($data) {
+       // Is it set?
+       if (!isset($GLOBALS['register_sql_data'])) {
+               // Then initialize it
+               initExtraRegistrationSql();
+       } // END - if
+
+       // Add column
+       $GLOBALS['register_sql_data'] .= $data;
+}
+
 //-----------------------------------------------------------------------------
 //                      Wrapper functions for ext-register
 //-----------------------------------------------------------------------------