Some fixes for isBooleanConstantAndTrue()
authorRoland Häder <roland@mxchange.org>
Sun, 21 Sep 2008 14:24:49 +0000 (14:24 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 21 Sep 2008 14:24:49 +0000 (14:24 +0000)
19 files changed:
inc/check-reset.php
inc/databases.php
inc/extensions.php
inc/functions.php
inc/header.php
inc/install-inc.php
inc/load_extensions.php
inc/modules/admin.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/reset/reset_beg.php
inc/reset/reset_bonus.php
inc/reset/reset_engine.php
inc/reset/reset_holiday.php
inc/stylesheet.php
inc/theme-manager.php

index ebda4415d7753a96ad75b29e5a03945e48b137d1..1b348a97c7cd1285cd78cffa606ccb4e15060290 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // 01    2                            2        2         3321    1                         2                     21    1                        2                    21    1                        2                  21    1      2                 21    1         1    1                         2            210
-if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1) && (!isBooleanConstantAndTrue('DEBUG_MODE'))) {
+if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!defined('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1) && (!defined('DEBUG_MODE'))) {
        // Do daily things in external PHP file but only when script is completely setup
        // Daily reset was run!
        define('__DAILY_RESET', true);
index e266053c350d979d90fdca28ef2229d121d59f21..1bbe2a3293a207d1345d8cf7692b7efa89f17598 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "376");
+define('CURR_SVN_REVISION', "377");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 3973f4132afb746d5403111617ac69ccaf6819dc..84506151e18d3cfb4ccb897df18e80c8048d8cc1 100644 (file)
@@ -319,7 +319,7 @@ function EXT_IS_ACTIVE ($ext_name) {
        global $cacheArray, $_CONFIG;
 
        // Extensions are all inactive during installation
-       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
+       if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
 
        // Not active is the default
        $active = "N";
@@ -368,7 +368,7 @@ function GET_EXT_VERSION ($ext_name) {
        $ret = false;
 
        // Extensions are all inactive during installation
-       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
+       if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
        //* DEBUG: */ echo __FUNCTION__.": ext_name={$ext_name}<br />\n";
 
        // Is the cache written?
index 5abc31bab29689eea015ce8295ab5677d53a2c1d..318af2c2262240efe73ee8b02eeda1682c680d58 100644 (file)
@@ -321,7 +321,7 @@ function LOAD_TEMPLATE($template, $return=false, $content="") {
 
                // Add surrounding HTML comments to help finding bugs faster
                $ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
-       } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!isBooleanConstantAndTrue('mxchange_installed')))) {
+       } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!defined('mxchange_installed')))) {
                // Only admins shall see this warning or when installation mode is active
                $ret = "<br /><SPAN class=\"guest_failed\">".TEMPLATE_404."</SPAN><br />
 (".basename($file).")<br />
@@ -2353,7 +2353,7 @@ function RESET_ADD_INCLUDES () {
        global $_CONFIG;
 
        // Is the reset set or old sql_patches?
-       if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
+       if ((!defined('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
                // Then abort here
                return array();
        } // END - if
index 8f2d54deae8f6518ec0d94e4a5a4b05c0ce70e83..1031590a81c4746f0a56a7933c295454fb0541d8 100644 (file)
@@ -80,7 +80,7 @@ if (($header != "1") && ($header != "2")) {
 
                                // Remember title in constant for the template
                                define('__PAGE_TITLE', html_entity_decode($TITLE));
-                       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+                       } elseif ((!defined('mxchange_installed')) || (!defined('admin_registered'))) {
                                // Load language file because it was missing in installation finalizer step... *sigh*
                                require_once(sprintf("%sinc/language/install_%s.php",
                                        PATH,
index 55eb350f4fd272dab2db9fa5976de5e90018b5eb..80f4686904fdc7ba1e97d6201ec4e45233a0a4c0 100644 (file)
@@ -136,7 +136,7 @@ if ((isset($_GET['page']) && ($_GET['page'] == 5))) {
 }
 
 // Is MXChange installed or no admin registered so far?
-if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
+if ((!defined('mxchange_installed')) || (!defined('admin_registered')))
 {
        // Set URL for FORM actions
        define('__BURL_ACTION', $burl);
@@ -275,7 +275,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".YES."</OPTION>
       <OPTION value=\"false\"");
-               if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
+               if (!defined('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".NO."</OPTION>
     </SELECT>
   </TD>
@@ -289,7 +289,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".YES."</OPTION>
       <OPTION value=\"false\"");
-               if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
+               if (!defined('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
                OUTPUT_HTML(">".NO."</OPTION>
     </SELECT>
   </TD>
@@ -331,7 +331,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                break;
 
        case "finalize": // Write captured data to files
-               if ((!empty($_POST['finalize'])) && (!isBooleanConstantAndTrue('mxchange_installed'))) {
+               if ((!empty($_POST['finalize'])) && (!defined('mxchange_installed'))) {
                        // You have submitted data then we have to reset the fatal messages
                        $FATAL = array(); $SQLs = array();
 
index 21fdf5ee5a905bfe0192c18f35b51ff3951be1e7..3fea0700f1513b4bd27cc4501934b4b0e4308f2a 100644 (file)
@@ -42,7 +42,7 @@ $EXT_CSS_FILES = array();
 $ADD = "";
 
 // Skip loading extensions
-if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
+if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
 
 // Load default sql_patches extension if present
 if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) {
index 367a96cbe9fb14fc0f3d641005974a85ecdab340..7578e6c7d582c34c36c21f59b84888d217df7b57 100644 (file)
@@ -49,7 +49,7 @@ require_once(PATH."inc/modules/admin/admin-inc.php");
 // Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
 FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
 
-if (!isBooleanConstantAndTrue('admin_registered')) {
+if (!defined('admin_registered')) {
        // Admin is not registered so we have to inform the user
        if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
        if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
@@ -90,7 +90,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                                $ret = "done";
                        }
 
-                       if (!isBooleanConstantAndTrue('admin_registered')) {
+                       if (!defined('admin_registered')) {
                                // Write to config that registration is done
                                admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
index be310f4d047ba26fa8c4102d4a01607ffdf36a1e..35e62117a947beb87b69548936c842cbb36f6148 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
 
 // Get current month (2 digits)
 $curr = date("m", time());
index 0c5f9dd64ac25371b25515b00461b1bcb3baec8c..42cfdeb3e4f3baa5e30172d5e1939693cee4e25d 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Get current month (2 digits)
 $curr = date("m", time());
index 46b2bdb1827e0e4539e5105799afc51545586e85..2cfaaa02630208f84e4ed7a148764fdb08141605 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Get current month (2 digits)
 $curr = date("m", time());
index 85323f6bad7f633e1dbf57c7a3f2db6cfc930d50..600eae105304340a7a8d000062b7b800f14500f8 100644 (file)
@@ -53,7 +53,7 @@ require_once(PATH."inc/extensions.php");
 require_once(PATH."inc/language.php");
 
 // Check if the user setups his MySQL stuff...
-if ((empty($MySQL['login'])) && (!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) {
+if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) {
        // No login entered and outside installation mode
        echo "<STRONG>".LANG_WARNING.":</STRONG> ";
        if (isBooleanConstantAndTrue('mxchange_installed')) {
@@ -63,13 +63,13 @@ if ((empty($MySQL['login'])) && (!isBooleanConstantAndTrue('mxchange_installing'
                // Please run the installation script (maybe again)
                die(DIE_RUN_INSTALL_MYSQL);
        }
-} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
+} elseif ((!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
        // No database password entered!!!
        echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
 }
 
 // Check if this file is writeable or read-only and warn the user
-if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
+if ((!defined('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
        // Check for write-permission for config.php and inc directory
        if (empty($GLOBALS['module'])) $GLOBALS['module'] = "index";
        if (($GLOBALS['module'] != "admin") && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_SERVER['WINDIR']))) {
@@ -207,7 +207,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        }
 
        // Double-check installation mode
-       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+       if ((!defined('mxchange_installed')) || (!defined('admin_registered'))) {
                // Check for file permissions
                if (!is_INCWritable("config")) {
                        ADD_FATAL(CONFIG_IS_WRITE_PROTECTED);
@@ -223,7 +223,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
 
 // Any fatal messages?
 if (!is_array($FATAL)) $FATAL = array();
-if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!isBooleanConstantAndTrue('mxchange_installing')) && ($CSS != "1"))
+if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1"))
 {
        // One or more fatal error(s) occur during connect...
        include (PATH."inc/header.php");
index 9340706592b501c5512f565c6652d3e8a8195f70..003589d527ec4ce6d1ead84f961a2a90dfdb5fcf 100644 (file)
@@ -101,7 +101,7 @@ function CHECK_MODULE($mod) {
        $ret = "major";
 
        // Check if script is installed if not return a "done" to prevent some errors
-       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
+       if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!defined('admin_registered'))) return "done";
 
        // Check if cache is latest version
        $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
@@ -1523,7 +1523,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__);
        }
 
        // Now a mail to the user and that's all...
-       $msg = LOAD_EMAIL_TEMPLATE("del-user", $reason, $uid);
+       $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid);
        SEND_EMAIL($uid, ADMIN_DEL_ACCOUNT, $msg);
 
        // Ok, delete the account!
index d4bf446968993cab5b4370f18a9f220fa6a1aaa3..ddad449cc0dcdcd4449a512738603e9e657eb763 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
 
 // Reset accounts
 $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET beg_points=0.00000 WHERE beg_points > 0",
index f4e42eb44028a977c65d76b75cc63c25a1b2b2b8..d0a57bf66bd104e9f5093b8a67027bdd0ee5c250 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Reset accounts
 $result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0",
index f385dd0e20bec0392fcf0094ceffdd412326b898..9688395dace4620298c600817497dfebf4516aab 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
 
 //
 ?>
index 3a2256fa24dc4590e3dfedb5a42775bbc7ab7216..5d599857b33774073d1bc37a7421b96f5a780416 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || ((!isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return;
+if (($CSS == 1) || ((!defined('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return;
 
 // Check for holidays we need to enable and send email to user
 $result_main = SQL_QUERY("SELECT userid, holiday_activated FROM "._MYSQL_PREFIX."_user_data
index 10341b96e8652fcb0e7832a3922b69beca7866dd..edebd693fc049fa65e7de754849e9a217f4c9475 100644 (file)
@@ -43,7 +43,7 @@ $STYLES = array(
 );
 
 // Add stylesheet for installation
-if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
+if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!defined('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
 
 // When no CSS output-mode is set, set it to file-output
 if (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE";
index ab5cb1dbe6f081069a16299148f16381061e5286..b568553745125e188a0e6f76d11ecc4ba15873eb 100644 (file)
@@ -63,7 +63,7 @@ function GET_CURR_THEME() {
                        // Fix it to default
                        $ret = "default";
                } // END - if
-       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
+       } elseif ((!defined('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
                // Prepare FQFN for checking
                $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));