From 06497b3a5387f30ea140562cc71e371b2ec1e131 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 2 Jun 2011 01:18:08 +0200 Subject: cleanup --- includes/sys_auth.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'includes/sys_auth.php') diff --git a/includes/sys_auth.php b/includes/sys_auth.php index 1c15122e..68e336b0 100644 --- a/includes/sys_auth.php +++ b/includes/sys_auth.php @@ -5,6 +5,14 @@ function load_auth() { global $user; + if (!isset ($_SESSION['IP'])) + $_SESSION['IP'] = $_SERVER['REMOTE_ADDR']; + + if ($_SESSION['IP'] != $_SERVER['REMOTE_ADDR']) { + session_destroy(); + header("Location: " . link_to_page($start)); + } + $user = null; if (isset ($_SESSION['uid'])) { $user = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($_SESSION['uid']) . " LIMIT 1"); -- cgit v1.2.3-54-g00ecf