<?php
/*
 * system/install/precheck.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
 *
 * Created on 2010/03/02
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
require_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'DataFileWriter.class.php');
if( !system_DataFileWriter::isExists( $GLOBALS['request_object'], '/default/admin_default.tpl', DIR_NAME_TEMPLATES ) ) {
	$dirPath	= dirname(__FILE__).DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'default';
	system_DataFileWriter::importDir( $GLOBALS['request_object'], '/default', $dirPath, DIR_NAME_TEMPLATES );
	if( SPIDER_URI_APP === '/checkinstall.php' ) {
	} else if( !file_exists(DIR_PATH_DATA.DIRECTORY_SEPARATOR.'system.define.inc.php') ) {
		require_once(dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'util'.DIRECTORY_SEPARATOR.'CharUtility.class.php');
		if( preg_match('/^'.util_CharUtility::escapeRegxStr('/'.SYSTEM_DIR_NAME_ADMIN_PANEL).'/',SPIDER_URI_REQUEST) == 0 ) {
			header('Location: '.SPIDER_URI_BASE.SYSTEM_DIR_NAME_ADMIN_PANEL);
		}
	}
}
?>