<?php
/**
@brief パーミッション投稿時の確認 & CSRF ガード
@author minahito
@version $Id: perm_confirm.php,v 1.1 2004/08/05 07:12:19 minahito Exp $
*/

$xoopsOption['nocommon']=true;
include_once "../../../mainfile.php";
require_once XOOPS_ROOT_PATH."/modules/exFrame/frameloader.php";
require_once "../class/global.php";

// Form を読み込む
include_once "exComponent/Preview.php";

// Session からの復元に必要
require_once "exForm/PermForm.php";
require_once XOOPS_ROOT_PATH."/kernel/group.php";

// 使用するコンポーネント
require_once "exComponent/confirm/TypicalConfirm.php";	// コンポーネント本体
require_once "exComponent/confirm/render/PermConfirmModelRender.php";	// Perm 用レンダー
require_once "exComponent/confirm/processor/PermTypicalConfirmUpdateProcessor.php";	// Perm 用プロセッサー

// フォワードコンフィグ
require_once "exConfig/ForwardConfig.php";

// session_start
include_once XOOPS_ROOT_PATH."/include/common.php";
include XOOPS_ROOT_PATH."/include/cp_header.php";


$editform=&Session::postPop('edit_perm');

$forwards = array ( new exSuccessForwardConfig(EXFORWARD_REDIRECT,"perm.php",_MD_A_BXPARTY_DB_SUCCESS),
				new exFailForwardConfig(EXFORWARD_REDIRECT,"perm.php",_MD_A_BXPARTY_DB_FAIL));

$compo = new exTypicalConfirmComponent( new PermTypicalConfirmUpdateProcessor(),
	new exPermConfirmComponentModelRender(),
	'edit_perm', new exBeanConfirmTicketForm(), $forwards );

switch($ret=$compo->init($editform)) {
	case COMPONENT_INIT_FAIL:
		xoops_cp_header();
		xoops_error("FATAL ERROR");
		xoops_cp_footer();
		break;

	default:
		xoops_cp_header();
		$compo->display();
		xoops_cp_footer();
		break;
}

?>