issue 46 validator apply to member module.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8533 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-06-23 06:03:29 +00:00
parent c9e03ed1a4
commit 525d8e3f5f
17 changed files with 151 additions and 32 deletions

View file

@ -188,7 +188,7 @@
$buff = preg_replace_callback('!<\!--%load_js_plugin\(\"([^\"]*?)\"\)-->!is', array($this, '_compileLoadJavascriptPlugin'), $buff);
// form auto generation
$buff = preg_replace_callback('/(<form[^>].*?>)(.*?)(<\/form>)/is', array($this, '_compileFormAuthGeneration'), $buff);
$buff = preg_replace_callback('/(<form(?:<\?php.+?\?>|[^<>]+)*?>)(.*?)(<\/form>)/is', array($this, '_compileFormAuthGeneration'), $buff);
// replace variables
$buff = preg_replace_callback('/\{[^@^ ]([^\{\}\n]+)\}/i', array($this, '_compileVarToContext'), $buff);

View file

@ -34,8 +34,8 @@
<action name="getMemberMenu" type="model" standalone="true" />
<action name="getMemberAdminColorset" type="model" standalone="true" />
<action name="procMemberLogin" type="controller" standalone="true" />
<action name="procMemberOpenIDLogin" type="controller" standalone="true" />
<action name="procMemberLogin" type="controller" standalone="true" ruleset="login" />
<action name="procMemberOpenIDLogin" type="controller" standalone="true" ruleset="openidLogin" />
<action name="procMemberOpenIDValidate" type="controller" standalone="true" />
<action name="procModuleSiteSignUp" type="controller" standalone="true" />
<action name="procModuleSiteLeave" type="controller" standalone="true" />
@ -44,10 +44,10 @@
<action name="procMemberDeleteOpenIDFromMember" type="controller" standalone="true" />
<action name="procMemberLogout" type="controller" standalone="true" />
<action name="procMemberCheckValue" type="controller" standalone="true" />
<action name="procMemberInsert" type="controller" standalone="true" />
<action name="procMemberModifyInfo" type="controller" standalone="true" />
<action name="procMemberModifyPassword" type="controller" standalone="true" />
<action name="procMemberLeave" type="controller" standalone="true" />
<action name="procMemberInsert" type="controller" standalone="true" ruleset="signup" />
<action name="procMemberModifyInfo" type="controller" standalone="true" ruleset="modifyInfo" />
<action name="procMemberModifyPassword" type="controller" standalone="true" ruleset="modifyPassword" />
<action name="procMemberLeave" type="controller" standalone="true" ruleset="leaveMember" />
<action name="procMemberOpenIDLeave" type="controller" standalone="true" />
<action name="procMemberInsertProfileImage" type="controller" standalone="true" ruleset="insertProfileImage" />
<action name="procMemberInsertImageName" type="controller" standalone="true" ruleset="insertImageName" />
@ -65,7 +65,7 @@
<action name="procMemberFindAccountByQuestion" type="controller" standalone="true" />
<action name="procMemberAuthAccount" type="controller" standalone="true" />
<action name="procMemberUpdateAuthMail" type="controller" standalone="true" />
<action name="procMemberResendAuthMail" type="controller" standalone="true" />
<action name="procMemberResendAuthMail" type="controller" standalone="true" ruleset="resendAuthMail" />
<action name="procMemberAdminInsert" type="controller" standalone="true" ruleset="insert" />
<action name="procMemberAdminDelete" type="controller" standalone="true" />

View file

@ -481,9 +481,10 @@
if ($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
// Extract the necessary information in advance
$args = Context::gets('user_id','user_name','nick_name','homepage','blog','birthday','email_address','password','allow_mailing','find_account_question','find_account_answer');
$args = Context::gets('user_id','user_name','nick_name','homepage','blog','birthday','email_address','password','password1','allow_mailing','find_account_question','find_account_answer');
$args->member_srl = getNextSequence();
$args->list_order = -1 * $args->member_srl;
if($args->password1) $args->password = $args->password1;
// Remove some unnecessary variables from all the vars
$all_args = Context::getRequestVars();
@ -528,6 +529,12 @@
// Call a trigger (after)
$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
if(!$trigger_output->toBool()) return $trigger_output;
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
header('location:'.$returnUrl);
return;
}
}
/**
@ -573,6 +580,11 @@
// Return result
$this->add('member_srl', $args->member_srl);
$this->setMessage('success_updated');
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberInfo');
header('location:'.$returnUrl);
return;
}
}
/**
@ -582,7 +594,7 @@
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
// Extract the necessary information in advance
$current_password = trim(Context::get('current_password'));
$password = trim(Context::get('password'));
$password = trim(Context::get('password1'));
// Get information of logged-in user
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl;
@ -605,6 +617,11 @@
$this->add('member_srl', $args->member_srl);
$this->setMessage('success_updated');
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberInfo');
header('location:'.$returnUrl);
return;
}
}
/**
@ -635,6 +652,11 @@
$this->destroySessionInfo();
// Return success message
$this->setMessage('success_leaved');
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
header('location:'.$returnUrl);
return;
}
}
/**
@ -677,7 +699,12 @@
$this->insertProfileImage($member_srl, $file['tmp_name']);
// Page refresh
$this->setRefreshPage();
//$this->setRefreshPage();
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
header('location:'.$returnUrl);
return;
}
}
function insertProfileImage($member_srl, $target_file) {
@ -723,7 +750,12 @@
$this->insertImageName($member_srl, $file['tmp_name']);
// Page refresh
$this->setRefreshPage();
//$this->setRefreshPage();
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
header('location:'.$returnUrl);
return;
}
}
function insertImageName($member_srl, $target_file) {
@ -812,7 +844,12 @@
$this->insertImageMark($member_srl, $file['tmp_name']);
// Page refresh
$this->setRefreshPage();
//$this->setRefreshPage();
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
header('location:'.$returnUrl);
return;
}
}
function insertImageMark($member_srl, $target_file) {
@ -1108,6 +1145,11 @@
$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
$this->setMessage($msg);
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
header('location:'.$returnUrl);
return;
}
}
/**

View file

@ -180,8 +180,9 @@
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
// Get the saved document(module_srl is set to member_srl instead)
$logged_info = Context::get('logged_info');
$args->module_srl = $logged_info->member_srl;
$args->member_srl = $logged_info->member_srl;
$args->page = (int)Context::get('page');
$args->statusList = array('TEMP');
$oDocumentModel = &getModel('document');
$output = $oDocumentModel->getDocumentList($args, true);

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="password" required="true" length=":20" />
</fields>
</ruleset>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="user_id" required="true" rule="userid" />
<field name="password" required="true" />
</fields>
</ruleset>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="user_name" required="true" length="2:40" />
<field name="nick_name" required="true" length="2:40" />
<field name="email_address" required="true" length="1:200" rule="email" />
<field name="find_account_question" required="true" />
<field name="find_account_answer" required="true" length=":250" />
</fields>
</ruleset>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="current_password" required="true" length="1:50" />
<field name="password1" required="true" length="6:20" />
<field name="password2" required="true" length="6:20" equalto="password1" />
</fields>
</ruleset>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="openid" required="true" />
<field name="referer_url" required="true" />
</fields>
</ruleset>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="email_address" required="true" length="1:200" rule="email" />
</fields>
</ruleset>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="user_id" required="true" length="3:20" />
<field name="password1" required="true" length="6:20" />
<field name="password2" required="true" length="6:20" equalto="password1" />
<field name="user_name" required="true" length="2:40" />
<field name="nick_name" required="true" length="2:40" />
<field name="email_address" required="true" length="1:200" rule="email" />
<field name="find_account_question" required="true" />
<field name="find_account_answer" required="true" length=":250" />
</fields>
</ruleset>

View file

@ -1,9 +1,9 @@
<!--#include("./common_header.html")-->
<!--%import("filter/leave_member.xml")-->
<h3>{$member_title = $lang->msg_leave_member}</h3>
<form id="fo_insert_member" action="./" method="get" onsubmit="return procFilter(this, leave_member)">
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="leaveMember" id="fo_insert_member" action="./" method="post">
<input type="hidden" name="act" value="procMemberLeave" />
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="document_srl" value="{$document_srl}" />
<input type="hidden" name="page" value="{$page}" />

View file

@ -1,5 +1,4 @@
<!--#include("./common_header.html")-->
<!--%import("filter/login.xml")-->
<!--%import("filter/openid_login.xml")-->
<script type="text/javascript">
@ -8,11 +7,13 @@
</script>
<!-- XE 로그인 폼 -->
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<div class="memberSmallBox">
<div class="header">{$lang->cmd_login}</div>
<form action="./" method="post" onsubmit="return procFilter(this, login)" id="fo_member_login">
<form ruleset="login" action="./" method="post" id="fo_member_login">
<input type="hidden" name="act" value="procMemberLogin" />
<fieldset class="login">
<dl>
<dt><label for="uid">{$lang->user_id}</label></dt>
@ -45,7 +46,9 @@
<div class="header">{$lang->openid}</div>
<form action="{getUrl('module','member','act','procMemberOpenIDLogin')}" method="post" onsubmit="return procFilter(this, openid_login)">
<form ruleset="openidLogin" action="./" method="post">
<input type="hidden" name="module" value="member" />
<input type="hidden" name="act" value="procMemberOpenIDLogin" />
<fieldset class="login">
<dl>
<dt><label for="open_uid">{$lang->user_id}</label></dt>

View file

@ -1,7 +1,6 @@
<!--#include("./common_header.html")-->
<!--%import("../../tpl/js/signup_check.js")-->
<!--%import("filter/modify_info.xml")-->
<!--@if($member_config->profile_image == 'Y')-->
<!--%import("filter/delete_profile_image.xml")-->
<!--@end-->
@ -25,8 +24,9 @@
<h3>{$lang->msg_update_member}</h3>
<form id="fo_insert_member" action="{getUrl()}" method="post" onsubmit="return procFilter(this, modify_info)" <!--@if($member_config->profile_image == 'Y' || $member_config->image_name=='Y' || $member_config->image_mark=='Y')-->enctype="multipart/form-data"<!--@end--> target="tmp_upload_iframe">
<input type="hidden" name="act" value="" />
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="modifyInfo" id="fo_insert_member" action="{getUrl()}" method="post" <!--@if($member_config->profile_image == 'Y' || $member_config->image_name=='Y' || $member_config->image_mark=='Y')-->enctype="multipart/form-data"<!--@end-->>
<input type="hidden" name="act" value="procMemberModifyInfo" />
<input type="hidden" name="module" value="member" />
<input type="hidden" name="member_srl" value="{$member_info->member_srl}" />
<input type="hidden" name="signature" value="{htmlspecialchars($member_info->signature)}" />
@ -78,7 +78,7 @@
<div class="memberImage">
<div class="form"><input type="file" name="profile_image" value="" /></div>
<a href="#" onclick="doUploadProfileImage();return false;" class="button"><span>{$lang->cmd_registration}</span></a>
<button type="submit" name="act" value="procMemberInsertProfileImage">{$lang->cmd_registration}</button>
</div>
<p>{$lang->profile_image_max_width} : {$member_config->profile_image_max_width}px, {$lang->profile_image_max_height} : {$member_config->profile_image_max_height}px</p>
</td>
@ -97,7 +97,7 @@
<div class="memberImage">
<div class="form"><input type="file" name="image_name" value="" /></div>
<a href="#" onclick="doUploadImageName();return false;" class="button"><span>{$lang->cmd_registration}</span></a>
<button type="submit" name="act" value="procMemberInsertImageName">{$lang->cmd_registration}</button>
</div>
<p>{$lang->image_name_max_width} : {$member_config->image_name_max_width}px, {$lang->image_name_max_height} : {$member_config->image_name_max_height}px</p>
</td>
@ -116,7 +116,7 @@
<div class="memberImage">
<div class="form"><input type="file" name="image_mark" value="" /></div>
<a href="#" onclick="doUploadImageMark();return false;" class="button"><span>{$lang->cmd_registration}</span></a>
<button type="submit" name="act" value="procMemberInsertImageMark">{$lang->cmd_registration}</button>
</div>
<p>{$lang->image_mark_max_width} : {$member_config->image_mark_max_width}px, {$lang->image_mark_max_height} : {$member_config->image_mark_max_height}px</p>
</td>

View file

@ -1,7 +1,7 @@
<!--#include("./common_header.html")-->
<!--%import("filter/modify_password.xml")-->
<h3>{$member_title = $lang->cmd_modify_member_password}</h3>
<form id="fo_insert_member" action="./" method="get" onsubmit="return procFilter(this, modify_password)">
<form ruleset="modifyPassword" id="fo_insert_member" action="./" method="post">
<input type="hidden" name="act" value="procMemberModifyPassword" />
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="document_srl" value="{$document_srl}" />
<input type="hidden" name="page" value="{$page}" />

View file

@ -1,9 +1,10 @@
<!--%import("filter/resend_auth_mail.xml")-->
<!--%import("css/default.css")-->
<!--%import("js/member.js")-->
<div id="memberModule">
<form action="./" method="post" onsubmit="return procFilter(this, resend_auth_mail)">
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="resendAuthMail" action="./" method="post">
<input type="hidden" name="act" value="procMemberResendAuthMail" />
<h3>{$lang->cmd_resend_auth_mail}</h3>
<div class="infoText">{$lang->about_resend_auth_mail}</div>
<table cellspacing="0" class="rowTable">

View file

@ -1,5 +1,4 @@
<!--%import("../../tpl/js/signup_check.js")-->
<!--%import("filter/signup.xml")-->
<!--// datepicker javascript plugin load -->
<!--%load_js_plugin("ui")-->
@ -9,7 +8,9 @@
<h3>{$lang->cmd_signup}</h3>
<form id="fo_insert_member" action="./" method="get" onsubmit="return procFilter(this, signup)">
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="signup" id="fo_insert_member" action="./" method="post">
<input type="hidden" name="act" value="procMemberInsert" />
<!--@if(!$is_logged && $member_config->agreement)-->
<div class="agreementBox">