X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fwernis_functions.php;h=922cb56ff8d05d0c4fb83780f20fa26db794d2cd;hb=5942a52ee1b26fdf495dc9c0946d616afc649607;hp=1db29a77bbf6f4e95fd77b053987dcfb4e28da7c;hpb=c1ce3b98c13fabf834d11a847eb2d297ead8d53d;p=mailer.git diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 1db29a77bb..922cb56ff8 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -529,13 +529,10 @@ function doDisplayWernisUserRegistrationForm () { // Finish user registration with WDS66 API function doWernisFinishUserRegistration ($challenge, $challengeResponse, $status) { - // Check status from GET parameters and stored value - if (($status == '1') && (isFormSent('wernis_register'))) { - // Form has been sent - die(__FUNCTION__ . ':' . __LINE__ . ': Reached!'); - } elseif ($status == '1') { + // Is the status 1? (= all fine with API call) + if ($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 +540,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 +562,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); @@ -727,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 //----------------------------------------------------------------------------- @@ -797,7 +814,7 @@ function doWernisAuthAccepted ($args) { // auth_key and wernis_userid must be set assert(isset($args['auth_key'])); assert(isset($args['wernis_userid'])); - die(__FUNCTION__ . '
'.print_r($args, TRUE).'
'); + die(__FUNCTION__ . ':' . __LINE__ . '
' . print_r($args, TRUE) . '
'); } //-----------------------------------------------------------------------------