]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/register_filter.php
Continued a bit:
[mailer.git] / inc / filter / register_filter.php
index 0720d5f8dddae4f9bd5aea03e851b0dffeb59357..0e598bfe587db89a0ddbadb4264c751f5fe58797 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -44,11 +44,11 @@ if (!defined('__SECURITY')) {
 function FILTER_REGISTER_MUST_FILLOUT ($filterData) {
        // Get all fields for output
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
-       $result = SQL_QUERY('SELECT `field_name`,`field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
+       $result = sqlQuery('SELECT `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC',
                __FUNCTION__, __LINE__);
 
        // Walk through all entries
-       while ($row = SQL_FETCHARRAY($result)) {
+       while ($row = sqlFetchArray($result)) {
                // Must the user fill out this element?
                $value = '';
                if ($row['field_required'] == 'Y') {
@@ -60,7 +60,7 @@ function FILTER_REGISTER_MUST_FILLOUT ($filterData) {
        } // END - while
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Return it
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
@@ -90,7 +90,7 @@ function FILTER_PRE_USER_REGISTRATION_GENERIC ($filterData) {
                postRequestElement('month') . '-' .
                postRequestElement('day') . '-' .
                postRequestElement('year') . getEncryptSeparator() .
-               postRequestElement('pass1') . getEncryptSeparator() .
+               postRequestElement('password1') . getEncryptSeparator() .
                detectServerName() . getEncryptSeparator() .
                detectRemoteAddr() . getEncryptSeparator() .
                detectUserAgent() . '/' .
@@ -110,13 +110,99 @@ function FILTER_PRE_USER_REGISTRATION_GENERIC ($filterData) {
        setPostRequestElement('remote_addr', detectRemoteAddr());
 
        // Generic initialization is done
-       $filterData['init_done'] = true;
+       $filterData['init_done'] = TRUE;
 
        // Return it
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
-       //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+       //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
        return $filterData;
 }
 
+// Filter to run generic user registation (default)
+function FILTER_GENERIC_USER_REGISTRATION ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // Run it
+               $filterData['status'] = doGenericUserRegistration();
+
+               // Interrupt filter chain
+               interruptFilterChain();
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// Filter to run generic user registation check (default)
+function FILTER_GENERIC_USER_REGISTRATION_CHECK () {
+       // Default is form is not sent
+       $isFormSent = FALSE;
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is the registration provider set?
+       if ((isFormSent()) && (isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // Check form
+               $isFormSent = isRegistrationDataComplete();
+
+               // Interrupt filter chain
+               interruptFilterChain();
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $isFormSent;
+}
+
+// Filter to run generic things on registration done
+function FILTER_GENERIC_USER_REGISTRATION_DONE () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // Run it
+               displayMessage('{--REGISTRATION_DONE--}');
+
+               // Interrupt filter chain
+               interruptFilterChain();
+       } // END - if
+
+       // Return NULL
+       return NULL;
+}
+
+// Filter to run generic things on registration failed
+function FILTER_GENERIC_USER_REGISTRATION_FAILED () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // This should not be reached
+               reportBug(__FUNCTION__, __LINE__, 'This filter should not handle it.');
+       } // END - if
+
+       // Return NULL
+       return NULL;
+}
+
+// Filter to run generic things on registration form
+function FILTER_GENERIC_USER_REGISTRATION_FORM () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if (((isGetRequestElementSet('registration_provider')) && (getRequestElement('registration_provider') == 'register')) || ((!isGetRequestElementSet('registration_provider')) && (getDefaultRegistrationProvider() == 'register'))) {
+               // Display generic form
+               doDisplayGenericUserRegistrationForm();
+
+               // Interrupt filter chain
+               interruptFilterChain();
+       } // END - if
+
+       // Return NULL
+       return NULL;
+}
+
 // [EOF]
 ?>