summaryrefslogtreecommitdiff
path: root/web/index.php
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-11-15 09:20:11 +0000
committerPeter Palfrader <peter@palfrader.org>2004-11-15 09:20:11 +0000
commit5e95090defff64bc8cd7a318a73aa930948fb66d (patch)
treed977ded4207e51914d539b0ecd20b8583d37c8ea /web/index.php
parent6c3e0ba0a82307abf825bf1cde85638464ab1713 (diff)
Initial import
Diffstat (limited to 'web/index.php')
-rw-r--r--web/index.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/web/index.php b/web/index.php
new file mode 100644
index 0000000..6c37e0b
--- /dev/null
+++ b/web/index.php
@@ -0,0 +1,27 @@
+<?
+
+require_once( "../include/Namespace.inc" );
+require_once( "../include/Template.inc" );
+require_once("../include/Tools.inc");
+
+$namespace = new Namespace(
+ array( have_database => 1,
+ have_session => 1,
+ have_user => 1 )
+) or
+ die("Nobody loves me. I don't even have space for a name.");
+
+$data = array();
+$data['remotehostname'] = gethostbyaddr($_SERVER['REMOTE_ADDR']);
+$data['remoteip'] = $_SERVER['REMOTE_ADDR'];
+$data['user'] = $namespace->session->data['user']['username'];
+$data['have_ssl'] = $_SERVER['SSL_PROTOCOL'] ? 1 : 0;
+$template = new Template('index.html', $namespace->config->template_path);
+$template->parse($data);
+print $template->output();
+
+$namespace->stop();
+
+# vim:ts=4:
+# vim:shiftwidth=4:
+?>