| <?php |
| /******************************************************************************* |
| * Copyright (c) 2007,2021 Eclipse Foundation and others. |
| * |
| * This program and the accompanying materials are made available under |
| * the terms of the Eclipse Public License v2.0 which accompanies this |
| * distribution, and is available at http://www.eclipse.org/legal/epl-2.0 |
| *******************************************************************************/ |
| 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(); |
| include ($App->getProjectCommon()); |
| |
| require_once dirname(__FILE__) . "/../projects/classes/debug.php"; |
| require_once dirname(__FILE__) . "/parts/functions.php"; |
| |
| $host = $_SERVER['HTTP_HOST']; |
| $root = $_SERVER['DOCUMENT_ROOT'] . '/articles'; |
| $file = $_GET['file']; |
| |
| // If the requested article does not exist as a file in this directory |
| // structure, then we bail. The is_valid_article_file should protect us |
| // from an injection attack. |
| if (! is_valid_article_file($file)) { |
| header("Location: /articles"); |
| exit(); |
| } |
| |
| $article_path = "$root/$file"; |
| $pageTitle = "An Eclipse Corner Article"; |
| $pageKeywords = "article, articles, tutorial, tutorials, how-to, howto, whitepaper, whitepapers, white, paper"; |
| $pageAuthor = "Wayne Beaton"; |
| |
| $App->ExtraHtmlHeaders = "<link rel=\"stylesheet\" type=\"text/css\" href=\"layout.css\" media=\"screen\" />\n<base href=\"http://$host/articles/$file\"/>\n"; |
| |
| ob_start(); |
| ?> |
| <div> |
| <a href="/articles/index.php"><img src="/articles/images/back.gif" /> |
| Back to Eclipse Corner Articles</a> |
| </div> |
| |
| <div class="article"> |
| <?php readfile($article_path); ?> |
| </div> |
| |
| <?php |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| $App->generatePage($theme, $Menu, null, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |