Browse Source

Remove $version, use SM_VERSION constant instead

pdontthink 18 years ago
parent
commit
ee0444272e

+ 2 - 2
class/deliver/Deliver.class.php

@@ -378,7 +378,7 @@ class Deliver {
      * @return string $header
      * @return string $header
      */
      */
     function prepareRFC822_Header($rfc822_header, $reply_rfc822_header, &$raw_length) {
     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;
                $edit_identity, $hide_auth_header;
 
 
         /* if server var SERVER_NAME not available, use $domain */
         /* if server var SERVER_NAME not available, use $domain */
@@ -497,7 +497,7 @@ class Deliver {
             }
             }
         }
         }
         /* Identify SquirrelMail */
         /* Identify SquirrelMail */
-        $header[] = 'User-Agent: SquirrelMail/' . $version . $rn;
+        $header[] = 'User-Agent: SquirrelMail/' . SM_VERSION . $rn;
         /* Do the MIME-stuff */
         /* Do the MIME-stuff */
         $header[] = 'MIME-Version: 1.0' . $rn;
         $header[] = 'MIME-Version: 1.0' . $rn;
         $contenttype = 'Content-Type: '. $rfc822_header->content_type->type0 .'/'.
         $contenttype = 'Content-Type: '. $rfc822_header->content_type->type0 .'/'.

+ 0 - 1
config/conf.pl

@@ -4315,7 +4315,6 @@ sub save_data {
         print CF " * Created using the configure script, conf.pl\n";
         print CF " * Created using the configure script, conf.pl\n";
         print CF " */\n";
         print CF " */\n";
         print CF "\n";
         print CF "\n";
-        print CF "global \$version;\n";
 
 
         if ($print_config_version) {
         if ($print_config_version) {
             print CF "\$config_version = '$print_config_version';\n";
             print CF "\$config_version = '$print_config_version';\n";

+ 0 - 1
config/config_default.php

@@ -23,7 +23,6 @@
  */
  */
 
 
 /* Do not change this value. */
 /* Do not change this value. */
-global $version;
 global $config_version;
 global $config_version;
 $config_version = '1.5.0';
 $config_version = '1.5.0';
 
 

+ 6 - 0
include/constants.php

@@ -15,6 +15,12 @@
 
 
 /** @ignore */
 /** @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. */
 /* Set values for constants used by SquirrelMail preferences. */
 /**************************************************************/
 /**************************************************************/

+ 2 - 6
include/init.php

@@ -223,16 +223,12 @@ ini_set('session.name' , $session_name);
 session_set_cookie_params (0, $base_uri);
 session_set_cookie_params (0, $base_uri);
 sqsession_is_active();
 sqsession_is_active();
 
 
-/**
- * SquirrelMail version number -- DO NOT CHANGE
- */
-$version = '1.5.2 [SVN]';
-
 /**
 /**
  * SquirrelMail internal version number -- DO NOT CHANGE
  * SquirrelMail internal version number -- DO NOT CHANGE
  * $sm_internal_version = array (release, major, minor)
  * $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
 /* if plugins are disabled only for one user and

+ 2 - 2
plugins/administrator/defines.php

@@ -44,7 +44,7 @@ function adm_template_options() {
     return $ret;
     return $ret;
 }
 }
 
 
-global $languages, $version;
+global $languages;
 
 
 $language_values = array( );
 $language_values = array( );
 foreach ($languages as $lang_key => $lang_attributes) {
 foreach ($languages as $lang_key => $lang_attributes) {
@@ -64,7 +64,7 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                              'size' => 7 ),
                                              'size' => 7 ),
                  'SM_ver' => array( 'name' => _("SquirrelMail Version"),
                  'SM_ver' => array( 'name' => _("SquirrelMail Version"),
                                     'type' => SMOPT_TYPE_EXTERNAL,
                                     'type' => SMOPT_TYPE_EXTERNAL,
-                                    'value' => "$version" ),
+                                    'value' => SM_VERSION ),
                  'PHP_ver' => array( 'name' => _("PHP Version"),
                  'PHP_ver' => array( 'name' => _("PHP Version"),
                                      'type' => SMOPT_TYPE_EXTERNAL,
                                      'type' => SMOPT_TYPE_EXTERNAL,
                                      'value' => phpversion() ),
                                      'value' => phpversion() ),

+ 1 - 2
plugins/administrator/options.php

@@ -622,8 +622,7 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) {
     " * SquirrelMail Configuration File\n".
     " * SquirrelMail Configuration File\n".
     " * Created using the Administrator Plugin\n".
     " * Created using the Administrator Plugin\n".
     " */\n".
     " */\n".
-    "\n".
-    "global \$version;\n" );
+    "\n" );
 
 
     foreach ( $newcfg as $k => $v ) {
     foreach ( $newcfg as $k => $v ) {
         if ( $k{0} == '$' && $v <> '' || is_int($v)) {
         if ( $k{0} == '$' && $v <> '' || is_int($v)) {

+ 2 - 2
src/about.php

@@ -29,7 +29,7 @@ displayPageHeader($color);
     alt="SquirrelMail Logo" /><br />
     alt="SquirrelMail Logo" /><br />
 <table align="center" width="80%" cellpadding="1" cellspacing="2" border="0">
 <table align="center" width="80%" cellpadding="1" cellspacing="2" border="0">
 <tr><td bgcolor="#dcdcdc" align="center"><div style="text-align: center;"><b>
 <tr><td bgcolor="#dcdcdc" align="center"><div style="text-align: center;"><b>
-<?php echo sprintf(_("About SquirrelMail %s"),$version); ?>
+<?php echo sprintf(_("About SquirrelMail %s"), SM_VERSION); ?>
 </b></div></td></tr>
 </b></div></td></tr>
 <tr><td>
 <tr><td>
 <br />
 <br />
@@ -64,7 +64,7 @@ echo sprintf(_("For more information about SquirrelMail and the SquirrelMail Pro
 </b><br/><br/>
 </b><br/><br/>
 <small>
 <small>
 <?php
 <?php
-echo sprintf(_("You are using SquirrelMail version: %s"),$version);
+echo sprintf(_("You are using SquirrelMail version: %s"), SM_VERSION);
 echo "<br />\n";
 echo "<br />\n";
 echo _("The administrator installed the following plugins:");
 echo _("The administrator installed the following plugins:");
 echo "<br />\n";
 echo "<br />\n";

+ 4 - 1
src/configtest.php

@@ -81,8 +81,11 @@ ob_implicit_flush();
 /** @ignore */
 /** @ignore */
 define('SM_PATH', '../');
 define('SM_PATH', '../');
 /** load minimal function set */
 /** load minimal function set */
+require(SM_PATH . 'include/constants.php');
 require(SM_PATH . 'functions/global.php');
 require(SM_PATH . 'functions/global.php');
 require(SM_PATH . 'functions/strings.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 */
 /** set default value in order to block remote access */
 $allow_remote_configtest=false;
 $allow_remote_configtest=false;
@@ -169,7 +172,7 @@ if (! $allow_remote_configtest) {
 }
 }
 /* checking PHP specs */
 /* checking PHP specs */
 
 
-echo "<p><table>\n<tr><td>SquirrelMail version:</td><td><b>" . $version . "</b></td></tr>\n" .
+echo "<p><table>\n<tr><td>SquirrelMail version:</td><td><b>" . SM_VERSION . "</b></td></tr>\n" .
     '<tr><td>Config file version:</td><td><b>' . $config_version . "</b></td></tr>\n" .
     '<tr><td>Config file version:</td><td><b>' . $config_version . "</b></td></tr>\n" .
     '<tr><td>Config file last modified:</td><td><b>' .
     '<tr><td>Config file last modified:</td><td><b>' .
     date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')) .
     date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')) .

+ 2 - 2
src/read_body.php

@@ -126,7 +126,7 @@ function ServerMDNSupport($aFlags) {
 
 
 function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
 function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
     global $username, $attachment_dir, $popuser, $username, $color,
     global $username, $attachment_dir, $popuser, $username, $color,
-           $version, $squirrelmail_language, $default_charset,
+           $squirrelmail_language, $default_charset,
            $languages, $useSendmail, $domain, $sent_folder;
            $languages, $useSendmail, $domain, $sent_folder;
 
 
     sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
     sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
@@ -223,7 +223,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
     $original_recipient  = $to;
     $original_recipient  = $to;
     $original_message_id = $header->message_id;
     $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 != '') {
     if ($original_recipient != '') {
         $report .= "Original-Recipient : $original_recipient\r\n";
         $report .= "Original-Recipient : $original_recipient\r\n";
     }
     }