From 2c34672a65cebca402a4ef61bedbd9447fd38d24 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 4 Jun 2006 09:57:20 +0000 Subject: [PATCH] sq_mt_randomize() is not available in style.php git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11180 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- themes/greenhouse_effect.php | 9 +++++++++ themes/in_the_pink.php | 9 +++++++++ themes/kind_of_blue.php | 9 +++++++++ themes/monostochastic.php | 9 +++++++++ themes/random.php | 12 ++++++++++-- themes/shades_of_grey.php | 9 +++++++++ themes/spice_of_life.php | 9 +++++++++ themes/spice_of_life_dark.php | 9 +++++++++ themes/spice_of_life_lite.php | 9 +++++++++ 9 files changed, 82 insertions(+), 2 deletions(-) diff --git a/themes/greenhouse_effect.php b/themes/greenhouse_effect.php index fb225942..31034796 100755 --- a/themes/greenhouse_effect.php +++ b/themes/greenhouse_effect.php @@ -14,6 +14,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator **/ sq_mt_randomize(); diff --git a/themes/in_the_pink.php b/themes/in_the_pink.php index 88cbadab..3a9fd6cc 100755 --- a/themes/in_the_pink.php +++ b/themes/in_the_pink.php @@ -15,6 +15,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /* seed the random number generator */ sq_mt_randomize(); diff --git a/themes/kind_of_blue.php b/themes/kind_of_blue.php index a0958297..dd3cd11d 100755 --- a/themes/kind_of_blue.php +++ b/themes/kind_of_blue.php @@ -15,6 +15,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator */ sq_mt_randomize(); diff --git a/themes/monostochastic.php b/themes/monostochastic.php index 6c048c9a..82d58b54 100755 --- a/themes/monostochastic.php +++ b/themes/monostochastic.php @@ -15,6 +15,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator */ sq_mt_randomize(); diff --git a/themes/random.php b/themes/random.php index 60884fa9..c93d8d8c 100755 --- a/themes/random.php +++ b/themes/random.php @@ -13,11 +13,19 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load required functions */ +include_once(SM_PATH . 'functions/global.php'); +include_once(SM_PATH . 'functions/strings.php'); + /** Initialize the random number generator */ sq_mt_randomize(); -require_once(SM_PATH . 'functions/global.php'); - global $theme; if (!sqsession_is_registered('random_theme_good_theme')) { diff --git a/themes/shades_of_grey.php b/themes/shades_of_grey.php index d92663bf..b86f6216 100755 --- a/themes/shades_of_grey.php +++ b/themes/shades_of_grey.php @@ -14,6 +14,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator */ sq_mt_randomize(); diff --git a/themes/spice_of_life.php b/themes/spice_of_life.php index e19b235c..57d3d884 100755 --- a/themes/spice_of_life.php +++ b/themes/spice_of_life.php @@ -14,6 +14,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator **/ sq_mt_randomize(); diff --git a/themes/spice_of_life_dark.php b/themes/spice_of_life_dark.php index b9718cf9..eb17f92e 100755 --- a/themes/spice_of_life_dark.php +++ b/themes/spice_of_life_dark.php @@ -14,6 +14,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator **/ sq_mt_randomize(); diff --git a/themes/spice_of_life_lite.php b/themes/spice_of_life_lite.php index a9734cd0..84aaa4f6 100755 --- a/themes/spice_of_life_lite.php +++ b/themes/spice_of_life_lite.php @@ -14,6 +14,15 @@ * @subpackage themes */ +/** Prevent direct script loading */ +if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) || + (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) { + die(); +} + +/** load sq_mt_randomize() */ +include_once(SM_PATH . 'functions/strings.php'); + /** seed the random number generator **/ sq_mt_randomize(); -- 2.25.1