<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="./contrib/xsl/modx.prosilver.en.xsl"?>
<!-- 
	NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.
-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Prime Logout Return</title>
		<description lang="en">Returns a user to the page they were at prior to logging out, unless they were in the Admin Control Panel, Moderator Control Panel, or User Control Panel.</description>
		<author-notes lang="en">Creating, maintaining, and updating MODs requires a lot of time and effort, so if you like this MOD and have the desire to express your thanks through donations, that would be greatly appreciated. My Paypal ID is primehalo@gmail.com, or contact me for my mailing address. The suggested donation amount for this MOD is $1.00 (but any amount will help).</author-notes>
		<author-group>
			<author>
				<realname>Ken F. Innes IV</realname>
				<email>primehalo@gmail.com</email>
				<username>primehalo</username>
				<homepage><![CDATA[http://www.absoluteanime.com/admin/mods.htm#logout_return]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.1</mod-version>
		<installation>
			<level>easy</level>
			<time>120</time>
			<target-version>3.0.7-PL1</target-version>
		</installation>
		<history>
			<entry>
				<date>2009-08-17</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-04-29</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en">
					<change>Display a link to the previous page during the intermediate information screen.</change>
				</changelog>
			</entry>
		</history>
	</header>
	<action-group>
		<open src="includes/functions.php">
			<edit>
				<find><![CDATA[		$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id);]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Logout Return -----------------------------------------------//
		$redirect = (defined('ADMIN_START') || $user->page['page_name'] == "ucp.$phpEx" || $user->page['page_name'] == "mcp.$phpEx") ? '' : '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url(array('_f_'))));
		$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout' . $redirect, true, $user->session_id);
//-- end: Prime Logout Return -----------------------------------------------//]]></action>
			</edit>
		</open>
		<open src="ucp.php">
			<edit>
				<find><![CDATA[		meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));

		$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Logout Return -----------------------------------------------//
		if (($redirect = request_var('redirect', '')) != '')
		{
			meta_refresh(3, append_sid($redirect));
			$message = $message . (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? '' : '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . append_sid($redirect) . '">', '</a> '));
		}
		else
//-- end: Prime Logout Return -----------------------------------------------//]]></action>
			</edit>
		</open>
	</action-group>
</mod>

