Skip to content

Commit

Permalink
#541 회원가입 후 인증 제한일에 대한 고지
Browse files Browse the repository at this point in the history
  • Loading branch information
akasima committed Apr 8, 2014
1 parent 807b48a commit f99c25e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
6 changes: 6 additions & 0 deletions modules/member/lang/lang.xml
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,12 @@
<value xml:lang="tr"><![CDATA[Geçici Zaman Sınırı]]></value>
<value xml:lang="vi"><![CDATA[Hạn sử dụng]]></value>
</item>
<item name="limit_day_description">
<value xml:lang="ko"><![CDATA[임시 제한 일자 설명]]></value>
<value xml:lang="en"><![CDATA[Description for Temporary Limit Date]]></value>
<value xml:lang="jp"><![CDATA[一時的な期限日の説明]]></value>
</item>

<item name="limit_date">
<value xml:lang="ko"><![CDATA[제한일]]></value>
<value xml:lang="en"><![CDATA[Limit Date]]></value>
Expand Down
1 change: 1 addition & 0 deletions modules/member/member.admin.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public function procMemberAdminInsertSignupConfig()

$args = Context::gets(
'limit_day',
'limit_day_description',
'agreement',
'redirect_url',
'profile_image', 'profile_image_max_width', 'profile_image_max_height',
Expand Down
12 changes: 9 additions & 3 deletions modules/member/member.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,16 @@ function procMemberInsert()
{
if($config->identifier == 'email_address')
{
$this->doLogin($args->email_address);
$output = $this->doLogin($args->email_address);
}
else
{
$this->doLogin($args->user_id);
$output = $this->doLogin($args->user_id);
}
if(!$output->toBool()) {
if($output->error == -9)
$output->error = -11;
return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
}
}

Expand All @@ -385,6 +390,7 @@ function procMemberInsert()
{
$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
$this->setMessage($msg);
return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
}
else $this->setMessage('success_registed');
// Call a trigger (after)
Expand Down Expand Up @@ -1729,7 +1735,7 @@ function doLogin($user_id, $password = '', $keep_signed = false)
return new Object(-1,'msg_user_denied');
}
// Notify if denied_date is less than the current time
if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-1,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
// Update the latest login time
$args->member_srl = $this->memberInfo->member_srl;
$output = executeQuery('member.updateLastLogin', $args);
Expand Down
11 changes: 10 additions & 1 deletion modules/member/member.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,17 @@ function dispMemberLoginForm()
$config = $this->member_config;
Context::set('identifier', $config->identifier);

$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
if($XE_VALIDATOR_ERROR == -11)
Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);

if($XE_VALIDATOR_ERROR < -10)
Context::set('referer_url', '/');
else
Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));

// Set a template file
Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
$this->setTemplateFile('login_form');
}

Expand Down
6 changes: 3 additions & 3 deletions modules/member/skins/default/login_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<h1><i class="icon-user"></i> {$lang->cmd_login}</h1>
</div>
<div class="login-body">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/skin/default/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/skins'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="@login" action="./" method="post" id="fo_member_login">
<form ruleset="@login" action="{getUrl('')}" method="post" id="fo_member_login">
<input type="hidden" name="success_return_url" value="{$referer_url}" />
<input type="hidden" name="act" value="procMemberLogin" />
<input type="hidden" name="xe_validator_id" value="modules/member/skin/default/1" />
<input type="hidden" name="xe_validator_id" value="modules/member/skins" />
<fieldset>
<div class="control-group">
<input type="text" cond="$identifier == 'user_id'" name="user_id" id="uid" required placeholder="{$lang->user_id}" title="{$lang->user_id}" />
Expand Down
4 changes: 2 additions & 2 deletions modules/member/skins/default/signup_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<!--%load_js_plugin("ui.datepicker")-->
<include target="./common_header.html" />
<h1 style="border-bottom:1px solid #ccc">{$lang->cmd_signup}</h1>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/skins/default/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/member/skins'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="@insertMember" id="fo_insert_member" action="./" method="post" enctype="multipart/form-data" class="form-horizontal">
<input type="hidden" name="act" value="procMemberInsert" />
<input type="hidden" name="xe_validator_id" value="modules/member/skins/default/1" />
<input type="hidden" name="xe_validator_id" value="modules/member/skins" />
<input type="hidden" name="success_return_url" value="{getUrl('act','dispMemberInfo')}" />
<div class="agreement" cond="$member_config->agreement">
<div class="text">
Expand Down
1 change: 1 addition & 0 deletions modules/member/tpl/signup_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<div class="x_controls">
<input type="number" min="0" id="limit_day" name="limit_day" value="{$config->limit_day}" /> {$lang->unit_day}
<p class="x_help-block">{$lang->about_limit_day}</p>
<input type="text" name="limit_day_description" value="{$config->limit_day_description}" placeholder="{$lang->limit_day_description}" style="width:90%" class="lang_code" />
</div>
</div>
<div class="x_control-group">
Expand Down

0 comments on commit f99c25e

Please sign in to comment.