]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/sponsor_functions.php
Fix for warning in rallye
[mailer.git] / inc / libs / sponsor_functions.php
index 7bc398f5b505c2bf14a3eed1389e069bf64beaa0..31a7578e6e3a74ef6df7c6b7967efd4580158578 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);
 }
+
 //
 function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_STATUS=false)
 {
@@ -365,7 +365,7 @@ ORDER BY sort", __FILE__, __LINE__);
                {
                        // Load sub menus
                        $result_sub = SQL_QUERY_ESC("SELECT what, title FROM "._MYSQL_PREFIX."_sponsor_menu
-WHERE action='%s' AND what != '' ".$WHERE."
+WHERE action='%s' AND what != '' AND what IS NOT NULL ".$WHERE."
 ORDER BY sort", array($action), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result_sub) > 0)
                        {
@@ -420,7 +420,7 @@ ORDER BY sort", array($action), __FILE__, __LINE__);
 //
 function GENERATE_SPONSOR_CONTENT($what)
 {
-       global $HTTP_POST_VARS, $_GET, $CONFIG;
+       global $_CONFIG;
        $OUT = "";
        $FILE = sprintf("%sinc/modules/sponsor/%s.php", PATH, $what);
        if (FILE_READABLE($FILE)) {
@@ -437,14 +437,14 @@ function GENERATE_SPONSOR_CONTENT($what)
 //
 function UPDATE_SPONSOR_LOGIN()
 {
-       global $_COOKIE, $CONFIG;
+       global $_COOKIE, $_CONFIG;
 
        // Check if cookies are set
        if ((empty($_COOKIE['sponsorid'])) || (empty($_COOKIE['sponsorpass']))) return false;
 
        // Calculate cookie lifetime, maybe we have to change this so the admin can setup a
        // seperate timeout for these two cookies?
-       $life = (time() + $CONFIG['online_timeout']);
+       $life = (time() + $_CONFIG['online_timeout']);
 
        // Is confirmed so both is fine and we can continue with login procedure
        $login = ((setcookie("sponsorid"  , bigintval($_COOKIE['sponsorid']), $life, COOKIE_PATH)) &&
@@ -471,7 +471,7 @@ function SPONSOR_SAVE_DATA($POST, $content)
 
        // Unsecure data which we don't want
        $UNSAFE = array('password', 'id', 'remote_addr', 'sponsor_created', 'last_online', 'status', 'ref_count',
-                       'points_amount', 'points_used', 'refid', 'hash' , 'last_pay', 'last_curr', 'pass_old',
+                       'points_amount', 'points_used', 'refid', 'hash', 'last_pay', 'last_curr', 'pass_old',
                        'ok', 'pass1', 'pass2');
 
        // Set default message ("not saved")