X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fsponsor_functions.php;h=fdf4eb9f43b4bded1bc1104cc22545c38181eeb5;hp=6f43da5bb6f92b86db3eed27f3b3683915f865df;hb=0369c36aaab5af6ed44da1e13a53baef285f79b4;hpb=52690b87d4382bd4bc15905068ab99bb70b1e3c9 diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 6f43da5bb6..fdf4eb9f43 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -54,7 +54,7 @@ function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_ST ); // Check if sponsor already exists - foreach ($POST as $k=>$v) + foreach ($POST as $k => $v) { if (!(array_search($k, $SKIPPED) > -1)) { @@ -153,7 +153,7 @@ function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_ST if ($SAVE) { // Default is no force even when a guest want to abuse this force switch - if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = "0"; + if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0; // SQL and message string is empty by default $SQL = ""; $MSG = ""; @@ -163,7 +163,7 @@ function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_ST { // Update his data $SQL = "UPDATE "._MYSQL_PREFIX."_sponsor_data SET "; - foreach ($DATA['keys'] as $k=>$v) + foreach ($DATA['keys'] as $k => $v) { $SQL .= $v."='%s', "; } @@ -213,7 +213,7 @@ function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_ST { // Add all data as hidden data $OUT = ""; - foreach ($POST as $k=>$v) + foreach ($POST as $k => $v) { // Do not add 'force' ! if ($k != "force") @@ -421,15 +421,12 @@ ORDER BY sort", array($action), __FILE__, __LINE__); function GENERATE_SPONSOR_CONTENT($what) { global $HTTP_POST_VARS, $_GET, $CONFIG; - $FILE = PATH."inc/modules/sponsor/".$what.".php"; $OUT = ""; - if (@file_exists($FILE)) - { + $FILE = sprintf("%sinc/modules/sponsor/%s.php", PATH, $what); + if (FILE_READABLE($FILE)) { // Every sponsor action will output nothing directly. It will be written into $OUT! require_once($FILE); - } - else - { + } else { // File not found! $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_CONTENT_404_1.$what.SPONSOR_CONTENT_404_2); } @@ -481,13 +478,13 @@ function SPONSOR_SAVE_DATA($POST, $content) $MSG = SPONSOR_ACCOUNT_DATA_NOT_SAVED; // Check for submitted passwords - if ((!empty($HTTP_POST_VARS['pass1'])) && (!empty($HTTP_POST_VARS['pass2']))) + if ((!empty($_POST['pass1'])) && (!empty($_POST['pass2']))) { // Are both passwords the same? - if ($HTTP_POST_VARS['pass1'] == $HTTP_POST_VARS['pass2']) + if ($_POST['pass1'] == $_POST['pass2']) { // Okay, then set password and remove pass1 and pass2 - $HTTP_POST_VARS['password'] = md5($HTTP_POST_VARS['pass1']); + $_POST['password'] = md5($_POST['pass1']); } } @@ -503,7 +500,7 @@ function SPONSOR_SAVE_DATA($POST, $content) // Prepare SQL string $SQL = "UPDATE "._MYSQL_PREFIX."_sponsor_data SET"; - foreach ($POST as $key=>$value) + foreach ($POST as $key => $value) { // Mmmmm, too less security here??? $SQL .= " ".strip_tags($key)."='%s',"; @@ -593,17 +590,7 @@ function SPONSOR_SAVE_DATA($POST, $content) if (isset($content['warning_interval'])) $DATA['interval'] = CREATE_FANCY_TIME($POST['warning_interval']); // Send email to admins - if (GET_EXT_VERSION("admins") < "0.4.1") - { - // Use old method to send out - $msg = LOAD_EMAIL_TEMPLATE($templ, $content); - SEND_ADMIN_EMAILS($subj, $msg); - } - else - { - // Use new system to send out - SEND_ADMIN_EMAILS_PRO($subj, $templ, $content); - } + SEND_ADMIN_NOTIFICATION($subj, $templ, $content); // Shall we send mail to the sponsor's new email address? if ($content['receive_warnings'] == "Y")