Customize password reset email for v2 method

This commit is contained in:
Kijin Sung 2023-11-28 22:40:47 +09:00
parent c4a9da23b0
commit 2ce8b5812b
3 changed files with 17 additions and 5 deletions

View file

@ -165,6 +165,7 @@ $lang->msg_checked_file_is_deleted = '%d attached file(s) is(are) deleted.';
$lang->msg_find_account_title = 'Account Info';
$lang->msg_find_account_info = 'This is requested account info.';
$lang->msg_find_account_comment = 'Your password will be changed to the one above if you click the link below.<br />Please change the password again as soon as possible after you are able to log in.<br />Your password will remain unchanged until you click the link below.';
$lang->msg_find_account_comment_v2 = 'Click the link below to set a new password for your account, even if you don\'t remember your current password.';
$lang->msg_confirm_account_title = 'Rhymix Account Activation';
$lang->title_modify_email_address = 'This letter is sent for a confirmation of the changing e-mail address.';
$lang->msg_confirm_account_info = 'This is your account information:';
@ -384,7 +385,6 @@ $lang->spammer_move_to_trash = 'Move to trash';
$lang->msg_spammer_complete = 'Completed.';
$lang->nick_name_before_changing = 'Old nickname';
$lang->nick_name_after_changing = 'New nickname';
$lang->cmd_login_browser_info = 'Browser Information';
$lang->cmd_login_device_info = 'Device Information';
$lang->cmd_initial_registration = 'Registered';
@ -397,3 +397,4 @@ $lang->scrap_folder_rename = 'Rename';
$lang->scrap_folder_delete = 'Delete';
$lang->member_unauthenticated = 'Unauthenticated';
$lang->member_number = 'Member identification number';
$lang->msg_change_after_click = 'Change after clicking link below';

View file

@ -167,6 +167,7 @@ $lang->msg_checked_file_is_deleted = '%d개의 첨부 파일이 삭제되었습
$lang->msg_find_account_title = '아이디/비밀번호 정보입니다.';
$lang->msg_find_account_info = '요청한 계정 정보는 아래와 같습니다.';
$lang->msg_find_account_comment = '아래 링크를 클릭하면 위에 적힌 비밀번호로 변경됩니다.<br />로그인 후 다른 비밀번호로 변경해 주시기 바랍니다.<br />링크를 클릭하지 않으면 비밀번호가 변경되지 않습니다.';
$lang->msg_find_account_comment_v2 = '아래의 링크를 클릭하면 현재 비밀번호를 모르더라도 새로운 비밀번호로 변경할 수 있습니다.';
$lang->msg_confirm_account_title = '가입 인증 메일입니다.';
$lang->title_modify_email_address = '이메일주소 변경 요청 확인 메일입니다.';
$lang->msg_confirm_account_info = '가입한 계정 정보는 아래와 같습니다.';
@ -400,3 +401,4 @@ $lang->scrap_folder_rename = '이름 변경';
$lang->scrap_folder_delete = '삭제';
$lang->member_unauthenticated = '미인증';
$lang->member_number = '회원 번호';
$lang->msg_change_after_click = '아래 링크 클릭 후 변경 가능';

View file

@ -1664,23 +1664,32 @@ class MemberController extends Member
if($output->toBool() && $output->data->count != '0') throw new Rhymix\Framework\Exception('msg_user_not_confirmed');
}
// Get password reset method
$member_config = ModuleModel::getModuleConfig('member');
$password_reset_method = intval($member_config->password_reset_method ?? 1);
// Insert data into the authentication DB
$args = new stdClass();
$args->user_id = $member_info->user_id;
$args->member_srl = $member_info->member_srl;
$args->new_password = Rhymix\Framework\Password::getRandomPassword(8);
$args->new_password = $password_reset_method == 2 ? '' : Rhymix\Framework\Password::getRandomPassword(8);
$args->auth_key = Rhymix\Framework\Security::getRandom(40, 'hex');
$args->auth_type = 'password_v1';
$args->auth_type = 'password_v' . $password_reset_method;
$args->is_register = 'N';
$output = executeQuery('member.insertAuthMail', $args);
if(!$output->toBool()) return $output;
// Get content of the email to send a member
global $lang;
if ($password_reset_method == 2)
{
$args->new_password = lang('member.msg_change_after_click');
$lang->set('msg_find_account_comment', lang('member.msg_find_account_comment_v2'));
}
Context::set('auth_args', $args);
$member_config = ModuleModel::getModuleConfig('member');
$memberInfo = array();
global $lang;
if(is_array($member_config->signupForm))
{
$exceptForm=array('password', 'find_account_question');