summaryrefslogtreecommitdiff
path: root/forum/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'forum/htdocs')
-rw-r--r--forum/htdocs/config.php.defaults9
-rw-r--r--forum/htdocs/file.php27
-rw-r--r--forum/htdocs/index.php89
3 files changed, 125 insertions, 0 deletions
diff --git a/forum/htdocs/config.php.defaults b/forum/htdocs/config.php.defaults
new file mode 100644
index 0000000..512758f
--- /dev/null
+++ b/forum/htdocs/config.php.defaults
@@ -0,0 +1,9 @@
+<?php
+$UTIL_DIR = "../../forum/utils";
+$DATA_DIR = "../../forum/data";
+$FORUMS_DIR = "../../forum/data/forum";
+$ADMIN_TIMEOUT = 100000;
+$PERMSTORE = $DATA_DIR . "/files";
+$IMAGECACHE = $DATA_DIR . "/imagecache";
+$LOG_FILE = $DATA_DIR . "/forum.log";
+?>
diff --git a/forum/htdocs/file.php b/forum/htdocs/file.php
new file mode 100644
index 0000000..abf02fb
--- /dev/null
+++ b/forum/htdocs/file.php
@@ -0,0 +1,27 @@
+<?php
+
+include_once("config.php");
+include_once($UTIL_DIR . "/mimetypes.php");
+include_once($UTIL_DIR . "/files.php");
+
+$files = new Files($DATA_DIR . "/files.xml");
+$file = $files->getFile($fid);
+
+$filename = $PERMSTORE . "/" . $file->fid;
+
+$download = false;
+foreach($MIME_TYPES as $m) {
+ if($m->name == $file->mimetype) $download = !$m->show;
+}
+
+//header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+header('Content-Description: File Transfer');
+header('Content-Type: ' . $file->mimetype);
+header('Content-Length: ' . filesize($filename));
+
+if($download) header('Content-Disposition: attachment; filename=' . basename($file->name));
+else header('Content-Disposition: inline; filename=' . basename($file->name));
+
+readfile($filename);
+
+?> \ No newline at end of file
diff --git a/forum/htdocs/index.php b/forum/htdocs/index.php
new file mode 100644
index 0000000..a452f20
--- /dev/null
+++ b/forum/htdocs/index.php
@@ -0,0 +1,89 @@
+<?php
+header("Content-Type: text/html; charset=UTF-8");
+
+/*
+Jonas Mobil:
+"SonyEricssonW660i/R6BC Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
+
+Rasmus Mobil:
+"Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN81-3/11.0.045 Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413"
+*/
+include_once("config.php");
+include_once($UTIL_DIR . "/login.php");
+checklogin();
+
+include_once($UTIL_DIR . "/clientinfo.php");
+?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>ExecutionForum</title>
+<meta name="MSSmartTagsPreventParsing" content="true"/>
+<meta http-equiv="Content-Type" content="text/html"/>
+<link rel="author" title="Bent Bisballe Nyeng" href="http://www.aasimon.org"/>
+<link rel="stylesheet" type="text/css" href="forum.css"/>
+<?php if($mode == "editor") {?><script language="javascript" src="lib.js" type="text/javascript"></script><?php } ?>
+</head>
+<body>
+<div class="menu">
+ <a href="?mode=forum">Forum</a>
+<?php /* <a href="?mode=files">Filehandler</a> */ ?>
+ <a href="?mode=calendar">Calendar</a>
+ <a href="?mode=profile">Profile</a>
+</div>
+
+<?php
+
+// Globals:
+// $fid
+// $tid
+// $pid
+// $task
+
+if($current_user) {
+ echo "<p>Logged in as: " . $current_user->name . " - <a href=\"?action=logout\">Logout</a></p>";
+
+ switch($mode) {
+ case "test":
+ // include_once($UTIL_DIR. "/notify.php");
+ // notify("Test", "Test");
+ break;
+
+ case "profile":
+ include_once($UTIL_DIR. "/profile.php");
+ break;
+
+ case "calendar":
+ include_once($UTIL_DIR. "/calendar.php");
+ break;
+
+ case "editor":
+ include_once($UTIL_DIR. "/editor.php");
+ break;
+
+ case "edit":
+ include_once($UTIL_DIR. "/edit.php");
+ break;
+
+ case "files":
+ include_once($UTIL_DIR. "/filehandler.php");
+ break;
+
+ case "view":
+ default:
+ include_once($UTIL_DIR. "/view.php");
+ break;
+ }
+} else {
+?>
+<form action="?action=login" method="post">
+<p>UserID: <input name="current_username"/></p>
+<p>Password: <input name="current_password" type="password"/></p>
+<p><button type="submit">Login</button></p>
+</form>
+<?php
+}
+?>
+</body>
+</html>