mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
Add option to disallow symbols in nickname #886
This commit is contained in:
parent
f07b971e1e
commit
750045d095
5 changed files with 60 additions and 0 deletions
|
|
@ -125,6 +125,9 @@ $lang->cmd_member_list = 'Member List';
|
||||||
$lang->cmd_module_config = 'Default Setting';
|
$lang->cmd_module_config = 'Default Setting';
|
||||||
$lang->cmd_member_group = 'Member Groups';
|
$lang->cmd_member_group = 'Member Groups';
|
||||||
$lang->cmd_send_mail = 'Send Mail';
|
$lang->cmd_send_mail = 'Send Mail';
|
||||||
|
$lang->cmd_modify_nickname_log = 'Nickname Change Log';
|
||||||
|
$lang->cmd_nickname_symbols = 'Allow Symbols in Nickname';
|
||||||
|
$lang->cmd_nickname_symbols_list = 'Only Allow:';
|
||||||
$lang->cmd_manage_id = 'Prohibited IDs';
|
$lang->cmd_manage_id = 'Prohibited IDs';
|
||||||
$lang->cmd_manage_email_host = 'E-mail provider check';
|
$lang->cmd_manage_email_host = 'E-mail provider check';
|
||||||
$lang->cmd_manage_nick_name = 'Prohibited NickNames';
|
$lang->cmd_manage_nick_name = 'Prohibited NickNames';
|
||||||
|
|
@ -268,6 +271,7 @@ $lang->msg_feature_deprecated = 'This feature is deprecated.';
|
||||||
$lang->msg_question_not_allowed = 'The administrator has disabled this function.';
|
$lang->msg_question_not_allowed = 'The administrator has disabled this function.';
|
||||||
$lang->msg_question_not_exists = 'You haven`t set your question for a temporary password.';
|
$lang->msg_question_not_exists = 'You haven`t set your question for a temporary password.';
|
||||||
$lang->msg_answer_not_matches = 'Your answer for the question is not correct.';
|
$lang->msg_answer_not_matches = 'Your answer for the question is not correct.';
|
||||||
|
$lang->msg_invalid_symbol_in_nickname = 'Your nickname contains a disallowed symbol, \'%s\'.';
|
||||||
$lang->change_password_date = 'Password renewal cycle';
|
$lang->change_password_date = 'Password renewal cycle';
|
||||||
$lang->about_change_password_date = 'If you set a value to this, you will be notified to change your password periodically. (If set to 0, disabled)';
|
$lang->about_change_password_date = 'If you set a value to this, you will be notified to change your password periodically. (If set to 0, disabled)';
|
||||||
$lang->msg_change_password_date = 'You have not changed the password during %s days. For personal information protection, you need to change the password.';
|
$lang->msg_change_password_date = 'You have not changed the password during %s days. For personal information protection, you need to change the password.';
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,8 @@ $lang->cmd_view_scrapped_document = '스크랩 보기';
|
||||||
$lang->cmd_view_saved_document = '저장함 보기';
|
$lang->cmd_view_saved_document = '저장함 보기';
|
||||||
$lang->cmd_send_email = '메일 보내기';
|
$lang->cmd_send_email = '메일 보내기';
|
||||||
$lang->cmd_modify_nickname_log = '닉네임 변경 기록';
|
$lang->cmd_modify_nickname_log = '닉네임 변경 기록';
|
||||||
|
$lang->cmd_nickname_symbols = '닉네임에 특수문자 허용';
|
||||||
|
$lang->cmd_nickname_symbols_list = '다음의 문자만 허용:';
|
||||||
$lang->cmd_member_profile_view = '회원 프로필사진 보이기';
|
$lang->cmd_member_profile_view = '회원 프로필사진 보이기';
|
||||||
$lang->cmd_allow_duplicate_nickname = '닉네임 중복 허용';
|
$lang->cmd_allow_duplicate_nickname = '닉네임 중복 허용';
|
||||||
$lang->about_allow_duplicate_nickname = '여러 회원이 동일한 닉네임을 사용하는 것을 허용합니다. 주의: 잘못 사용할 경우 혼란이 발생할 수 있습니다.';
|
$lang->about_allow_duplicate_nickname = '여러 회원이 동일한 닉네임을 사용하는 것을 허용합니다. 주의: 잘못 사용할 경우 혼란이 발생할 수 있습니다.';
|
||||||
|
|
@ -258,6 +260,7 @@ $lang->about_reset_auth_mail = '현재등록된 이메일 주소는 %s입니다.
|
||||||
$lang->about_resend_auth_mail = '가입 인증 메일을 받지 못한 경우 다시 받을 수 있습니다.';
|
$lang->about_resend_auth_mail = '가입 인증 메일을 받지 못한 경우 다시 받을 수 있습니다.';
|
||||||
$lang->about_reset_auth_mail_submit = '이메일을 로그인 계정으로 사용할 경우 신규 메일주소로 로그인해야 합니다.';
|
$lang->about_reset_auth_mail_submit = '이메일을 로그인 계정으로 사용할 경우 신규 메일주소로 로그인해야 합니다.';
|
||||||
$lang->about_update_nickname_log = '닉네임 로그를 기록합니다. 이 옵션을 사용하게 되면, 닉네임변경이력을 남기도록 할 수 있습니다.';
|
$lang->about_update_nickname_log = '닉네임 로그를 기록합니다. 이 옵션을 사용하게 되면, 닉네임변경이력을 남기도록 할 수 있습니다.';
|
||||||
|
$lang->about_nickname_symbols = '닉네임에 특수문자를 사용할 수 있도록 허용하거나 금지합니다.';
|
||||||
$lang->about_member_profile_view = '관리자 회원목록 페이지에서 프로필 이미지를 볼 수 있는 옵션입니다. 회원목록을 보기 원치 않을 경우에는 아니요를 선택하세요.';
|
$lang->about_member_profile_view = '관리자 회원목록 페이지에서 프로필 이미지를 볼 수 있는 옵션입니다. 회원목록을 보기 원치 않을 경우에는 아니요를 선택하세요.';
|
||||||
$lang->no_article = '글이 없습니다.';
|
$lang->no_article = '글이 없습니다.';
|
||||||
$lang->find_account_question = '비밀번호 찾기 질문/답변';
|
$lang->find_account_question = '비밀번호 찾기 질문/답변';
|
||||||
|
|
@ -282,6 +285,7 @@ $lang->msg_feature_deprecated = '지원되지 않는 기능입니다.';
|
||||||
$lang->msg_question_not_allowed = '질문/답변을 통한 비밀번호 찾기 기능은 이 사이트에서 사용할 수 없습니다.';
|
$lang->msg_question_not_allowed = '질문/답변을 통한 비밀번호 찾기 기능은 이 사이트에서 사용할 수 없습니다.';
|
||||||
$lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.';
|
$lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.';
|
||||||
$lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.';
|
$lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.';
|
||||||
|
$lang->msg_invalid_symbol_in_nickname = '닉네임에 사용할 수 없는 특수문자 \'%s\'가 포함되어 있습니다.';
|
||||||
$lang->change_password_date = '비밀번호 갱신주기';
|
$lang->change_password_date = '비밀번호 갱신주기';
|
||||||
$lang->about_change_password_date = '일정 기간이 지나면 비밀번호를 변경하도록 유도하는 기능입니다. 사용하지 않으려면 0을 입력하십시오.';
|
$lang->about_change_password_date = '일정 기간이 지나면 비밀번호를 변경하도록 유도하는 기능입니다. 사용하지 않으려면 0을 입력하십시오.';
|
||||||
$lang->msg_change_password_date = '%s일 동안 비밀번호를 변경하지 않았습니다. 개인정보 보호를 위하여 비밀번호를 변경해야 합니다.';
|
$lang->msg_change_password_date = '%s일 동안 비밀번호를 변경하지 않았습니다. 개인정보 보호를 위하여 비밀번호를 변경해야 합니다.';
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,8 @@ class memberAdminController extends member
|
||||||
'password_hashing_auto_upgrade',
|
'password_hashing_auto_upgrade',
|
||||||
'password_change_invalidate_other_sessions',
|
'password_change_invalidate_other_sessions',
|
||||||
'update_nickname_log',
|
'update_nickname_log',
|
||||||
|
'nickname_symbols',
|
||||||
|
'nickname_symbols_allowed_list',
|
||||||
'allow_duplicate_nickname',
|
'allow_duplicate_nickname',
|
||||||
'member_profile_view'
|
'member_profile_view'
|
||||||
);
|
);
|
||||||
|
|
@ -242,6 +244,12 @@ class memberAdminController extends member
|
||||||
{
|
{
|
||||||
$args->password_hashing_auto_upgrade = 'N';
|
$args->password_hashing_auto_upgrade = 'N';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!in_array($args->nickname_symbols, ['Y', 'N', 'LIST']))
|
||||||
|
{
|
||||||
|
$args->nickname_symbols = 'Y';
|
||||||
|
}
|
||||||
|
$args->nickname_symbols_allowed_list = utf8_trim($args->nickname_symbols_allowed_list);
|
||||||
|
|
||||||
$oModuleController = getController('module');
|
$oModuleController = getController('module');
|
||||||
$output = $oModuleController->updateModuleConfig('member', $args);
|
$output = $oModuleController->updateModuleConfig('member', $args);
|
||||||
|
|
|
||||||
|
|
@ -746,6 +746,23 @@ class memberController extends member
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check symbols in nickname
|
||||||
|
if($config->nickname_symbols === 'N')
|
||||||
|
{
|
||||||
|
if(preg_match('/[^\pL\d]/u', $args->nick_name, $matches))
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception(sprintf(lang('msg_invalid_symbol_in_nickname'), escape($matches[0])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif($config->nickname_symbols === 'LIST')
|
||||||
|
{
|
||||||
|
$list = preg_quote($config->nickname_symbols_allowed_list, '/');
|
||||||
|
if(preg_match('/[^\pL\d' . $list . ']/u', $args->nick_name, $matches))
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception(sprintf(lang('msg_invalid_symbol_in_nickname'), escape($matches[0])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Insert member info
|
// Insert member info
|
||||||
$output = $this->insertMember($args);
|
$output = $this->insertMember($args);
|
||||||
if($output instanceof BaseObject && !$output->toBool())
|
if($output instanceof BaseObject && !$output->toBool())
|
||||||
|
|
@ -1044,6 +1061,23 @@ class memberController extends member
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check symbols in nickname
|
||||||
|
if($config->nickname_symbols === 'N')
|
||||||
|
{
|
||||||
|
if(preg_match('/[^\pL\d]/u', $args->nick_name, $matches))
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception(sprintf(lang('msg_invalid_symbol_in_nickname'), escape($matches[0])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif($config->nickname_symbols === 'LIST')
|
||||||
|
{
|
||||||
|
$list = preg_quote($config->nickname_symbols_allowed_list, '/');
|
||||||
|
if(preg_match('/[^\pL\d' . $list . ']/u', $args->nick_name, $matches))
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception(sprintf(lang('msg_invalid_symbol_in_nickname'), escape($matches[0])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Execute insert or update depending on the value of member_srl
|
// Execute insert or update depending on the value of member_srl
|
||||||
$output = $this->updateMember($args);
|
$output = $this->updateMember($args);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,16 @@
|
||||||
<p class="x_help-block">{$lang->about_update_nickname_log}</p>
|
<p class="x_help-block">{$lang->about_update_nickname_log}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<div class="x_control-label">{$lang->cmd_nickname_symbols}</div>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label class="x_inline" for="nickname_symbols_yes"><input type="radio" name="nickname_symbols" id="nickname_symbols_yes" value="Y" checked="checked"|cond="$config->nickname_symbols == 'Y' || !isset($config->nickname_symbols)" /> {$lang->cmd_yes}</label>
|
||||||
|
<label class="x_inline" for="nickname_symbols_no"><input type="radio" name="nickname_symbols" id="nickname_symbols_no" value="N" checked="checked"|cond="$config->nickname_symbols == 'N'"/> {$lang->cmd_no}</label>
|
||||||
|
<label class="x_inline" for="nickname_symbols_list"><input type="radio" name="nickname_symbols" id="nickname_symbols_list" value="LIST" checked="checked"|cond="$config->nickname_symbols == 'LIST'"/> {$lang->cmd_nickname_symbols_list}</label>
|
||||||
|
<input type="text" name="nickname_symbols_allowed_list" value="{$config->nickname_symbols_allowed_list ?: ''}" />
|
||||||
|
<p class="x_help-block">{$lang->about_nickname_symbols}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="x_control-group" style="display:none"|cond="$config->allow_duplicate_nickname != 'Y'">
|
<div class="x_control-group" style="display:none"|cond="$config->allow_duplicate_nickname != 'Y'">
|
||||||
<div class="x_control-label">{$lang->cmd_allow_duplicate_nickname}</div>
|
<div class="x_control-label">{$lang->cmd_allow_duplicate_nickname}</div>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue