From ee20a285cdd34be33e795db635c4d76846abf82d Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 10 Jul 2005 12:54:18 +0000 Subject: [PATCH] time zone configuration options. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9749 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 +- config/conf.pl | 33 ++++++++++- doc/i18n.txt | 98 ++++++++++++++++++++++++++++--- plugins/administrator/defines.php | 8 +++ 4 files changed, 129 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75a06e2f..d30f3f48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -397,7 +397,7 @@ Version 1.5.1 -- CVS - Fix for bad cache on massive expunge/delete/move operations. - Moved time zone configuration from locale/timezones.cfg to php array. Adds time zone name localization options and fixes problems on systems - that don't support GNU C time zone mappings. + that don't support GNU C time zone mappings (#1177067). Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/config/conf.pl b/config/conf.pl index 53de21fe..aecec45a 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -357,6 +357,7 @@ $abook_global_file_writeable = 'false' if ( !$abook_global_file_writeable); $abook_global_file_listing = 'true' if ( !$abook_global_file_listing ); $encode_header_key = '' if ( !$encode_header_key ); $hide_auth_header = 'false' if ( !$hide_auth_header ); +$time_zone_type = '0' if ( !$time_zone_type ); if ( $ARGV[0] eq '--install-plugin' ) { print "Activating plugin " . $ARGV[1] . "\n"; @@ -528,6 +529,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) { print "12. Allow server charset search : $WHT$allow_charset_search$NRM\n"; print "13. Allow advanced search : $WHT$allow_advanced_search$NRM\n"; print "14. PHP session name : $WHT$session_name$NRM\n"; + print "15. Time zone configuration : $WHT$time_zone_type$NRM\n"; print "\n"; print "R Return to Main Menu\n"; } elsif ( $menu == 5 ) { @@ -549,7 +551,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) { print " > $ldap_host[$count]\n"; } print "2. Use Javascript address book search : $WHT$default_use_javascript_addr_book$NRM\n"; - print "3. Use global file address book : $WHT$abook_global_file$NRM\n"; + print "3. Global address book file : $WHT$abook_global_file$NRM\n"; print "4. Allow writing into global file address book : $WHT$abook_global_file_writeable$NRM\n"; print "5. Allow listing of global file address book : $WHT$abook_global_file_listing$NRM\n"; print "\n"; @@ -752,12 +754,13 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) { elsif ( $command == 6 ) { $default_use_priority = command37(); } elsif ( $command == 7 ) { $hide_sm_attributions = command38(); } elsif ( $command == 8 ) { $default_use_mdn = command39(); } - elsif ( $command == 9 ) { $edit_identity = command310(); } + elsif ( $command == 9 ) { $edit_identity = command310(); } elsif ( $command == 10 ) { $allow_thread_sort = command312(); } elsif ( $command == 11 ) { $allow_server_sort = command313(); } elsif ( $command == 12 ) { $allow_charset_search = command314(); } elsif ( $command == 13 ) { $allow_advanced_search = command316(); } elsif ( $command == 14 ) { $session_name = command317(); } + elsif ( $command == 15 ) { $time_zone_type = command318(); } } elsif ( $menu == 5 ) { if ( $command == 1 ) { command41(); } elsif ( $command == 2 ) { $theme_css = command42(); } @@ -2278,6 +2281,29 @@ sub command317 { return $new_session_name; } +# time zone config (since 1.5.1) +sub command318 { + print "This option allows you to control the use of time zones.\n"; + print " 0 = (default) standard, GNU C time zone names\n"; + print " 1 = strict, generic time zone codes with offsets\n"; + print " 2 = custom, GNU C time zones loaded from config/timezones.php\n"; + print " 3 = custom strict, generic time zone codes with offsets loaded \n"; + print " from config/timezones.php\n"; + print "See SquirrelMail documentation about format of config/timezones.php file.\n"; + print "\n"; + + print "Used time zone configuration (0,1,2,3)? [$WHT$time_zone_type$NRM]: $WHT"; + $new_time_zone_type = ; + if ( $new_time_zone_type =~ /^[0123]\n/i ) { + $time_zone_type = $new_time_zone_type; + } else { + print "\nInvalid configuration value.\n"; + print "\nPress enter to continue..."; + $tmp = ; + } + $time_zone_type =~ s/[\r\n]//g; + return $time_zone_type; +} sub command41 { @@ -3471,6 +3497,9 @@ sub save_data { # integer print CF "\$allow_advanced_search = $allow_advanced_search;\n"; print CF "\n"; + # integer + print CF "\$time_zone_type = $time_zone_type;\n"; + print CF "\n"; # all plugins are strings for ( $ct = 0 ; $ct <= $#plugins ; $ct++ ) { diff --git a/doc/i18n.txt b/doc/i18n.txt index e19721b8..3b06738e 100644 --- a/doc/i18n.txt +++ b/doc/i18n.txt @@ -254,15 +254,95 @@ If TZ variable can't be modified (php is running is safe mode and variable is not listed in php safe_mode_allowed_env_vars), user's time zone options are not visible and interface uses default webserver's time zone. -List of available time zones is stored in locale/timezones.cfg. Current list -of time zones uses some time zone names that depend on webserver's system -libraries. These names are not compatible with Windows operating system. - -TODO: move time zone information to php array in order to be able to translate -it and make sure that time zone names are compatible with Windows operating -system. Or at least provide 'default' and 'strict' time zone options in -SquirrelMail configuration. Maybe even provide 'custom' time zone list -options. +SquirrelMail 1.5.0 and older store list of available time zones in +locale/timezones.cfg. Since 1.5.1 standard times zones are moved to +include/timezones/standard.php and time zone handling differs from older +SquirrelMail versions. Time zone configuration is controlled in SquirrelMail +configuration utility (conf.pl), 4. General Options -> 15. Time zone +configuration menu option. Administrator can select standard, strict, custom +and custom strict time zone handling. + +Standard handling does not differ from previous SquirrelMail versions and +SquirrelMail uses GNU C geographical location based time zone names. Strict +handling uses time zone codes with offset from GMT. Strict time zones should +work on systems that don't support GNU C time zone naming. Custom and custom +strict handling uses config/timezones.php file instead of +include/timezones/standard.php. + +config/timezones.php file should store $aTimeZones array with different set of +time zones. See default time zone set in include/timezones/standard.php.For +example: + + + +GNU C time zone naming should be supported by many Unix OSes. It is recommended +way of setting time zone, because it handles historical changes and daylight +savings specific to selected geographical location. Strict time zones might +provide inaccurate or outdated time zone settings. If modifications in TZ environment are visible in your webserver's logs (time offset is changed), make sure that you can reproduce such behavior in latest php diff --git a/plugins/administrator/defines.php b/plugins/administrator/defines.php index 507b23ac..fbff0033 100644 --- a/plugins/administrator/defines.php +++ b/plugins/administrator/defines.php @@ -106,6 +106,7 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"), 'courier' => _("Courier IMAP server"), 'macosx' => _("Mac OS X Mailserver"), 'hmailserver' => _("hMailServer IMAP server"), + 'mercury32' => _("Mercury/32 IMAP server"), 'other' => _("Not one of the above servers") ) ), '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"), 'type' => SMOPT_TYPE_STRING, @@ -251,6 +252,13 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"), 'default' => 0 ), '$session_name' => array( 'name' => _("PHP session name"), 'type' => SMOPT_TYPE_HIDDEN ), + '$time_zone_type' => array( 'name' => _("Time Zone Configuration"), + 'type' => SMOPT_TYPE_NUMLIST, + 'posvals' => array( 0 => _("Standard GNU C time zones"), + 1 => _("Strict time zones"), + 2 => _("Custom GNU C time zones"), + 3 => _("Custom strict time zones")), + 'default' => 0 ), /* --------------------------------------------------------*/ 'Group5' => array( 'name' => _("Message of the Day"), 'type' => SMOPT_TYPE_TITLE ), -- 2.25.1