CLEANUP: make index.php very short and move everything in separate files
[e-DoKo.git] / include / logout.php
diff --git a/include/logout.php b/include/logout.php
new file mode 100644 (file)
index 0000000..d74f091
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/* make sure that we are not called from outside the scripts, 
+ * use a variable defined in config.php to check this
+ */
+if(!isset($HOST))
+  exit;
+
+/* distroy the session */
+session_unset();
+session_destroy();
+$_SESSION = array();
+    
+echo "<div class=\"message\"><span class=\"bigger\">You are now logged out!</span><br />\n".
+"(<a href=\"$INDEX\">This will take you back to the home-page</a>)</div>";
+?>
\ No newline at end of file