X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doubler.php;h=76e16485535833d1f4d84c2c9efecd18d1909414;hb=9d794e925ba857067b03efb20649c72eee9c5797;hp=635448e77b3de39a2c0c33f814b16c056abaed69;hpb=f1b901fabdfbdc8ced0aa2b85f6603f1fe3e0055;p=mailer.git diff --git a/doubler.php b/doubler.php index 635448e77b..76e1648553 100644 --- a/doubler.php +++ b/doubler.php @@ -67,7 +67,7 @@ if (isFormSent()) { setPostRequestParameter('points', bigintval(postRequestParameter('points'))); // Begin with doubling process - if ((isPostRequestParameterSet('userid')) && (isPostRequestParameterSet('pass')) && (isPostRequestParameterSet('points'))) { + if ((isPostRequestParameterSet('userid')) && (isPostRequestParameterSet('password')) && (isPostRequestParameterSet('points'))) { // Probe for nickname extension and if a nickname was entered if (isNickNameUsed(postRequestParameter('userid'))) { // Nickname in URL, so load the id @@ -90,12 +90,12 @@ if (isFormSent()) { $probe_points = ((postRequestParameter('points') >= getConfig('doubler_min')) && (postRequestParameter('points') <= getConfig('doubler_max'))); // Check all together - if ((isUserDataValid()) && (getUserData('password') == generateHash(postRequestParameter('pass'), substr(getUserData('password'), 0, -40))) && (getUserData('status') == 'CONFIRMED') && ($probe_points)) { + if ((isUserDataValid()) && (getUserData('password') == generateHash(postRequestParameter('password'), substr(getUserData('password'), 0, -40))) && (getUserData('status') == 'CONFIRMED') && ($probe_points)) { // Nickname resolved to a unique userid or direct userid entered by the member - $GLOBALS['doubler_userid'] = getUserData('userid'); + $GLOBALS['local_doubler_userid'] = getUserData('userid'); // Calulcate points - $points = countSumTotalData(getUserData('userid'), 'user_points', 'points') - countSumTotalData(getUserData('userid'), 'user_data', 'used_points'); + $points = getTotalPoints(getUserData('userid')); // So let's continue with probing his points amount if (($points - getConfig('doubler_left') - postRequestParameter('points') * getConfig('doubler_charge') / 100) >= 0) { @@ -117,7 +117,7 @@ if (isFormSent()) { incrementConfigEntry('doubler_points', $points); // Add second line for the referal but only when userid != refid - if ((determineReferalId() > 0) && (determineReferalId() != getUserData('userid'))) { + if ((isValidUserId(determineReferalId())) && (determineReferalId() != getUserData('userid'))) { // Okay add a refid line and apply refid percents SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s',0,'%s','".detectRemoteAddr()."',UNIX_TIMESTAMP(),'N','Y')", array( @@ -162,7 +162,7 @@ if (isFormSent()) { } elseif (!isPostRequestParameterSet('userid')) { // Login not entered $content['message'] = '{--DOUBLER_FORM_404_LOGIN--}'; - } elseif (!isPostRequestParameterSet('pass')) { + } elseif (!isPostRequestParameterSet('password')) { // Password not entered $content['message'] = '{--DOUBLER_FORM_404_PASSWORD--}'; } elseif (!isPostRequestParameterSet('points')) {