]> git.mxchange.org Git - mailer.git/blobdiff - inc/mails/beg_mails.php
Security line in all includes changed
[mailer.git] / inc / mails / beg_mails.php
index 7bbd91f4f422f9652abd63aad1af6349456f77f4..d6206350aef535f0271897ba44e1af680becf002 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-}
- elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
        return;
 }
@@ -47,7 +44,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 if ($CSS == 1) return;
 
 // Create timemark from saved month
-$mark = mktime(0, 0, 0, $_CONFIG['beg_month'], date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time()));
 $SQL = ""; $MODE = "";
 
 // Shall I sent activation or deactivation mail?
@@ -55,7 +52,7 @@ $SQL = "SELECT userid, email FROM "._MYSQL_PREFIX."_user_data WHERE (beg_ral_not
 switch ($_CONFIG['beg_rallye'])
 {
 case 'Y': // Begging rallye is activated
-       if ($_CONFIG['beg_ral_en_notify'] == 'Y')
+       if ($_CONFIG['beg_ral_en_notify'] == "Y")
        {
                // Okay, let's check for member accounts
                $SQL .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)";
@@ -69,7 +66,7 @@ case 'Y': // Begging rallye is activated
        break;
 
 case 'N': // Begging rallye is deactivated
-       if ($_CONFIG['beg_ral_di_notify'] == 'Y')
+       if ($_CONFIG['beg_ral_di_notify'] == "Y")
        {
                // Okay, let's check for member accounts
                $SQL .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify";
@@ -123,7 +120,7 @@ if (!empty($SQL))
                {
                        // Update account
                        $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
-SET beg_ral_notify='%s', beg_ral_%s_notify='%s' WHERE userid=%d LIMIT 1",
+SET beg_ral_notify='%s', beg_ral_%s_notify='%s' WHERE userid=%s LIMIT 1",
  array(time(), $MODE, time(), $uid), __FILE__, __LINE__);
 
                        // Load email template and send it to the user!