summaryrefslogtreecommitdiffstats
path: root/util.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-26 09:00:01 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-26 09:00:01 +0000
commita919e9b280ca1a3bce47177e6422f380e8af002a (patch)
treefffcde24d9c2391bf1c9acd0700ab5c81817deab /util.php
parent97bcd214044e30b5078052ee0c523b63966d6833 (diff)
downloadampache-a919e9b280ca1a3bce47177e6422f380e8af002a.tar.gz
ampache-a919e9b280ca1a3bce47177e6422f380e8af002a.tar.bz2
ampache-a919e9b280ca1a3bce47177e6422f380e8af002a.zip
remove redundent UPDATE on session table due to /util.php should make high-traffic sites faster, most likely will not notice the query redunction
Diffstat (limited to 'util.php')
-rw-r--r--util.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/util.php b/util.php
index 28bbabaf..99f8d149 100644
--- a/util.php
+++ b/util.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2007 ampache.org
+ Copyright (c) Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+define('NO_SESSION','1');
require_once 'lib/init.php';
header("Expires: Tuesday, 27 Mar 1984 05:00:00 GMT");
@@ -25,12 +26,20 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
+$session_name = Config::get('session_name');
+
+if (!vauth::session_exists('interface',$_COOKIE[$session_name])) {
+ debug_event('Util','Invalid Session:' . $_COOKIE[$session_name] . 'for session ' . $session_name,'1');
+ exit;
+}
+
+$data = vauth::read($_COOKIE[$session_name]);
// This is a little bit of a special file, it takes the
// content of $_SESSION['iframe']['target'] and does a header
// redirect to that spot!
-if (isset($_SESSION['iframe']['target'])) {
- $target = $_SESSION['iframe']['target'];
- unset($_SESSION['iframe']['target']);
+if (isset($data['iframe']['target'])) {
+ $target = $data['iframe']['target'];
+ unset($data['iframe']['target']);
header("Location: " . $target);
}
?>