http://www.atutor.ca/atutor/mantis/view.php?id=4492
authorCindy Li <cli@ocad.ca>
Tue, 17 Aug 2010 18:46:55 +0000 (18:46 -0000)
committerCindy Li <cli@ocad.ca>
Tue, 17 Aug 2010 18:46:55 +0000 (18:46 -0000)
docs/get_acheck.php [new file with mode: 0644]

diff --git a/docs/get_acheck.php b/docs/get_acheck.php
new file mode 100644 (file)
index 0000000..dbcd777
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/************************************************************************/
+/* AContent                                                             */
+/************************************************************************/
+/* Copyright (c) 2010                                                   */
+/* Inclusive Design Institute                                           */
+/*                                                                      */
+/* This program is free software. You can redistribute it and/or        */
+/* modify it under the terms of the GNU General Public License          */
+/* as published by the Free Software Foundation.                        */
+/************************************************************************/
+
+/* this file simply gets the TR_CONTENT_DIR/CID.html file that was generated
+ * by the AChecker page of the content editor.
+ * there is no authentication on this page. either the file exists (in which
+ * case it is then quickly deleted after), or it doesn't.
+ */
+
+$_user_location        = 'public';
+
+define('TR_INCLUDE_PATH', 'include/');
+require(TR_INCLUDE_PATH . '/vitals.inc.php');
+
+//get path to file
+$args = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME']));
+$file = TR_CONTENT_DIR . $args;
+
+//check that this file is within the content directory & exists
+
+$real = realpath($file);
+
+if (substr($real, 0, strlen(TR_CONTENT_DIR)) == TR_CONTENT_DIR) {
+       header('Content-Type: text/html');
+       echo file_get_contents($real);
+       exit;
+} else {
+       header('HTTP/1.1 404 Not Found');
+       exit;
+}
+
+
+?>
\ No newline at end of file