<?php

(!defined('IN_PowerBB')) ? die() : '';

$CALL_SYSTEM				=	array();
$CALL_SYSTEM['REQUEST'] 	= 	true;

include('common.php');

define('CLASS_NAME','PowerBBCReqMOD');

class PowerBBCReqMOD
{
	function run()
	{
		global $PowerBB;

		if ($PowerBB->_GET['index'])
		{
			$this->_Index();
		}
		else
		{
			$PowerBB->functions->error($PowerBB->_CONF['template']['lang']['path_not_true']);
		}

		$PowerBB->functions->GetFooter();
	}

	function _Index()
	{
		global $PowerBB;

		// Show header with page title
		$PowerBB->functions->ShowHeader($PowerBB->_CONF['template']['lang']['Cancel_request']);

		$PowerBB->functions->AddressBar($PowerBB->_CONF['template']['lang']['Cancel_request']);

		if (empty($PowerBB->_GET['type'])
			or empty($PowerBB->_GET['code']))
		{
			$PowerBB->functions->error($PowerBB->_CONF['template']['lang']['Sorry_url_not_true']);
		}

        $DelArr				=	array();
        $DelArr['where'] 	= 	array('random_url',$PowerBB->_GET['code']);

		$CleanReq = $PowerBB->request->DeleteRequest($DelArr);

		if ($CleanReq)
		{
			$PowerBB->functions->msg($PowerBB->_CONF['template']['lang']['Was_Cancel_request_successfully']);
			$PowerBB->functions->redirect('index.php');
		}
	}
}

?>
