changeset 125:f364b50e07f7

Some preliminary work on a potential "compo system announcement whatnot thingy".
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Oct 2013 16:20:47 +0300
parents 986c25c2e2bc
children 71c35d5302c2
files show.php
diffstat 1 files changed, 61 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/show.php	Tue Oct 22 16:20:47 2013 +0300
@@ -0,0 +1,61 @@
+<?
+//
+// Entry display / show helper module
+//
+$sessionType = "admin";
+require "mconfig.inc.php";
+require "msite.inc.php";
+require "mcommon.inc.php";
+require "msession.inc.php";
+
+// Check if we are allowed to execute
+if (!stCheckHTTPS() || !stAdmSessionAuth(TRUE))
+{
+  stSetupCacheControl();
+
+  stSessionEnd(SESS_ADMIN);
+
+  stSetStatus(404, "Not Found");
+  
+  cmPrintPageHeader("Error");
+  echo "<div class=\"notice\">".
+  "<h1>Permission denied</h1>\n".
+  "<p>You need to be logged in as administrator to access this data.</p>\n".
+  "<p><a href=\"admin\">Click here for login form</a></p>\n".
+  "</div>\n";
+  cmPrintPageFooter();
+  exit;
+}
+
+stSetupCacheControl();
+
+// Initiate SQL database connection
+if (!stConnectSQLDB())
+  die("Could not connect to SQL database.");
+
+// Fetch non-"hardcoded" settings from SQL database
+stReloadSettings();
+
+cmPrintPageHeader("SHOW DISPLAY", "", FALSE);
+?>
+<script type="text/javascript">
+// <? echo "\n"; include "ajax.js"; ?>
+
+</script>
+<div id="contents">
+<noscript>
+<div class="notice">
+<h1>Javascript required</h1>
+<p>
+The compo system page requires Javascript to be enabled for the AJAX functionality.
+<br />
+<a href="#">Please enable Javascript and reload this page</a>.
+</p>
+</div>
+</noscript>
+</div>
+<script type="text/javascript">
+</script>
+<?
+cmPrintPageFooter(FALSE);
+?>
\ No newline at end of file