|
|
@@ -1,42 +1,19 @@
|
|
|
+<?php
|
|
|
+$protocol = ( !empty($_SERVER["HTTPS"] ) ) ? 'https' : 'http';
|
|
|
+$nav = ( !empty($_GET['nav'] ) ) ? $_GET['nav'] : '';
|
|
|
+$post = ( !empty($_GET['post'] ) ) ? $_GET['post'] : '';
|
|
|
+
|
|
|
+if(file_exists('sys/admin/config/main.json')) {
|
|
|
+ $config = json_decode(file_get_contents('sys/admin/config/main.json'),true);
|
|
|
+} else {
|
|
|
+ # XXX Need to have manual be hosted in repo under sys/admin/manual
|
|
|
+ include( "templates/default/notconfigured.tmpl" );
|
|
|
+ die();
|
|
|
+}
|
|
|
+?>
|
|
|
<!doctype html>
|
|
|
<html dir="ltr" lang="en-US">
|
|
|
<head>
|
|
|
- <?php
|
|
|
- //SRSBIZNUSS below - you probably shouldn't edit this unless you know what you are doing
|
|
|
- //GET validation/sanitation and parameter variable definitions below
|
|
|
- if (!empty($_SERVER["HTTPS"])) {
|
|
|
- $protocol = "http";
|
|
|
- } else {
|
|
|
- $protocol = "https";
|
|
|
- }
|
|
|
- if (empty($_GET['nav'])) {
|
|
|
- $nav = '';
|
|
|
- }
|
|
|
- else {
|
|
|
- $nav = $_GET['nav'];
|
|
|
- }
|
|
|
- if (empty($_GET['post'])) {
|
|
|
- $post = '';
|
|
|
- }
|
|
|
- else {
|
|
|
- $post = $_GET['post'];
|
|
|
- }
|
|
|
-
|
|
|
- //input sanitization - XXX Why is this in the index? Should only be include in stuff that needs it
|
|
|
- $pwd=$post;
|
|
|
- include 'sys/fileshare/sanitize.inc';
|
|
|
- if ($san == 1) {
|
|
|
- return(0);
|
|
|
- };
|
|
|
- if(file_exists('sys/admin/config/main.json')) {
|
|
|
- $config = json_decode(file_get_contents('sys/admin/config/main.json'),true);
|
|
|
- } else {
|
|
|
- # XXX Need to have manual be hosted in repo under sys/admin/manual
|
|
|
- echo "</head><body>tCMS has not gone through initial configuration.<br />";
|
|
|
- echo 'Please see the <a href="https://tcms.troglodyne.net/index.php?nav=5&post=fileshare/manual/Chapter%2000-Introduction.post">tCMS Manual</a> for how to accomplish this.';
|
|
|
- die("</body></html>");
|
|
|
- }
|
|
|
- ?>
|
|
|
<meta charset="utf-8" />
|
|
|
<meta name="description" content="A Simple CMS by teodesian.net"/>
|
|
|
<meta name="viewport" content="width=device-width">
|
|
|
@@ -95,48 +72,25 @@
|
|
|
?>
|
|
|
</div>
|
|
|
<div id="kontent" class="kontained">
|
|
|
- <?php
|
|
|
- /*$kontent basically is just a handler for what PHP include needs to be loaded
|
|
|
- based on the context passed via GET params - if you wanna add another, add an
|
|
|
- elseif case then specify the next number in the nav index along with the
|
|
|
- corresponding file to include above.*/
|
|
|
- if (empty($nav)) {
|
|
|
- $kontent = $config['home'];
|
|
|
- }
|
|
|
- elseif ($nav == 1) {
|
|
|
- $kontent = $config['fileshare'];
|
|
|
- }
|
|
|
- elseif ($nav == 2) {
|
|
|
- $kontent = $config['microblog'];
|
|
|
- $editable = 0;
|
|
|
- }
|
|
|
- elseif ($nav == 3) {
|
|
|
- $kontent = $config['blog'];
|
|
|
- }
|
|
|
- elseif ($nav == 4) {
|
|
|
- $kontent = $config['about'];
|
|
|
- }
|
|
|
- elseif ($nav == 5) {
|
|
|
- $kontent = $config['postloader'];
|
|
|
- }
|
|
|
- elseif ($nav == 6) {
|
|
|
- $kontent = $config['codeloader'];
|
|
|
- }
|
|
|
- elseif ($nav == 7) {
|
|
|
- $kontent = $config['audioloader'];
|
|
|
- }
|
|
|
- elseif ($nav == 8) {
|
|
|
- $kontent = $config['videoloader'];
|
|
|
- }
|
|
|
- elseif ($nav == 9) {
|
|
|
- $kontent = $config['imgloader'];
|
|
|
- }
|
|
|
- elseif ($nav == 10) {
|
|
|
- $kontent = $config['docloader'];
|
|
|
- }
|
|
|
- //Main Content Display Frame goes below
|
|
|
- include $kontent;
|
|
|
- ?>
|
|
|
+ <?php
|
|
|
+/*$kontent basically is just a handler for what PHP include needs to be loaded
|
|
|
+based on the context passed via GET params - if you wanna add another, add an
|
|
|
+elseif case then specify the next number in the nav index along with the
|
|
|
+corresponding file to include above.*/
|
|
|
+$destinations = [
|
|
|
+ $config['home'], $config['fileshare'], $config['microblog'], $config['blog'], $config['about'],
|
|
|
+ $config['postloader'], $config['codeloader'], $config['audioloader'], $config['videoloader'],
|
|
|
+ $config['imgloader'], $config['docloader']
|
|
|
+];
|
|
|
+if ( empty($nav) ) $nav = 0;
|
|
|
+if ( $nav === 1 || $nav > 5 ) {
|
|
|
+ $pwd = $post;
|
|
|
+ include 'sys/fileshare/sanitize.inc';
|
|
|
+}
|
|
|
+$kontent = $destinations[$nav];
|
|
|
+//Main Content Display Frame goes below
|
|
|
+include $kontent;
|
|
|
+ ?>
|
|
|
</div>
|
|
|
<div id="rightbar" class="kontained">
|
|
|
<?php
|