Переглянути джерело

Make configuration tool show the SquirrelMail version

pdontthink 11 роки тому
батько
коміт
d7ab89a759
2 змінених файлів з 19 додано та 2 видалено
  1. 18 2
      config/conf.pl
  2. 1 0
      doc/ChangeLog

+ 18 - 2
config/conf.pl

@@ -43,7 +43,23 @@ $dir = cwd();
 
 
 ############################################################
-# First, lets read in the data already in there...
+# Try to determine what the version of SquirrelMail is
+############################################################
+$sm_version = 'unknown';
+if ( -e "../include/constants.php" && -r "../include/constants.php") {
+    open( FILE, "../include/constants.php" );
+    while ( $line = <FILE> ) {
+        if ($line =~ m/^define\('SM_VERSION', ?'(\d+\.\d+\.\d+( ?\[\w+]|))'/) {
+            $sm_version = $1;
+            last;
+        }
+    }
+    close(FILE);
+}
+
+
+############################################################
+# First, let's read in the data already in there...
 ############################################################
 if ( -e "config.php" ) {
     # Make sure that file is readable
@@ -583,7 +599,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
     print $WHT. "SquirrelMail Configuration : " . $NRM;
     if    ( $config == 1 ) { print "Read: config.php"; }
     elsif ( $config == 2 ) { print "Read: config_default.php"; }
-    print " ($print_config_version)\n";
+    print "\nConfig version $print_config_version; SquirrelMail version $sm_version\n";
     print "---------------------------------------------------------\n";
 
     if ( $menu == 0 ) {

+ 1 - 0
doc/ChangeLog

@@ -392,6 +392,7 @@ Version 1.5.2 - SVN
     Williams).  See $display_imap_login_error in the configuration
     file or "4.  General Options ==> 21. Display login error from IMAP" 
     in the configuration tool.
+  - Configuration tool now shows the SquirrelMail version
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------