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

This commit is contained in:
zero 2007-04-05 03:20:14 +00:00
parent 2577bb60b7
commit 49582a9e09
3 changed files with 87 additions and 10 deletions

View file

@ -114,7 +114,7 @@
**/
function addQuotes($string) {
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = $this->handler->quote("'","''", $string);
if(!is_numeric($string)) $string = str_replace("'","''", $string);
return $string;
}
@ -135,11 +135,11 @@
try {
$result = $this->handler->query($query);
return $result;
} catch (PDOException $e) {
$this->setError($e->getCode(), $e->getMessage());
return;
return false;
}
return $result;
}
/**
@ -175,9 +175,10 @@
* @brief 테이블 기생성 여부 return
**/
function isTableExists($target_name) {
$query = sprintf('pragma table_info(%s%s)', $this->prefix, $this->addQuotes($target_name));
$result = $this->handler->query($query);
if(count($result)==0) return false;
$query = sprintf('pragma table_info(%s%s)', $this->prefix, $target_name);
$stmt = $this->handler->prepare($query);
$result = $stmt->execute($query);
if(!$result) return false;
return true;
}
@ -231,7 +232,7 @@
$auto_increment = $column->attrs->auto_increment;
if($auto_increment) {
$column_schema[] = sprintf('%s %s PRIMARY KEY %s',
$column_schema[] = sprintf('%s %s %s',
$name,
$this->column_type[$type],
$auto_increment?'AUTOINCREMENT':''
@ -252,7 +253,7 @@
else if($index) $index_list[$index][] = $name;
}
$schema = sprintf('CREATE TABLE %s (%s%s) ;', $this->addQuotes($table_name)," ", implode($column_schema,", "));
$schema = sprintf('CREATE TABLE %s (%s%s) ;', $table_name," ", implode($column_schema,", "));
$output = $this->_query($schema);
if(!$output) return false;
@ -318,7 +319,7 @@
$prepare_list[] = '?';
}
$query = sprintf("INSERT INTO %s%s (%s) VALUES (%s);", $this->prefix, $table, implode(',',$prepare_list));
$query = sprintf("INSERT INTO %s%s (%s) VALUES (%s);", $this->prefix, $table, implode(',',$key_list), implode(',',$prepare_list));
$stmt = $this->handler->prepare($query);
$val_count = count($val_list);
@ -338,7 +339,6 @@
if(in_array($key, $pass_quotes)) $update_list[] = sprintf('%s = ?', $key, $this->addQuotes($val));
$val_list[] = $this->addQuotes($val);
}
}
if(!count($update_list)) return;

View file

@ -1,4 +1,5 @@
<?php
ob_start();
/**
* @file index.php
* @author zero (zero@zeroboard.com)
@ -47,4 +48,6 @@
$oModuleHandler->init();
$oModule = &$oModuleHandler->procModule();
$oModuleHandler->displayContent($oModule);
debugPrint(ob_get_contents());
ob_end_flush();
?>

View file

@ -0,0 +1,74 @@
<!--%import("filter/sqlite2.xml")-->
<form action="./" method="post" onsubmit="return procFilter(this, install)">
<input type="hidden" name="db_type" value="{$db_type}" />
<table border="1">
<tr>
<td colspan="2">
{$lang->db_title}
</td>
</tr>
<tr>
<td rowspan="2">{$lang->db_database_file}</td>
<td>
<input type="text" name="db_database_file" value="./files/zeroboard_xe.sqlite" />
</td>
</tr>
<tr>
<td>{$lang->about_database_file}</td>
</tr>
<tr>
<td>{$lang->db_table_prefix}</td>
<td>
<input type="text" name="db_table_prefix" value="xe" />
</td>
</tr>
</table>
<table border="1">
<tr>
<td colspan="2">
{$lang->admin_title}
</td>
</tr>
<tr>
<td>{$lang->user_id}</td>
<td>
<input type="text" name="user_id" value="zero" />
</td>
</tr>
<tr>
<td>{$lang->password1}</td>
<td>
<input type="password" name="password1" value="1234" />
</td>
</tr>
<tr>
<td>{$lang->password2}</td>
<td>
<input type="password" name="password2" value="1234" />
</td>
</tr>
<tr>
<td>{$lang->user_name}</td>
<td>
<input type="text" name="user_name" value="zero" />
</td>
</tr>
<tr>
<td>{$lang->nick_name}</td>
<td>
<input type="text" name="nick_name" value="zero" />
</td>
</tr>
<tr>
<td>{$lang->email_address}</td>
<td>
<input type="text" name="email_address" value="zero@nzeo.com" />
</td>
</tr>
</table>
<input type="submit" value="{$lang->cmd_registration}" />
</form>