Fix a warning.
[squirrelmail.git] / include / options / personal.php
index fb532f92affee07584c9fb51bf9d961ed2a45b13..a15d5ba55d83eb5a23b4d742453f3d50905f9139 100644 (file)
@@ -9,9 +9,10 @@
  * Displays all options relating to personal information
  *
  * $Id$
+ * @package squirrelmail
  */
 
-/* SquirrelMail required files. */
+/** SquirrelMail required files. */
 require_once(SM_PATH . 'functions/imap.php');
 
 /* Define the group constants for the personal options page. */
@@ -121,11 +122,13 @@ function load_optpage_data_personal() {
     if ( $tzChangeAllowed ) {
         $TZ_ARRAY[SMPREF_NONE] = _("Same as server");
         $tzfile = SM_PATH . 'locale/timezones.cfg';
-        if(!$fd = fopen($tzfile ,'r')) {
-            $message = _("Error opening timezone config, contact administrator.");
-            plain_error_message($message, $color);
-            exit;
-        }
+               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 ) {