//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if ((isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'register')) {
+ if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// Run it
$filterData['status'] = doGenericUserRegistration();
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is the registration provider set?
- if ((isFormSent()) && (isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'register')) {
+ if ((isFormSent()) && (isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// Check form
$isFormSent = isRegistrationDataComplete();
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if ((isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'register')) {
+ if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// Run it
displayMessage('{--REGISTRATION_DONE--}');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if ((isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'register')) {
+ if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// This should not be reached
reportBug(__FUNCTION__, __LINE__, 'This filter should not handle it.');
} // END - if
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if (((isGetRequestElementSet('provider')) && (getRequestElement('provider') == 'register')) || ((!isGetRequestElementSet('provider')) && (getDefaultRegistrationProvider() == 'register'))) {
+ if (((isGetRequestElementSet('registration_provider')) && (getRequestElement('registration_provider') == 'register')) || ((!isGetRequestElementSet('registration_provider')) && (getDefaultRegistrationProvider() == 'register'))) {
// Display generic form
doDisplayGenericUserRegistrationForm();
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if ((isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'wernis')) {
+ if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
// Run it
$filterData['status'] = doWernisUserRegistration();
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if ((isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'wernis')) {
+ if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
// Run it
// Interrupt filter chain
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is generic user registration selected?
- if ((isPostRequestElementSet('provider')) && (postRequestElement('provider') == 'wernis')) {
+ if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
// Run it
// Interrupt filter chain
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Is WDS66 user registration selected?
- if (((isGetRequestElementSet('provider')) && (getRequestElement('provider') == 'wernis')) || ((!isGetRequestElementSet('provider')) && (getDefaultRegistrationProvider() == 'wernis'))) {
+ if (((isGetRequestElementSet('registration_provider')) && (getRequestElement('registration_provider') == 'wernis')) || ((!isGetRequestElementSet('registration_provider')) && (getDefaultRegistrationProvider() == 'wernis'))) {
// Run it
doDisplayWernisUserRegistrationForm();
}
// Filter to run WDS66 API user registation check
-function FILTER_WERNIS_USER_REGISTRATION_CHECK ($filterData) {
+function FILTER_WERNIS_USER_REGISTRATION_CHECK () {
+ // Default is form is not sent
+ $isFormSent = FALSE;
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Is the registration provider set?
+ if ((isFormSent('wernis_register')) && (isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
+ // Check form
+ $isFormSent = isRegistrationDataComplete();
+
+ // Interrupt filter chain
+ interruptFilterChain();
+ } // END - if
+
// Return it
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
- return $filterData;
+ return $isFormSent;
}
// Filter for WDS66 API user login
// @TODO 0% done
function FILTER_WERNIS_USER_LOGIN ($filterData) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Return filter data
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
return $filterData;
}
// Filter for WDS66 API user login check
// @TODO 0% done
function FILTER_WERNIS_USER_LOGIN_CHECK ($filterData) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
// Return filter data
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
return $filterData;
}
return FALSE;
} // END - if
+ // These elements must be set
+ assert(isset($GLOBALS['register_country_row']));
+ assert(isset($GLOBALS['register_country_data']));
+ assert(isset($GLOBALS['register_confirm_hash']));
+
+ // Only comment this in if you develop
+ //* DEVELOPER-CODE: */ return TRUE;
+
// Create user's account...
sqlQueryEscaped("INSERT INTO
`{?_MYSQL_PREFIX?}_user_data`
// 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']))) {
}
// "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);
// 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>');
}
//-----------------------------------------------------------------------------
}
} else {
// Is a registration provider selected?
- if (!isGetRequestElementSet('provider')) {
+ if (!isGetRequestElementSet('registration_provider')) {
// Display selector form
loadTemplate('guest_registration_select');
} // END - if
-<li><a href="{%url=modules.php?module=index&what=register&provider=$content[provider_extension]%}">{%pipe,translateRegistrationProviderName=$content[provider_name]%}</a></li>
+<li><a href="{%url=modules.php?module=index&what=register&registration_provider=$content[provider_extension]%}">{%pipe,translateRegistrationProviderName=$content[provider_name]%}</a></li>
<div align="center">
-{%form,formMethodPost,formNameWernis_register=modules.php?module=index&what=register&provider=wernis&status=1&challenge=$content[challenge]&__challenge_response=$content[__challenge_response]%}
-<input type="hidden" name="registration_provider" value="register" />
+{%form,formMethodPost,formNameWernis_register=modules.php?module=index&what=register&registration_provider=wernis&status=1&challenge=$content[challenge]&__challenge_response=$content[__challenge_response]%}
+<input type="hidden" name="registration_provider" value="wernis" />
<table border="0" cellspacing="0" cellpadding="0" width="640" class="table dashed">
<tr>
<td colspan="2" class="table_header bottom">
<div class="para">
<div align="center">
- {%form,formMethodPost=modules.php?module=index&what=register&provider=wernis%}
+ {%form,formMethodPost=modules.php?module=index&what=register&registration_provider=wernis%}
<div class="table dashed">
<div class="table_header bottom">
{--GUEST_WERNIS_REGISTRATION_TITLE--}