add a readme file to the top level AContent directory
[acontent.git] / get_acheck.php
1 <?php
2 /************************************************************************/
3 /* AContent                                                             */
4 /************************************************************************/
5 /* Copyright (c) 2010                                                   */
6 /* Inclusive Design Institute                                           */
7 /*                                                                      */
8 /* This program is free software. You can redistribute it and/or        */
9 /* modify it under the terms of the GNU General Public License          */
10 /* as published by the Free Software Foundation.                        */
11 /************************************************************************/
12
13 /* this file simply gets the TR_CONTENT_DIR/CID.html file that was generated
14  * by the AChecker page of the content editor.
15  * there is no authentication on this page. either the file exists (in which
16  * case it is then quickly deleted after), or it doesn't.
17  */
18
19 $_user_location = 'public';
20
21 define('TR_INCLUDE_PATH', 'include/');
22 require(TR_INCLUDE_PATH . '/vitals.inc.php');
23
24 //get path to file
25 $args = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME']));
26 $file = TR_CONTENT_DIR . $args;
27
28 //check that this file is within the content directory & exists
29
30 $real = realpath($file);
31
32 if (substr($real, 0, strlen(TR_CONTENT_DIR)) == TR_CONTENT_DIR) {
33         header('Content-Type: text/html');
34         echo file_get_contents($real);
35         exit;
36 } else {
37         header('HTTP/1.1 404 Not Found');
38         exit;
39 }
40
41
42 ?>