All credits to thoul
http://darkmods.sourceforge.net##############################################################
# Title: Redirect Outside phpBB After Log In/Out
# Author: Thoul thoul@users.sourceforge.net
http://darkmods.sourceforge.net# Description: Guide that allows redirecting outside phpBB for log in or out.
# Version: 1.1.1
# Installation Level: Easy
# Installation Time: 3 Minutes
# Files To Edit: login.php
# Included Files: n/a
##############################################################
# Author's Notes:
# This file is intended to be a guide to redirecting users to files outside of the
# phpBB directories when they log in or log out on a case-by-case basis (that is to
# say, so that you can have some log ins/outs redirect like this and have some
# not). This file deals only with login.php, logging in, and logging out, but
# similar ideas can also be applied to redirecting outside of the phpBB
# directories in other files.
#
# If you are redirecting users to pages outside of your phpBB directories (aka
# folders), be sure to read the file function_change.txt also. It contains other
# modifications and instructions that you will need to read.
#
# Once all these modifications have been applied, you can use log in forms to
# redirect users outside the phpBB directories by adding two hidden form inputs
# like these:
# <input type="hidden" name="outside" value="1" />
# <input type="hidden" name="redirect" value="index.htm" />
# You can also create log in links like this one:
# <a href="login.php?redirect=/index.html&outside=1">Log In</a>
# And you can create log out links like this one:
# <a href="login.php?logout=true&redirect=/index.phtml&outside=1">Log Out</a>
#
#
# Thanks to RyanThaDude29 for developing some of the concepts presented in the mod
# on the FetchAll forums.
##############################################################
# BEFORE ADDING THIS TO YOUR FORUM, YOU SHOULD BACK UP ALL RELATED FILES.
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
forum/login.php
#
#-----[ FIND ]------------------------------------------
#
if( $session_id )
{
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
redirect(append_sid($url, true));
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
/* Original phpBB code - commented out for Redirect Outside phpBB After Log In/Out
if( $session_id )
{
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
redirect(append_sid($url, true));
}
*/
//---------------------------------------------------------------------------------
// Redirect Outside phpBB After Log In/Out - Begin Code Addition
//
if( $session_id )
{
$url = ( !empty($_REQUEST['redirect']) ) ? str_replace('&', '&', htmlspecialchars(addslashes($_REQUEST['redirect']))) : 'index.' . $phpEx;
$outside = ( !empty($_REQUEST['outside']) ) ? true : false;
redirect(append_sid($url, true), $outside);
}
//
// Redirect Outside phpBB After Log In/Out - End Code Addition
//---------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
if (!empty($HTTP_POST_VARS['redirect']) || !empty($HTTP_GET_VARS['redirect']))
{
$url = (!empty($HTTP_POST_VARS['redirect'])) ? htmlspecialchars($HTTP_POST_VARS['redirect']) : htmlspecialchars($HTTP_GET_VARS['redirect']);
$url = str_replace('&', '&', $url);
redirect(append_sid($url, true));
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
/* Original phpBB code - commented out for Redirect Outside phpBB After Log In/Out
if (!empty($HTTP_POST_VARS['redirect']) || !empty($HTTP_GET_VARS['redirect']))
{
$url = (!empty($HTTP_POST_VARS['redirect'])) ? htmlspecialchars($HTTP_POST_VARS['redirect']) : htmlspecialchars($HTTP_GET_VARS['redirect']);
$url = str_replace('&', '&', $url);
redirect(append_sid($url, true));
}
*/
//---------------------------------------------------------------------------------
// Redirect Outside phpBB After Log In/Out - Begin Code Addition
//
if (!empty($_REQUEST['redirect']) )
{
$url = htmlspecialchars(addslashes($_REQUEST['redirect']));
$url = str_replace('&', '&', $url);
$outside = ( !empty($_REQUEST['outside']) ) ? true : false;
redirect(append_sid($url, true), $outside);
}
//
// Redirect Outside phpBB After Log In/Out - End Code Addition
//---------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$s_hidden_fields = '<input type="hidden" name="redirect" value="' . $forward_page . '" />';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//---------------------------------------------------------------------------------
// Redirect Outside phpBB After Log In/Out - Begin Code Addition
//
if( isset($_REQUEST['outside']) )
{
$outside = ( !empty($_REQUEST['outside']) ) ? true: false;
$s_hidden_fields .= '<input type="hidden" name="outside" value="' . $outside . '" />';
}
//
// Redirect Outside phpBB After Log In/Out - End Code Addition
//---------------------------------------------------------------------------------
Open 4images/includes/sessions.php
#
#-----[ FIND ]------------------------------------------
$url_logout = $url_app."login.php?logout=true";
#
#-----[REPLACE WITH]------------------------------------------
$url_logout = $url_app."login.php?logout=true&redirect=../index.php&outside=1";
note you will have to edit ../index.php so it points to the site you want.
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#