From b37e457fda0baaf0253ba69f0e5cbdd4845ce242 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Thu, 22 Mar 2007 20:01:33 +0000 Subject: [PATCH] Remove $version, use SM_VERSION constant instead git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12346 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/deliver/Deliver.class.php | 4 ++-- config/conf.pl | 1 - config/config_default.php | 1 - include/constants.php | 6 ++++++ include/init.php | 8 ++------ plugins/administrator/defines.php | 4 ++-- plugins/administrator/options.php | 3 +-- src/about.php | 4 ++-- src/configtest.php | 5 ++++- src/read_body.php | 4 ++-- 10 files changed, 21 insertions(+), 19 deletions(-) diff --git a/class/deliver/Deliver.class.php b/class/deliver/Deliver.class.php index 31a674b3..0907faaf 100644 --- a/class/deliver/Deliver.class.php +++ b/class/deliver/Deliver.class.php @@ -378,7 +378,7 @@ class Deliver { * @return string $header */ function prepareRFC822_Header($rfc822_header, $reply_rfc822_header, &$raw_length) { - global $domain, $version, $username, $encode_header_key, + global $domain, $username, $encode_header_key, $edit_identity, $hide_auth_header; /* if server var SERVER_NAME not available, use $domain */ @@ -497,7 +497,7 @@ class Deliver { } } /* Identify SquirrelMail */ - $header[] = 'User-Agent: SquirrelMail/' . $version . $rn; + $header[] = 'User-Agent: SquirrelMail/' . SM_VERSION . $rn; /* Do the MIME-stuff */ $header[] = 'MIME-Version: 1.0' . $rn; $contenttype = 'Content-Type: '. $rfc822_header->content_type->type0 .'/'. diff --git a/config/conf.pl b/config/conf.pl index e3044ea1..f936c3f5 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -4315,7 +4315,6 @@ sub save_data { print CF " * Created using the configure script, conf.pl\n"; print CF " */\n"; print CF "\n"; - print CF "global \$version;\n"; if ($print_config_version) { print CF "\$config_version = '$print_config_version';\n"; diff --git a/config/config_default.php b/config/config_default.php index a4dd81ca..04817a0b 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -23,7 +23,6 @@ */ /* Do not change this value. */ -global $version; global $config_version; $config_version = '1.5.0'; diff --git a/include/constants.php b/include/constants.php index 419d6a42..5fc115c0 100644 --- a/include/constants.php +++ b/include/constants.php @@ -15,6 +15,12 @@ /** @ignore */ +/** + * SquirrelMail version number -- DO NOT CHANGE + * @since 1.5.2 + */ +define('SM_VERSION', '1.5.2 [SVN]'); + /**************************************************************/ /* Set values for constants used by SquirrelMail preferences. */ /**************************************************************/ diff --git a/include/init.php b/include/init.php index a6eb383b..53cebad2 100644 --- a/include/init.php +++ b/include/init.php @@ -223,16 +223,12 @@ ini_set('session.name' , $session_name); session_set_cookie_params (0, $base_uri); sqsession_is_active(); -/** - * SquirrelMail version number -- DO NOT CHANGE - */ -$version = '1.5.2 [SVN]'; - /** * SquirrelMail internal version number -- DO NOT CHANGE * $sm_internal_version = array (release, major, minor) */ -$SQM_INTERNAL_VERSION = array(1,5,2); +$SQM_INTERNAL_VERSION = preg_split('/\./', SM_VERSION, 3); +$SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]); /* if plugins are disabled only for one user and diff --git a/plugins/administrator/defines.php b/plugins/administrator/defines.php index fdc9642d..527108a6 100644 --- a/plugins/administrator/defines.php +++ b/plugins/administrator/defines.php @@ -44,7 +44,7 @@ function adm_template_options() { return $ret; } -global $languages, $version; +global $languages; $language_values = array( ); foreach ($languages as $lang_key => $lang_attributes) { @@ -64,7 +64,7 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"), 'size' => 7 ), 'SM_ver' => array( 'name' => _("SquirrelMail Version"), 'type' => SMOPT_TYPE_EXTERNAL, - 'value' => "$version" ), + 'value' => SM_VERSION ), 'PHP_ver' => array( 'name' => _("PHP Version"), 'type' => SMOPT_TYPE_EXTERNAL, 'value' => phpversion() ), diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index 57e631b5..1fcf1fc5 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -622,8 +622,7 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) { " * SquirrelMail Configuration File\n". " * Created using the Administrator Plugin\n". " */\n". - "\n". - "global \$version;\n" ); + "\n" ); foreach ( $newcfg as $k => $v ) { if ( $k{0} == '$' && $v <> '' || is_int($v)) { diff --git a/src/about.php b/src/about.php index 108a6ff0..f54c1cd6 100644 --- a/src/about.php +++ b/src/about.php @@ -29,7 +29,7 @@ displayPageHeader($color); alt="SquirrelMail Logo" />
- +

@@ -64,7 +64,7 @@ echo sprintf(_("For more information about SquirrelMail and the SquirrelMail Pro

\n"; echo _("The administrator installed the following plugins:"); echo "
\n"; diff --git a/src/configtest.php b/src/configtest.php index 33096746..5ed8083a 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -81,8 +81,11 @@ ob_implicit_flush(); /** @ignore */ define('SM_PATH', '../'); /** load minimal function set */ +require(SM_PATH . 'include/constants.php'); require(SM_PATH . 'functions/global.php'); require(SM_PATH . 'functions/strings.php'); +$SQM_INTERNAL_VERSION = preg_split('/\./', SM_VERSION, 3); +$SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]); /** set default value in order to block remote access */ $allow_remote_configtest=false; @@ -169,7 +172,7 @@ if (! $allow_remote_configtest) { } /* checking PHP specs */ -echo "

\n\n" . +echo "

SquirrelMail version:" . $version . "
\n\n" . '\n" . '
SquirrelMail version:" . SM_VERSION . "
Config file version:' . $config_version . "
Config file last modified:' . date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')) . diff --git a/src/read_body.php b/src/read_body.php index 7ad607ec..6b588bd6 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -126,7 +126,7 @@ function ServerMDNSupport($aFlags) { function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) { global $username, $attachment_dir, $popuser, $username, $color, - $version, $squirrelmail_language, $default_charset, + $squirrelmail_language, $default_charset, $languages, $useSendmail, $domain, $sent_folder; sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER); @@ -223,7 +223,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) { $original_recipient = $to; $original_message_id = $header->message_id; - $report = "Reporting-UA : $SERVER_NAME ; SquirrelMail (version $version) \r\n"; + $report = "Reporting-UA : $SERVER_NAME ; SquirrelMail (version " . SM_VERSION . ") \r\n"; if ($original_recipient != '') { $report .= "Original-Recipient : $original_recipient\r\n"; } -- 2.25.1