summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r--includes/sys_auth.php8
1 files changed, 8 insertions, 0 deletions
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");