diff options
| author | Christian Fowler <spider@viovio.com> | 2009-03-16 20:04:19 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-03-16 20:04:19 +0000 |
| commit | 846516455b6174bb5533645e55abfe52f794910b (patch) | |
| tree | 3544383798f8f5c5972a11fbc87fe9bc44c9b556 /validate.php | |
| parent | 6394b5f010db437df54c4bf06aff81916a2d7ece (diff) | |
| download | users-846516455b6174bb5533645e55abfe52f794910b.tar.gz users-846516455b6174bb5533645e55abfe52f794910b.tar.bz2 users-846516455b6174bb5533645e55abfe52f794910b.zip | |
check returnto first since it is an explicit redirect, remove debug
Diffstat (limited to 'validate.php')
| -rw-r--r-- | validate.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/validate.php b/validate.php index 718a4a6..ad98ef8 100644 --- a/validate.php +++ b/validate.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/validate.php,v 1.21 2009/03/06 20:11:50 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/validate.php,v 1.22 2009/03/16 20:04:19 spiderr Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: validate.php,v 1.21 2009/03/06 20:11:50 spiderr Exp $ + * $Id: validate.php,v 1.22 2009/03/16 20:04:19 spiderr Exp $ * @package users * @subpackage functions */ @@ -27,13 +27,12 @@ global $gBitSystem; //Remember where user is logging in from and send them back later; using session variable for those of us who use WebISO services //do not use session loginfrom with login.php or register.php - only "inline" login forms display in perm denied fatals, etc. -if( isset( $_SERVER['HTTP_REFERER'] ) && strpos( $_SERVER['HTTP_REFERER'], 'login.php' ) === FALSE && strpos( $_SERVER['HTTP_REFERER'], 'register.php' ) === FALSE ) { -bt(); - $from = parse_url( $_SERVER['HTTP_REFERER'] ); - $_SESSION['loginfrom'] = (!empty($from['path']) ? $from['path'] : '').( !empty( $from['query'] ) ? '?'.$from['query'] : '' ); -} elseif( !empty( $_SESSION['returnto'] ) ) { +if( !empty( $_SESSION['returnto'] ) ) { // we have been explicitly told where we want to return $_SESSION['loginfrom'] = $_SESSION['returnto']; +} elseif( isset( $_SERVER['HTTP_REFERER'] ) && strpos( $_SERVER['HTTP_REFERER'], 'login.php' ) === FALSE && strpos( $_SERVER['HTTP_REFERER'], 'register.php' ) === FALSE ) { + $from = parse_url( $_SERVER['HTTP_REFERER'] ); + $_SESSION['loginfrom'] = (!empty($from['path']) ? $from['path'] : '').( !empty( $from['query'] ) ? '?'.$from['query'] : '' ); } elseif( !empty( $_SESSION['loginfrom'] ) ) { unset( $_SESSION['loginfrom'] ); } |
