patch to fix url session handeling
Aaron Collins <[email protected]> Wed, 20 Jul 2005 02:12:59 -1000
| Newsgroups | gmane.mail.qmail.ldap.phpqladmin |
|---|---|
| Organization | Ehawaii.gov |
| Message-ID | <[email protected]> |
On Tuesday 19 July 2005 22:25, Turbo Fredriksson wrote:
> unified diff
diff -u -r1.4 pql_session.inc
--- phpQLAdmin/include/pql_session.inc 18 May 2005 20:29:16 -0000 1.4
+++ phpQLAdmin/include/pql_session.inc 20 Jul 2005 12:10:31 -0000
@@ -2,15 +2,11 @@
// Manage PHP sessions per phpQLAdmin instance
// $Id: pql_session.inc,v 1.4 2005/05/18 20:29:16 turbo Exp $
-// {{{ Get the URI path
-// Replace '/' with '\/' so that regexp will work
-$root = preg_replace("/\//", "\\/", $_SERVER["DOCUMENT_ROOT"]);
-
-// Remove the document root from _MY_ location.
-$uri = preg_replace("/$root/", '', __FILE__);
-
-// Remove the actual path to the file
-$uri = '/'.preg_replace("/include\/pql_session.inc/", '', $uri);
+// Fix the URI Retgathering
+$uri = $_SERVER['REQUEST_URI'];
+$me = basename($uri);
+$uri = preg_replace("/$me/", '', $uri);
+$uri = preg_replace("/\/\//", '/\//', $uri);
// }}}
// {{{ Retreive the protocol and server name
@@ -35,6 +31,8 @@
$_SESSION["URI"] = $server.$uri;
// Remember our path in the file system.
+//print_r($_SESSION);
+//die($uri);
$_SESSION["path"] = $path;
// {{{ Get user agent
--
Aaron Collins
Systems Administrator /
Release Engineer
Hawaii Information Consortium
[email protected]
808-587-4213