Fix a warning.
[squirrelmail.git] / include / options / personal.php
index 84a0fda6b6ebc846df41574d1cab20dac8585b46..a15d5ba55d83eb5a23b4d742453f3d50905f9139 100644 (file)
@@ -3,17 +3,17 @@
 /**
  * options_personal.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Displays all options relating to personal information
  *
  * $Id$
+ * @package squirrelmail
  */
 
-/* SquirrelMail required files. */
+/** SquirrelMail required files. */
 require_once(SM_PATH . 'functions/imap.php');
-require_once(SM_PATH . 'functions/array.php');
 
 /* Define the group constants for the personal options page. */
 define('SMOPT_GRP_CONTACT', 0);
@@ -24,7 +24,8 @@ define('SMOPT_GRP_TZ', 3);
 /* Define the optpage load function for the personal options page. */
 function load_optpage_data_personal() {
     global $data_dir, $username, $edit_identity, $edit_name,
-           $full_name, $reply_to, $email_address, $signature;
+           $full_name, $reply_to, $email_address, $signature, $tzChangeAllowed,
+           $color;
 
     /* Set the values of some global variables. */
     $full_name = getPref($data_dir, $username, 'full_name');
@@ -118,14 +119,21 @@ function load_optpage_data_personal() {
         );
     }
     
-    if (  !ini_get("safe_mode") ) {
+    if ( $tzChangeAllowed ) {
         $TZ_ARRAY[SMPREF_NONE] = _("Same as server");
-        $fd = fopen('../locale/timezones.cfg','r');
+        $tzfile = SM_PATH . 'locale/timezones.cfg';
+               if ((!is_readable($tzfile)) or (!$fd = fopen($tzfile,'r'))) {
+               $message = _("Error opening timezone config, contact administrator.");
+               }
+               if (isset($message)) {
+                   plain_error_message($message, $color);
+                   exit;
+       }
         while (!feof ($fd)) {
             $zone = fgets($fd, 1024);
             if( $zone ) {
                 $zone = trim($zone);
-                $TZ_ARRAY["$zone"] = "$zone";
+                $TZ_ARRAY[$zone] = $zone;
             }
         }
         fclose ($fd);