X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fwernis_functions.php;h=263e40935d67291ca4f4e33c84b604d0e37058ce;hp=7a3adca9ba04417b5094f557595e695e0f17e7be;hb=99966a712b3b3d8b521524762e153353d1d20bd4;hpb=8862a2901206c02479261c49de78609ffb2ce9c2 diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 7a3adca9ba..263e40935d 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -219,8 +219,8 @@ function doAdminTestWernisApi () { // Prepare the request data $requestData = array( - 't_uid' => getWernisRefid(), - 't_md5' => getWernisPassMd5() + 't_uid' => getWernisRefid(), + 't_md5' => getWernisPassMd5() ); // Return the result from the lower functions @@ -268,6 +268,7 @@ function executeWernisApiWithdraw ($wdsId, $userMd5, $amount) { // Return the result from the lower functions $return = sendWernisApiRequest('book.php', $requestData); + // Did it went smoothly? if (isHttpResponseStatusOkay($return)) { // All fine! $result = TRUE; @@ -529,11 +530,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__ . '
'.print_r(postRequestArray(), TRUE).'
'); - } 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); @@ -668,15 +666,16 @@ function updateWernisRegistrationDataByKey ($updatedColumn, $key, $oldValue, $ne sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_wernis_regs` SET - `%s`='%s' + `%s` = '%s' WHERE - `%s`='%s' AND + `%s` = '%s' AND `%s` != '%s' LIMIT 1", array( $updatedColumn, $newValue, $key, + $oldValue, $updatedColumn, $oldValue ), __FUNCTION__, __LINE__ @@ -729,6 +728,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 //-----------------------------------------------------------------------------