]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/wernis_functions.php
Some more improvements:
[mailer.git] / inc / libs / wernis_functions.php
index 1db29a77bbf6f4e95fd77b053987dcfb4e28da7c..7a3adca9ba04417b5094f557595e695e0f17e7be 100644 (file)
@@ -529,13 +529,13 @@ function doDisplayWernisUserRegistrationForm () {
 
 // Finish user registration with WDS66 API
 function doWernisFinishUserRegistration ($challenge, $challengeResponse, $status) {
-       // Check status from GET parameters and stored value
+       // Check status from GET parameters and if the form has been sent
        if (($status == '1') && (isFormSent('wernis_register'))) {
-               // Form has been sent
-               die(__FUNCTION__ . ':' . __LINE__ . ': Reached!');
+               // The form has been sent and challenge is fine
+               die(__FUNCTION__ . ':' . __LINE__ . '<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
        } elseif ($status == '1') {
                // Get mapped data based on challenge
-               $return = getWernisMapedDataFromApiByChallenge($challenge, $status);
+               $return = getWernisMappedDataFromApiByChallenge($challenge, $status);
 
                // Is the array filled?
                if ((count($return['mapped_data']) > 0) && (empty($return['message']))) {
@@ -543,8 +543,10 @@ function doWernisFinishUserRegistration ($challenge, $challengeResponse, $status
                        $return['mapped_data'] = runFilterChain('register_must_fillout', $return['mapped_data']);
 
                        // Add missing elements
-                       $return['mapped_data']['gender'] = NULL;
-                       $return['mapped_data']['birthday_selection'] = generateDayMonthYearSelectionBox($return['mapped_data']['birth_day'], $return['mapped_data']['birth_month'], $return['mapped_data']['birth_year']);
+                       $return['mapped_data']['gender']               = NULL;
+                       $return['mapped_data']['birthday_selection']   = generateDayMonthYearSelectionBox($return['mapped_data']['birth_day'], $return['mapped_data']['birth_month'], $return['mapped_data']['birth_year']);
+                       $return['mapped_data']['challenge']            = getRequestElement('challenge');
+                       $return['mapped_data']['__challenge_response'] = getRequestElement('__challenge_response');
 
                        // Display form
                        loadTemplate('guest_wernis_registration_form', FALSE, $return['mapped_data']);
@@ -563,7 +565,7 @@ function doWernisFinishUserRegistration ($challenge, $challengeResponse, $status
 }
 
 // "Getter" for mapped data by calling the API and given challenge and status
-function getWernisMapedDataFromApiByChallenge ($challenge, $status) {
+function getWernisMappedDataFromApiByChallenge ($challenge, $status) {
        // Get stored registration data
        $rows = getWernisRegistrationDataByKey('api_redirect_challenge', $challenge);
 
@@ -797,7 +799,7 @@ function doWernisAuthAccepted ($args) {
        // auth_key and wernis_userid must be set
        assert(isset($args['auth_key']));
        assert(isset($args['wernis_userid']));
-       die(__FUNCTION__ . '<pre>'.print_r($args, TRUE).'</pre>');
+       die(__FUNCTION__ . ':' . __LINE__ . '<pre>' . print_r($args, TRUE) . '</pre>');
 }
 
 //-----------------------------------------------------------------------------