summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2011-06-02 01:18:08 +0200
committerPhilip Häusler <msquare@notrademark.de>2011-06-02 01:18:08 +0200
commit06497b3a5387f30ea140562cc71e371b2ec1e131 (patch)
tree8fc4fad2a21fb20ff233d4acf33c91590a814301 /includes/sys_auth.php
parent10683c4759c2c3563ff7ed48b15d12e85cd0631b (diff)
cleanup
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");