git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4380 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2008-07-17 03:39:34 +00:00
parent 42cb1bcfaa
commit 97728fcb2c
4 changed files with 161 additions and 0 deletions

View file

@ -0,0 +1,3 @@
<?php
$lang->cache_cleaner = '캐시파일 재생성';
?>

65
tools/form.html Normal file
View file

@ -0,0 +1,65 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Generator" content="XE" />
<title>XE Tools</title>
{@ $js_files = Context::getJsFile() }
<!--@foreach($js_files as $key => $js_file)-->
<!--@if($js_file['targetie'])-->
<!--[if {$js_file['targetie']}]>
<!--@end-->
<script type="text/javascript" src="{$js_file['file']}"></script>
<!--@if($js_file['targetie'])-->
<![endif]-->
<!--@end-->
<!--@end-->
{@ $css_files = Context::getCssFile() }
<!--@foreach($css_files as $key => $css_file)-->
<!--@if($css_file['targetie'])-->
<!--[if {$css_file['targetie']}]>
<!--@end-->
<link rel="stylesheet" href="{$css_file['file']}" type="text/css" charset="UTF-8" media="{$css_file['media']}" />
<!--@if($css_file['targetie'])-->
<![endif]-->
<!--@end-->
<!--@end-->
<link rel="stylesheet" href="./style.css" type="text/css" charset="UTF-8" media="all" />
</head>
<body>
<h1>XE Tools</h1>
<hr />
<!--@if($msg)-->
<blockquote class="message">{$msg}</blockquote>
<!--@end-->
<form action="./index.php" method="post">
<div class="tools">
<code>
<!--@foreach($tools as $key => $title)-->
<label for="title_{$key}"><input type="radio" name="tool" value="{$key}" id="title_{$key}" <!--@if($key==$tool)-->checked="checked"<!--@end--> /> {$title}</label>
<!--@end-->
</code>
</div>
<div class="auth">
<code>
<label for="db_id">{$lang->db_userid}</label>
<input type="text" id="db_id" name="id" value="{$id}" />
</code>
<code>
<label for="db_pw">{$lang->db_password}</label>
<input type="password" id="db_pw" name="pw" value="" />
</code>
<input type="submit" value="{$lang->cmd_input}" class="submit"/>
</div>
</form>
<!--@if($output)-->
<blockquote class="output">{$output}</blockquote>
<!--@end-->
</body>
</html>

66
tools/index.php Normal file
View file

@ -0,0 +1,66 @@
<?php
/**
* @file tools/index.php
* @author zero <zero@zeroboard.com>
* @brief 각종 tools 목록을 보여주기 인증 시도
**/
/**
* @brief 기본적인 상수 선언, 웹에서 직접 호출되는 것을 막기 위해 체크하는 상수 선언
**/
define('__ZBXE__', true);
/**
* @brief 필요한 설정 파일들을 include
**/
require_once('../config/config.inc.php');
// id/ password/ tool 구함
$id = $_POST['id'];
$pw = $_POST['pw'];
$tool = $_POST['tool'];
// 저장되어 있는 비밀번호와 비교
$oContext = &Context::getInstance();
$oContext->init();
$db_info = $oContext->getDBInfo();
// 툴 목록을 구하고 언어파일 로그, 변수 설정
Context::loadLang(_XE_PATH_.'modules/install/lang');
$list = FileHandler::readDir(_XE_PATH_.'tools/');
$filters = array('index.php','style.css','form.html');
for($i=0;$i<count($list);$i++) {
if(in_array($list[$i], $filters)) continue;
Context::loadLang(_XE_PATH_.'tools/'.$list[$i].'/lang');
$tools[$list[$i]] = Context::getLang($list[$i]);
}
Context::set('tools', $tools);
// 설치가 되어 있지 않을 경우
if(!Context::isInstalled()) {
$msg = Context::getLang('msg_db_not_setted');
// 인증 정보가 없을 경우
} elseif(!isset($id) || !isset($pw)) {
// 입력된 정보와 저장된 정보 비교
} else if($id !== $db_info->db_userid || $pw !== $db_info->db_password) {
if(!$tool) $msg = Context::getLang('msg_not_founded');
elseif($id !== $db_info->db_userid) $msg = sprintf($lang->filter->equalto, Context::getLang('user_id'));
else $msg = sprintf($lang->filter->equalto, Context::getLang('password'));
// tool 실행
} else if($id === $db_info->db_userid && $pw === $db_info->db_password) {
define('__XE_TOOL_AUTH__', true);
include(_XE_PATH_.'tools/'.$tool.'/'.$tool.'.php');
}
Context::set('msg', $msg);
$oTemplate = &TemplateHandler::getInstance();
print $oTemplate->compile('./tools','form');
?>

27
tools/style.css Normal file
View file

@ -0,0 +1,27 @@
body { margin:10px !important; }
h1 { font-size:1.5em; font-family:tahoma; margin:0; padding:0; }
hr { border:none; border-top:1px solid #555555; border-bottom:1px solid #888888; margin:0; margin-bottom:10px; padding:0; }
blockquote.message { border:2px solid red; color:red; margin:0 0 10px 0; padding:10px; font-size:9pt; font-weight:bold; clear:both; }
blockquote.output { border:2px solid blue; margin:10px 0 0 0; padding:10px; font-size:9pt; font-weight:bold; clear:both; }
form { margin:0; padding:0; clear:both; overflow:hidden; }
div.tools { float:left; margin-right:20px; padding-right:20px; border-right:1px dotted #AAAAAA; }
div.tools code label { display:block; white-space:nowrap; margin-bottom:5px; font-size:9pt; }
div.tools code label input { display:inline; }
div.auth { float:left; }
div.auth code label { font-size:9pt; }
div.auth code { display:block; clear:both; margin-bottom:10px;}
div.auth code label { float:left; display:block; width:100px; }
div.auth code input { display:block; width:150px; border:1px solid #AAAAAA; }
div.auth input.submit { width:252px; border:1px solid #AAAAAA;}
div.back { font-size:9pt; text-align:right; margin-bottom:10px; }
div.back a { text-decoration:none; color:#888888; }
table { width:100%; border:none; font-size:9pt; background-color:#CCCCCC; }
table thead th { background-color:#EFEFEF; padding:3px 0 3px 0; }
table tbody th { background-color:#F3F3F3; vertical-align:top; color:#888888; padding:3px 0 3px 0; }
table tbody td { background-color:#FFFFFF; font-family:verdana; padding:3px; }