]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/sponsor_functions.php
Security line in all includes changed
[mailer.git] / inc / libs / sponsor_functions.php
index 7bc398f5b505c2bf14a3eed1389e069bf64beaa0..4ae38518e05f1bda70bf4e3f2f62667d60c56506 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)) &&