Blame Extras/phpBB/3.0.4/includes/ucp/ucp_confirm.php

4c79b5
4c79b5
/**
4c79b5
*
4c79b5
* @package VC
4c79b5
* @version $Id: ucp_confirm.php 8655 2008-06-13 19:39:01Z acydburn $
4c79b5
* @copyright (c) 2005 phpBB Group
4c79b5
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
4c79b5
*
4c79b5
*/
4c79b5
4c79b5
/**
4c79b5
* @ignore
4c79b5
*/
4c79b5
if (!defined('IN_PHPBB'))
4c79b5
{
4c79b5
	exit;
4c79b5
}
4c79b5
4c79b5
/**
4c79b5
* ucp_confirm
4c79b5
* Visual confirmation
4c79b5
*
4c79b5
* Note to potential users of this code ...
4c79b5
*
4c79b5
* Remember this is released under the _GPL_ and is subject
4c79b5
* to that licence. Do not incorporate this within software
4c79b5
* released or distributed in any way under a licence other
4c79b5
* than the GPL. We will be watching ... ;)
4c79b5
*
4c79b5
* @package VC
4c79b5
*/
4c79b5
class ucp_confirm
4c79b5
{
4c79b5
	var $u_action;
4c79b5
4c79b5
	function main($id, $mode)
4c79b5
	{
4c79b5
		global $db, $user, $phpbb_root_path, $config, $phpEx;
4c79b5
4c79b5
		// Do we have an id? No, then just exit
4c79b5
		$confirm_id = request_var('id', '');
4c79b5
		$type = request_var('type', 0);
4c79b5
4c79b5
		if (!$confirm_id || !$type)
4c79b5
		{
4c79b5
			exit;
4c79b5
		}
4c79b5
4c79b5
		// Try and grab code for this id and session
4c79b5
		$sql = 'SELECT code, seed
4c79b5
			FROM ' . CONFIRM_TABLE . "
4c79b5
			WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
4c79b5
				AND confirm_id = '" . $db->sql_escape($confirm_id) . "'
4c79b5
				AND confirm_type = $type";
4c79b5
		$result = $db->sql_query($sql);
4c79b5
		$row = $db->sql_fetchrow($result);
4c79b5
		$db->sql_freeresult($result);
4c79b5
4c79b5
		// If we have a row then grab data else create a new id
4c79b5
		if (!$row)
4c79b5
		{
4c79b5
			exit;
4c79b5
		}
4c79b5
4c79b5
		if ($config['captcha_gd'])
4c79b5
		{
4c79b5
			include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
4c79b5
		}
4c79b5
		else
4c79b5
		{
4c79b5
			include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
4c79b5
		}
4c79b5
4c79b5
		$captcha = new captcha();
4c79b5
		$captcha->execute($row['code'], $row['seed']);
4c79b5
4c79b5
		garbage_collection();
4c79b5
		exit_handler();
4c79b5
	}
4c79b5
}
4c79b5
4c79b5
?>