Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+<?php
2
+// Generally, you should be able to leave this alone.  This logout function will unset all session variables and cookie variables of the same name that begin with the site's sitekey.
3
+
4
+if(!defined("_LOGOUTCHECK")) exit( );
5
+	define("_BASEDIR", "");
6
+	include("config.php");
7
+	include_once("includes/queries.php");
8
+	session_start( );
9
+	require_once(PATHTOSMF."SSI.php");
10
+	$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
11
+	loadUserSettings( );
12
+	include_once(PATHTOSMF."Sources/Subs-Auth.php");
13
+	// If you log out, you aren't online anymore :P.
14
+	dbquery("DELETE FROM {$db_prefix}log_online WHERE ID_MEMBER = $ID_MEMBER LIMIT 1");
15
+	$_SESSION['log_time'] = 0;
16
+	// Empty the cookie! (set it in the past, and for ID_MEMBER = 0)
17
+	setLoginCookie(-3600, 0);
18
+	foreach ($_SESSION as $VarName => $Value)  { 
19
+		if(substr($VarName, 0, strlen($sitekey)) == $sitekey) {
20
+			if(strpos($VarName, "skin")) continue;
21
+			unset($$VarName);
22
+			$_SESSION[$VarName] = ""; 
23
+			setcookie($VarName, '0');
24
+		}
25
+	}
26
+require_once("header.php");
27
+//make a new TemplatePower object
28
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
29
+else $tpl = new TemplatePower("default_tpls/default.tpl");
30
+if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
31
+else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
32
+include("includes/pagesetup.php");
33
+
34
+$output .= write_message(_ACTIONSUCCESSFUL);
35
+$tpl->assign("output", $output);
36
+$tpl->printToScreen( );
37
+?>
0 38
\ No newline at end of file