blob: 2680b543c8241afdd6a2ba2e3b856cdd9112f311 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2014 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christopher Guindon (Eclipse Foundation) - Initial implementation
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php");
$App = new App();
$Nav = new Nav();
$Menu = new Menu();
$App->preventCaching();
include("_projectCommon.php");
header("Content-type: text/html; charset=utf-8");
$pageTitle = "Log out";
$pageKeywords = "eclipse, friends, logout ,account, signon, sign-on";
$pageAuthor = "Eclipse Foundation, Inc.";
$referer = "";
if (isset($_SERVER['HTTP_REFERER'])) {
$referer = $_SERVER['HTTP_REFERER'];
}
$eclipse_domains = array(
'projects.eclipse.org' => 'https://projects.eclipse.org/',
'eclipse.org/forums/' => 'https://www.eclipse.org/forums/',
'wiki.eclipse.org' => 'https://wiki.eclipse.org/index.php?title=Special:UserLogout',
'git.eclipse.org/r/' => 'https://git.eclipse.org/r/',
'bugs.eclipse.org/bugs/' => 'https://bugs.eclipse.org/bugs/',
'lts.eclipse.org' => 'https://lts.eclipse.org/',
'marketplace.eclipse.org' => 'https://marketplace.eclipse.org',
);
$redirect = 'https://www.eclipse.org/';
foreach ($eclipse_domains as $key => $value) {
if (strpos($referer, $key)){
$redirect = $value;
break;
}
}
// Destroy the session for the user.
$Session = $App->useSession();
$Session->destroy();
// Place your html content in a file called content/en_pagename.php
ob_start();
include("content/en_" . $App->getScriptName());
$html = ob_get_clean();
$App->AddExtraHtmlHeader('<meta http-equiv="refresh" content="2;url=' . $redirect . '"> ');
$App->setGoogleAnalyticsTrackingCode(NULL);
$App->generatePage($theme, $Menu, NULL, $pageAuthor, $pageKeywords, $pageTitle, $html);