[Feed-collector-svn] SF.net SVN: feed-collector: [85] trunk/page_logout.php
Status: Beta
Brought to you by:
c167
|
From: <c1...@us...> - 2007-01-02 15:00:45
|
Revision: 85
http://feed-collector.svn.sourceforge.net/feed-collector/?rev=85&view=rev
Author: c167
Date: 2007-01-02 06:57:23 -0800 (Tue, 02 Jan 2007)
Log Message:
-----------
added
Added Paths:
-----------
trunk/page_logout.php
Added: trunk/page_logout.php
===================================================================
--- trunk/page_logout.php (rev 0)
+++ trunk/page_logout.php 2007-01-02 14:57:23 UTC (rev 85)
@@ -0,0 +1,78 @@
+<?php
+
+
+/**
+ * Created on 29.12.2006
+ *
+ *
+ * @author C167 <c1...@us...>
+ */
+require_once "inc/config.php";
+error_reporting(E_ALL);
+############
+# DATABASE #
+############
+require_once "MDB2.php";
+$dsn = array (
+ 'phptype' => $db['type'],
+ 'username' => $db['user'],
+ 'password' => $db['passwd'],
+ 'hostspec' => $db['host'],
+ 'database' => $db['database']
+);
+$options = array (
+ 'debug' => 2,
+ 'result_buffering' => true,
+ 'portability' => MDB2_PORTABILITY_ALL
+);
+$db = & MDB2 :: factory($dsn, $options);
+if (PEAR :: isError($db)) {
+ /*echo $db->getMessage();
+ echo "<br />";
+ echo $db->getDebugInfo();*/
+}
+$db->setFetchMode(MDB2_FETCHMODE_ASSOC);
+
+###########
+# SESSION #
+###########
+require_once "HTTP/Session.php";
+$options = array (
+ 'dsn' => & $db,
+ 'table' => $session['container']['tablename'],
+ 'autooptimize' => $session['container']['autooptimize']
+);
+HTTP_Session :: setContainer('MDB2', $options);
+HTTP_Session :: start();
+HTTP_Session :: setExpire($session['time']['expire']);
+HTTP_Session :: setIdle($session['time']['idle']);
+
+##############
+# HTTP-Class #
+##############
+require_once "HTTP.php";
+
+################
+# User-Manager #
+################
+require_once "class/User_manager.php";
+$user = new User_manager($db);
+
+###################
+# WORKING CONTENT #
+###################
+if (true === HTTP_Session :: isNew()) {
+ HTTP_Session :: set("logged_in", false);
+ HTTP :: redirect("./page_login.php");
+}
+$user->logOut();
+if (isset ($_GET['returnto']) and true === in_array(basename($_GET['returnto']), $validPages)) {
+ HTTP_Session :: set("logged_in", false);
+ HTTP :: redirect("./" . $_GET['returnto']);
+ die();
+} else {
+ HTTP_Session :: set("logged_in", false);
+ HTTP :: redirect("./page_main.php");
+ die();
+}
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|