Security line in all includes changed
[mailer.git] / inc / functions.php
index 4733b66422ba70a677c7b9a6eeb43bbb011604d6..44fdf95282a4dbaeeb6d67974b1420ba5e968137 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -213,11 +213,13 @@ function LOAD_TEMPLATE($template, $return=false, $content="") {
        if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
        $REFID = $GLOBALS['refid'];
 
-       // DEPRECATED!!!
+       // @DEPRECATED Try to remove this if() block
        if ($template == "member_support_form") {
                // Support request of a member
                $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                 array($GLOBALS['userid']), __FILE__, __LINE__);
+
+               // @TODO Merge this data into $content
                list($gender, $surname, $family, $email) = SQL_FETCHROW($result);
 
                // Translate gender
@@ -2496,7 +2498,7 @@ function REBUILD_CACHE ($cache, $inc="") {
        // Shall I remove the cache file?
        if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) {
                // Rebuild cache
-               if ($cacheInstance->cache_file("admins", true)) {
+               if ($cacheInstance->cache_file($cache, true)) {
                        // Destroy it
                        $cacheInstance->cache_destroy();