squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

validate.php
Go to the documentation of this file.
1 <?php
2 
16 if ( !defined('PAGE_NAME') ) define('PAGE_NAME', NULL);
17 
18 
37 session_write_close();
38 
43 global $theme;
44 unset($theme);
45 $theme=array();
46 
47 /* SquirrelMail required files. */
48 require_once(SM_PATH . 'class/mime.class.php');
49 require_once(SM_PATH . 'functions/global.php');
50 require_once(SM_PATH . 'functions/i18n.php');
51 require_once(SM_PATH . 'functions/auth.php');
52 
53 is_logged_in();
54 
55 require_once(SM_PATH . 'include/load_prefs.php');
56 require_once(SM_PATH . 'functions/page_header.php');
57 require_once(SM_PATH . 'functions/prefs.php');
58 
59 /* Set up the language (i18n.php was included by auth.php). */
60 global $username, $data_dir;
62 
64 
65 /* Check to see if we are allowed to set the TZ environment variable.
66  * We are able to do this if ...
67  * safe_mode is disabled OR
68  * safe_mode_allowed_env_vars is empty (you are allowed to set any) OR
69  * safe_mode_allowed_env_vars contains TZ
70  */
71 $tzChangeAllowed = (!ini_get('safe_mode')) ||
72  !strcmp(ini_get('safe_mode_allowed_env_vars'),'') ||
73  preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars'));
74 
75 if ( $timeZone != SMPREF_NONE && ($timeZone != "")
76  && $tzChangeAllowed ) {
77  putenv("TZ=".$timeZone);
78 }
79 
84 if (function_exists('date_default_timezone_set')) {
85  if ($timeZone != SMPREF_NONE && $timeZone != "") {
86  date_default_timezone_set($timeZone);
87  } else {
88  // interface runs on server's time zone. Remove php E_STRICT complains
89  $default_timezone = @date_default_timezone_get();
90  date_default_timezone_set($default_timezone);
91  }
92 }
93 
getPref
getPref($data_dir, $username, $string, $default='')
Definition: db_prefs.php:316
is_logged_in
if(! isset($smtp_auth_mech)) if(! isset($imap_auth_mech)) if(! isset($use_imap_tls)) if(! isset($use_smtp_tls)) is_logged_in()
Definition: auth.php:58
$tzChangeAllowed
$tzChangeAllowed
Definition: validate.php:71
$timeZone
$timeZone
Definition: validate.php:63
$username
global $username
Definition: validate.php:55
set_up_language
set_up_language($sm_language, $do_search=false, $default=false)
Definition: i18n.php:330
$theme
global $theme
Definition: validate.php:43
$data_dir
global $data_dir
Definition: validate.php:55
SMPREF_NONE
const SMPREF_NONE
Definition: constants.php:29
SM_PATH
const SM_PATH
Definition: decrypt_headers.php:16
NULL
if(!defined('PAGE_NAME')) define('PAGE_NAME' NULL
Definition: validate.php:16