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 1999-2020 The SquirrelMail Project Team
  9.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.  * @version $Id: signout.php 14845 2020-01-07 08:09:34Z pdontthink $
  11.  * @package squirrelmail
  12.  */
  13.  
  14. /** This is the signout page */
  15. define('PAGE_NAME''signout');
  16.  
  17. /**
  18.  * Include the SquirrelMail initialization file.
  19.  */
  20. require('../include/init.php');
  21.  
  22. /* Erase any lingering attachments */
  23. sqgetGlobalVar('compose_messages',  $compose_messages,  SQ_SESSION);
  24.  
  25. if (!empty($compose_message&& is_array($compose_messages)) {
  26.     foreach($compose_messages as $composeMessage{
  27.         $composeMessage->purgeAttachments();
  28.     }
  29. }
  30.  
  31. if (!isset($frame_top)) {
  32.     $frame_top '_top';
  33. }
  34.  
  35. $login_uri 'login.php';
  36.  
  37. do_hook('logout'$login_uri);
  38.  
  39.  
  40. if ($signout_page{
  41.     // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog.
  42.     //header('Status: 303 See Other');
  43.     header("Location: $signout_page");
  44.     exit/* we send no content if we're redirecting. */
  45. }
  46.  
  47. /* After a reload of signout.php, $oTemplate might not exist anymore.
  48.  * Recover, so that we don't get all kinds of errors in that situation. */
  49. if !isset($oTemplate|| !is_object($oTemplate) ) {
  50.     require_once(SM_PATH 'class/template/Template.class.php');
  51.     $sTemplateID Template::get_default_template_set();
  52.     $icon_theme_path !$use_icons NULL Template::calculate_template_images_directory($sTemplateID);
  53.     $oTemplate Template::construct_template($sTemplateID);
  54.  
  55.     // We want some variables to always be available to the template
  56.     $oTemplate->assign('javascript_on'checkForJavascript());
  57.     $oTemplate->assign('base_uri'sqm_baseuri());
  58.     $always_include array('sTemplateID''icon_theme_path');
  59.     foreach ($always_include as $var{
  60.         $oTemplate->assign($var(isset($$var? $$var NULL));
  61.     }
  62. }
  63.  
  64. // The error handler object is probably also not initialized on a refresh
  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. $oTemplate->assign('login_uri'$login_uri);
  74.  
  75. $oTemplate->display('signout.tpl');
  76.  
  77. $oTemplate->display('footer.tpl');

Documentation generated on Mon, 13 Jan 2020 04:23:33 +0100 by phpDocumentor 1.4.3