Source for file validate.php

Documentation is available at validate.php

  1. <?php
  2.  
  3. /**
  4.  * validate.php
  5.  *
  6.  * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  7.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8.  * @version $Id: validate.php,v 1.9.2.7 2006/08/07 19:07:44 kink Exp $
  9.  * @package squirrelmail
  10.  */
  11.  
  12. /** include the mime class before the session start ! otherwise we can't store
  13.  * messages with a session_register.
  14.  *
  15.  * From http://www.php.net/manual/en/language.oop.serialization.php:
  16.  *   In case this isn't clear:
  17.  *   In 4.2 and below:
  18.  *      session.auto_start and session objects are mutually exclusive.
  19.  *
  20.  * We need to load the classes before the session is started,
  21.  * except that the session could be started automatically
  22.  * via session.auto_start. So, we'll close the session,
  23.  * then load the classes, and reopen the session which should
  24.  * make everything happy.
  25.  *
  26.  * ** Note this means that for the 1.3.2 release, we should probably
  27.  * recommend that people set session.auto_start=0 to avoid this altogether.
  28.  */
  29.  
  30.  
  31. /**
  32.  * Reset the $theme() array in case a value was passed via a cookie.
  33.  * This is until theming is rewritten.
  34.  */
  35. global $theme;
  36. unset($theme);
  37. $theme=array();
  38.  
  39. /* SquirrelMail required files. */
  40. require_once(SM_PATH 'class/mime.class.php');
  41. require_once(SM_PATH 'functions/global.php');
  42. require_once(SM_PATH 'functions/strings.php');
  43. require_once(SM_PATH 'config/config.php');
  44.  
  45. /* set the name of the session cookie */
  46. if(isset($session_name&& $session_name{
  47.     ini_set('session.name' $session_name);
  48. else {
  49.     ini_set('session.name' 'SQMSESSID');
  50. }
  51.  
  52.  
  53. require_once(SM_PATH 'functions/i18n.php');
  54. require_once(SM_PATH 'functions/auth.php');
  55.  
  56.  
  57. require_once(SM_PATH 'include/load_prefs.php');
  58. require_once(SM_PATH 'functions/page_header.php');
  59. require_once(SM_PATH 'functions/prefs.php');
  60.  
  61. /* Set up the language (i18n.php was included by auth.php). */
  62. global $username$data_dir;
  63. set_up_language(getPref($data_dir$username'language'));
  64.  
  65. $timeZone getPref($data_dir$username'timezone');
  66.  
  67. /* Check to see if we are allowed to set the TZ environment variable.
  68.  * We are able to do this if ...
  69.  *   safe_mode is disabled OR
  70.  *   safe_mode_allowed_env_vars is empty (you are allowed to set any) OR
  71.  *   safe_mode_allowed_env_vars contains TZ
  72.  */
  73. $tzChangeAllowed (!ini_get('safe_mode')) ||
  74.                     !strcmp(ini_get('safe_mode_allowed_env_vars'),''||
  75.                     preg_match('/^([\w_]+,)*TZ/'ini_get('safe_mode_allowed_env_vars'));
  76.  
  77. if $timeZone != SMPREF_NONE && ($timeZone != "")
  78.     && $tzChangeAllowed {
  79.     putenv("TZ=".$timeZone);
  80. }
  81.  
  82. ?>

Documentation generated on Sat, 07 Oct 2006 16:34:02 +0300 by phpDocumentor 1.3.0RC6