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

This commit is contained in:
zero 2007-03-05 03:11:44 +00:00
parent 30127ae3e6
commit ea69a65507
5 changed files with 13 additions and 9 deletions

View file

@ -164,7 +164,7 @@
$output = $this->_executeInsertAct($tables, $column, $pass_quotes); $output = $this->_executeInsertAct($tables, $column, $pass_quotes);
break; break;
case 'update' : case 'update' :
$output = $this->_executeUpdateAct($tables, $column, $condition, $pass_quotes); $output = $this->_executeUpdateAct($tables, $column, $args, $condition, $pass_quotes);
break; break;
case 'delete' : case 'delete' :
$output = $this->_executeDeleteAct($tables, $condition, $pass_quotes); $output = $this->_executeDeleteAct($tables, $condition, $pass_quotes);

View file

@ -287,10 +287,12 @@
/** /**
* @brief updateAct 처리 * @brief updateAct 처리
**/ **/
function _executeUpdateAct($tables, $column, $condition, $pass_quotes) { function _executeUpdateAct($tables, $column, $args, $condition, $pass_quotes) {
$table = array_pop($tables); $table = array_pop($tables);
foreach($column as $key => $val) { foreach($column as $key => $val) {
// args에 아예 해당 key가 없으면 패스
if(!isset($args->{$key})) continue;
if(in_array($key, $pass_quotes)) $update_list[] = sprintf('`%s` = %s', $key, $this->addQuotes($val)); if(in_array($key, $pass_quotes)) $update_list[] = sprintf('`%s` = %s', $key, $this->addQuotes($val));
else $update_list[] = sprintf('`%s` = \'%s\'', $key, $this->addQuotes($val)); else $update_list[] = sprintf('`%s` = \'%s\'', $key, $this->addQuotes($val));
} }
@ -300,7 +302,8 @@
if($condition) $condition = ' where '.$condition; if($condition) $condition = ' where '.$condition;
$query = sprintf("update `%s%s` set %s %s;", $this->prefix, $table, $update_query, $condition); $query = sprintf("update `%s%s` set %s %s;", $this->prefix, $table, $update_query, $condition);
return $this->_query($query);
return $this->_query($query);
} }
/** /**

View file

@ -18,7 +18,7 @@
/** /**
* @brief debug mode = true 일때 files/_debug_message.php 디버그 내용이 쌓임 * @brief debug mode = true 일때 files/_debug_message.php 디버그 내용이 쌓임
**/ **/
define('__DEBUG__', true); define('__DEBUG__', false);
if(__DEBUG__) { if(__DEBUG__) {
// php5이상이면 error handling을 handleError() 로 set // php5이상이면 error handling을 handleError() 로 set

View file

@ -104,6 +104,7 @@
if(!$output->toBool()) return $output; if(!$output->toBool()) return $output;
$this->add('member_srl', $args->member_srl);
$this->setMessage($msg_code); $this->setMessage($msg_code);
} }
@ -353,9 +354,9 @@
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
// 필수 변수들의 조절 // 필수 변수들의 조절
if($args->allow_mailing!='Y') $args->is_default = 'N'; if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
if($args->denied!='Y') $args->denied = 'N'; if(!$args->denied) unset($args->denied);
if($args->is_admin!='Y') $args->use_category = 'N'; if(!$args->is_admin) unset($args->is_admin);
list($args->email_id, $args->email_host) = explode('@', $args->email_address); list($args->email_id, $args->email_host) = explode('@', $args->email_address);
// 아이디, 닉네임, email address 의 중복 체크 // 아이디, 닉네임, email address 의 중복 체크

View file

@ -14,8 +14,8 @@
<column name="profile_image" var="profile_image" /> <column name="profile_image" var="profile_image" />
<column name="signature" var="signature" /> <column name="signature" var="signature" />
<column name="allow_mailing" var="allow_mailing" default="Y" /> <column name="allow_mailing" var="allow_mailing" default="Y" />
<column name="denied" var="denied" default="N" /> <column name="denied" var="denied" />
<column name="is_admin" var="is_admin" default="N" /> <column name="is_admin" var="is_admin" />
<column name="description" var="description" /> <column name="description" var="description" />
<column name="extra_vars" var="extra_vars" /> <column name="extra_vars" var="extra_vars" />
</columns> </columns>