<?php
/*
 * content/upload/Excute.class.php
 * 
 * CopyRight(C) 2010 Shopformer Development Team. All Right Reserved
 * URL: http://sourceforge.jp/projects/shopformer/
 * 
 * 
 * Mail: m_nakashima@users.sourceforge.jp
 * Auther: Masanori Nakashima
 * Last Update: 2010-06-18
 */
require_once( dirname(dirname(dirname(__FILE__)))
	.DIRECTORY_SEPARATOR.'system'
	.DIRECTORY_SEPARATOR.'login'
	.DIRECTORY_SEPARATOR.'ModuleBase.class.php');
require_once( dirname(dirname(dirname(__FILE__)))
	.DIRECTORY_SEPARATOR.'system'
	.DIRECTORY_SEPARATOR.'DataFileWriter.class.php');
require_once( dirname(dirname(dirname(__FILE__)))
	.DIRECTORY_SEPARATOR.'util'
	.DIRECTORY_SEPARATOR.'File.class.php');
require_once( dirname(dirname(__FILE__))
	.DIRECTORY_SEPARATOR.'Uploader.class.php' );
require_once( dirname(dirname(__FILE__))
	. DIRECTORY_SEPARATOR.'package_define.inc.php' );
class content_upload_Execute extends system_login_ModuleBase {
	
	function content_upload_Execute() {
	}
	function execute( & $request ) {

		$sessionObjectName		= 'content.upload.uploader';
		$sessionConfirmName		= 'content.upload.confirm';
		$contentUploader		= $request->getSession($sessionObjectName);

		if( is_object($contentUploader) && 'content_uploader' == strtolower(get_class($contentUploader)) ) {
			$contentUploader->uploadExecute( $request );
		} else {
			$request->addLocaledError('system.error.common.session.timeout',SPIDER_LOG_LEVEL_ERROR,array());
		}
				
		$request->removeSession($sessionObjectName);
		$request->removeSession($sessionConfirmName);
		$request->setAttribute('content.upload.uploaderObject',$contentUploader);
	}
}
?>