logoff.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // Copyright (C) 2010 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. require_once('../approot.inc.php');
  17. require_once(APPROOT.'/application/application.inc.php');
  18. require_once(APPROOT.'/application/itopwebpage.class.inc.php');
  19. require_once(APPROOT.'/application/wizardhelper.class.inc.php');
  20. require_once(APPROOT.'/application/startup.inc.php');
  21. $oAppContext = new ApplicationContext();
  22. $currentOrganization = utils::ReadParam('org_id', '');
  23. $operation = utils::ReadParam('operation', '');
  24. require_once(APPROOT.'/application/loginwebpage.class.inc.php');
  25. session_name(MetaModel::GetConfig()->Get('session_name'));
  26. session_start();
  27. $bPortal = utils::ReadParam('portal', false);
  28. $sUrl = utils::GetAbsoluteUrlAppRoot();
  29. if ($bPortal)
  30. {
  31. $sUrl .= 'portal/';
  32. }
  33. else
  34. {
  35. $sUrl .= 'pages/UI.php';
  36. }
  37. $sLoginMode = isset($_SESSION['login_mode']) ? $_SESSION['login_mode'] : '';
  38. LoginWebPage::ResetSession();
  39. switch($sLoginMode)
  40. {
  41. case 'cas':
  42. $sCASLogoutUrl = MetaModel::GetConfig()->Get('cas_logout_redirect_service');
  43. if (empty($sCASLogoutUrl))
  44. {
  45. $sCASLogoutUrl = $sUrl;
  46. }
  47. utils::InitCASClient();
  48. phpCAS::logoutWithRedirectService($sCASLogoutUrl); // Redirects to the CAS logout page
  49. break;
  50. }
  51. $oPage = new LoginWebPage();
  52. $sVersionShort = Dict::Format('UI:iTopVersion:Short', ITOP_VERSION);
  53. $oPage->add("<div id=\"login-logo\"><a href=\"http://www.combodo.com/itop\"><img title=\"$sVersionShort\" src=\"../images/itop-logo-external.png\"></a></div>\n");
  54. $oPage->add("<div id=\"login\">\n");
  55. $oPage->add("<h1>".Dict::S('UI:LogOff:ThankYou')."</h1>\n");
  56. $oPage->add("<p><a href=\"$sUrl\">".Dict::S('UI:LogOff:ClickHereToLoginAgain')."</a></p>");
  57. $oPage->add("</div>\n");
  58. $oPage->output();
  59. ?>