X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doubler.php;h=99ab704236745fcaf8d8ffaae1765a2bb6c17ad8;hb=b60d6755eb34f6a302b30eeb363ed0853e8d987d;hp=aaf4c8053b2edaca8e30c0a638020c69e7b42e22;hpb=1fd39b2564946ce7f19776abab8d65a31928fba1;p=mailer.git diff --git a/doubler.php b/doubler.php index aaf4c8053b..99ab704236 100644 --- a/doubler.php +++ b/doubler.php @@ -14,11 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -67,9 +65,9 @@ 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'))) { + if (isNicknameUsed(postRequestParameter('userid'))) { // Nickname in URL, so load the id fetchUserData(postRequestParameter('userid'), 'nickname'); } else { @@ -80,7 +78,7 @@ if (isFormSent()) { // Is the data valid? if (!isUserDataValid()) { // Output message that the userid is not okay - loadTemplate('admin_settings_saved', false, '{--DOUBLER_USERID_INVALID--}'); + displayMessage('{--DOUBLER_USERID_INVALID--}'); } // END - if // Remove any dots and unwanted chars from the points @@ -90,9 +88,9 @@ 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 = getTotalPoints(getUserData('userid')); @@ -100,15 +98,16 @@ if (isFormSent()) { // So let's continue with probing his points amount if (($points - getConfig('doubler_left') - postRequestParameter('points') * getConfig('doubler_charge') / 100) >= 0) { // Enough points are left so let's continue with the doubling process - // Create doubling "account" width *DOUBLED* points - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s','%s','%s','".detectRemoteAddr()."', UNIX_TIMESTAMP(), 'N','N')", + // Create doubling "account" with *DOUBLED* points + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`,`refid`,`points`,`remote_ip`,`timemark`,`completed`,`is_ref`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(), 'N','N')", array( getUserData('userid'), - makeDatabaseUserId(determineReferalId()), - bigintval(postRequestParameter('points') * 2) + makeZeroToNull(determineReferalId()), + bigintval(postRequestParameter('points') * 2), + detectRemoteAddr() ), __FILE__, __LINE__); - // Subtract entered points + // Subtract entered points and ignore return status subtractPoints('doubler', getUserData('userid'), postRequestParameter('points')); // Add points to "total payed" including charge @@ -119,10 +118,11 @@ if (isFormSent()) { // Add second line for the referal but only when userid != refid 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')", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`,`refid`,`points`,`remote_ip`,`timemark`,`completed`,`is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')", array( - makeDatabaseUserId(determineReferalId()), - bigintval(postRequestParameter('points') * 2 * getConfig('doubler_ref') / 100) + makeZeroToNull(determineReferalId()), + (postRequestParameter('points') * 2 * getConfig('doubler_ref') / 100), + detectRemoteAddr() ), __FILE__, __LINE__); // And that's why we don't want to you more than one referal level of doubler-points. ^^^ @@ -152,7 +152,7 @@ if (isFormSent()) { } elseif (postRequestParameter('points') > getConfig('doubler_max')) { // Too much points entered $content['message'] = '{--DOUBLER_FORM_POINTS_MAX--}'; - } elseif (isNickNameUsed(postRequestParameter('userid'))) { + } elseif (isNicknameUsed(postRequestParameter('userid'))) { // Cannot resolv nickname -> userid $content['message'] = '{--DOUBLER_FORM_404_NICKNAME--}'; } else { @@ -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')) { @@ -172,7 +172,9 @@ if (isFormSent()) { } // END - if (isFormSet()) // Shall I check for points immediately? -if (getConfig('doubler_send_mode') == 'DIRECT') loadInclude('inc/mails/doubler_mails.php'); +if (getConfig('doubler_send_mode') == 'DIRECT') { + loadInclude('inc/mails/doubler_mails.php'); +} // END - if // Output header loadIncludeOnce('inc/header.php');