From: Roland Häder Date: Sun, 21 Sep 2008 14:24:49 +0000 (+0000) Subject: Some fixes for isBooleanConstantAndTrue() X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=e6e3183f794b385f5acc38b371c220cc35cdac38 Some fixes for isBooleanConstantAndTrue() --- diff --git a/inc/check-reset.php b/inc/check-reset.php index ebda4415d7..1b348a97c7 100644 --- a/inc/check-reset.php +++ b/inc/check-reset.php @@ -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); diff --git a/inc/databases.php b/inc/databases.php index e266053c35..1bbe2a3293 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/extensions.php b/inc/extensions.php index 3973f4132a..84506151e1 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -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}
\n"; // Is the cache written? diff --git a/inc/functions.php b/inc/functions.php index 5abc31bab2..318af2c226 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -321,7 +321,7 @@ function LOAD_TEMPLATE($template, $return=false, $content="") { // Add surrounding HTML comments to help finding bugs faster $ret = "\n".$ret."\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 = "
".TEMPLATE_404."
(".basename($file).")
@@ -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 diff --git a/inc/header.php b/inc/header.php index 8f2d54deae..1031590a81 100644 --- a/inc/header.php +++ b/inc/header.php @@ -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, diff --git a/inc/install-inc.php b/inc/install-inc.php index 55eb350f4f..80f4686904 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -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." @@ -289,7 +289,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\""); OUTPUT_HTML(">".YES." @@ -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(); diff --git a/inc/load_extensions.php b/inc/load_extensions.php index 21fdf5ee5a..3fea0700f1 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -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")) { diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 367a96cbe9..7578e6c7d5 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -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); diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index be310f4d04..35e62117a9 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -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()); diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index 0c5f9dd64a..42cfdeb3e4 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -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()); diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 46b2bdb182..2cfaaa0263 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -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()); diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 85323f6bad..600eae1053 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -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 "".LANG_WARNING.": "; 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 "".LANG_WARNING.": ".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"); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 9340706592..003589d527 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -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! diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index d4bf446968..ddad449cc0 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -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", diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php index f4e42eb440..d0a57bf66b 100644 --- a/inc/reset/reset_bonus.php +++ b/inc/reset/reset_bonus.php @@ -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", diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php index f385dd0e20..9688395dac 100644 --- a/inc/reset/reset_engine.php +++ b/inc/reset/reset_engine.php @@ -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; // ?> diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index 3a2256fa24..5d599857b3 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -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 diff --git a/inc/stylesheet.php b/inc/stylesheet.php index 10341b96e8..edebd693fc 100644 --- a/inc/stylesheet.php +++ b/inc/stylesheet.php @@ -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"; diff --git a/inc/theme-manager.php b/inc/theme-manager.php index ab5cb1dbe6..b568553745 100644 --- a/inc/theme-manager.php +++ b/inc/theme-manager.php @@ -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']));