Added new pre-registration filter for WDS66-based registration (unfinished).
authorRoland Haeder <roland@mxchange.org>
Thu, 17 Apr 2014 21:36:08 +0000 (23:36 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 17 Apr 2014 21:36:08 +0000 (23:36 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
inc/extensions/ext-wernis.php
inc/extensions/wernis/mode-update.php
inc/filter/wernis_filter.php
inc/libs/wernis_functions.php

index 0fbf56ee834765eefef0830452d8e600696a1756..3065afcc0a4ab203f90252e8cf88c7fc45c2ec56 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version of this extension
-setThisExtensionVersion('0.0.8');
+setThisExtensionVersion('0.0.9');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9'));
 
 switch (getExtensionMode()) {
        case 'setup': // Do stuff when installation is running
@@ -103,6 +103,7 @@ INDEX (`userid`)",
                unregisterFilter(__FILE__, __LINE__, 'user_registration_failed', 'WERNIS_USER_REGISTRATION_FAILED', TRUE, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'user_registration_form', 'WERNIS_USER_REGISTRATION_FORM', TRUE, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'user_login', 'WERNIS_USER_LOGIN', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_WERNIS', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 4f431d409d3ad0176d73fb643b119e694906d3e4..70cde3703c8cbe9c6f7b261753e4e810efb2dc15 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Auszahlung-Erweiterung                           *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
@@ -134,6 +129,14 @@ INDEX (`wernis_userid`)",
                // Update notes (these will be set as task text!)
                setExtensionUpdateNotes("Basis-URL f&uuml;r alle Scripte (Referral-Link, auth.php-Umleitung usw. nicht aber API) und Tabelle f&uuml;r API-Aufrufe von auth.php hinzugef&uuml;gt.");
                break;
+
+       case '0.0.9': // SQL queries for v0.0.9
+               // Register a filter
+               registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_WERNIS', FALSE, TRUE, isExtensionDryRun());
+
+               // Update notes (these will be set as task text!)
+               setExtensionUpdateNotes("Basis-URL f&uuml;r alle Scripte (Referral-Link, auth.php-Umleitung usw. nicht aber API) und Tabelle f&uuml;r API-Aufrufe von auth.php hinzugef&uuml;gt.");
+               break;
 } // END - switch
 
 // [EOF]
index 902473adfba8ebb8672b1c9d415403bff5430cdf..2bedc8c7b02285ef6bf2d25a8410ad457ad661fb 100644 (file)
@@ -153,5 +153,20 @@ function FILTER_WERNIS_USER_LOGIN_CHECK ($filterData) {
        return $filterData;
 }
 
+/**
+ * Run a filter for pre user registration
+ *
+ * @param      $filterData             Filter data from previous filter
+ * @return     $filterData             Unchanged filter data
+ */
+function FILTER_PRE_USER_REGISTRATION_WERNIS ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       /* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
+       return $filterData;
+}
+
 // [EOF]
 ?>
index 7a3adca9ba04417b5094f557595e695e0f17e7be..922cb56ff8d05d0c4fb83780f20fa26db794d2cd 100644 (file)
@@ -529,11 +529,8 @@ function doDisplayWernisUserRegistrationForm () {
 
 // Finish user registration with WDS66 API
 function doWernisFinishUserRegistration ($challenge, $challengeResponse, $status) {
-       // Check status from GET parameters and if the form has been sent
-       if (($status == '1') && (isFormSent('wernis_register'))) {
-               // The form has been sent and challenge is fine
-               die(__FUNCTION__ . ':' . __LINE__ . '<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
-       } elseif ($status == '1') {
+       // Is the status 1? (= all fine with API call)
+       if ($status == '1') {
                // Get mapped data based on challenge
                $return = getWernisMappedDataFromApiByChallenge($challenge, $status);
 
@@ -729,6 +726,24 @@ LIMIT %d",
        return $rows;
 }
 
+// Do local user registration with data from WDS66 API
+function doWernisUserRegistration () {
+       // Call generic registration function
+       $status = doGenericUserRegistration();
+
+       // Does this went fine?
+       if ($status === FALSE) {
+               // No, then abort here silently
+               return FALSE;
+       } // END - if
+
+       // Make sure the user id is valid
+       assert(isset($GLOBALS['register_userid']));
+       assert(isValidId($GLOBALS['register_userid']));
+
+       // Generic registration is finished, so add more data:
+}
+
 //-----------------------------------------------------------------------------
 //                      Auth status callback functions
 //-----------------------------------------------------------------------------