Source for file signout.php

Documentation is available at signout.php

  1. <?php
  2.  
  3. /**
  4.  * signout.php -- cleans up session and logs the user out
  5.  *
  6.  *  Cleans up after the user. Resets cookies and terminates session.
  7.  *
  8.  * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  9.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.  * @version $Id: signout.php,v 1.97 2006/10/05 21:59:04 stevetruckstuff Exp $
  11.  * @package squirrelmail
  12.  */
  13.  
  14. /**
  15.  * Include the SquirrelMail initialization file.
  16.  */
  17. require('../include/init.php');
  18.  
  19. /* Erase any lingering attachments */
  20. sqgetGlobalVar('compose_messages',  $compose_messages,  SQ_SESSION);
  21.  
  22. if (!empty($compose_message&& is_array($compose_messages)) {
  23.     foreach($compose_messages as $composeMessage{
  24.         $composeMessage->purgeAttachments();
  25.     }
  26. }
  27.  
  28. if (!isset($frame_top)) {
  29.     $frame_top '_top';
  30. }
  31.  
  32. /* If a user hits reload on the last page, $base_uri isn't set
  33.  * because it was deleted with the session. */
  34. if (sqgetGlobalVar('base_uri'$base_uriSQ_SESSION) ) {
  35.     $base_uri sqm_baseuri();
  36. }
  37.  
  38. do_hook('logout');
  39.  
  40.  
  41. if ($signout_page{
  42.     // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog.
  43.     //header('Status: 303 See Other');
  44.         header("Location$signout_page");
  45.     exit/* we send no content if we're redirecting. */
  46. }
  47.  
  48. /* After a reload of signout.php, $oTemplate might not exist anymore.
  49.  * Recover, so that we don't get all kinds of errors in that situation. */
  50. if !isset($oTemplate|| !is_object($oTemplate) ) {
  51.     require_once(SM_PATH 'class/template/Template.class.php');
  52.     $sTemplateID Template::get_default_template_set();
  53.     $icon_theme_path !$use_icons NULL Template::calculate_template_images_directory($sTemplateID);
  54.     $oTemplate Template::construct_template($sTemplateID);
  55.  
  56.     // We want some variables to always be available to the template
  57.         $always_include array('sTemplateID''icon_theme_path''javascript_on');
  58.     foreach ($always_include as $var{
  59.         $oTemplate->assign($var(isset($$var? $$var NULL));
  60.     }
  61. }
  62.  
  63. // The error handler object is probably also not initialized on a refresh
  64. require_once(SM_PATH 'class/error.class.php');
  65. $oErrorHandler new ErrorHandler($oTemplate,'error_message.tpl');
  66.  
  67. /* internal gettext functions will fail, if language is not set */
  68. set_up_language($squirrelmail_languagetruetrue);
  69.  
  70. displayHtmlHeader($org_title ' - ' _("Signout"));
  71.  
  72. $oTemplate->assign('frame_top'$frame_top);
  73.  
  74. $oTemplate->display('signout.tpl');
  75.  
  76. $oTemplate->display('footer.tpl');

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