mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add a special phone number and verification code that can bypass SMS auth (for testing)
This commit is contained in:
parent
4c79d1b229
commit
f12bfb0ba5
5 changed files with 30 additions and 2 deletions
|
|
@ -62,6 +62,7 @@ $lang->member_limited = 'Limited';
|
|||
$lang->limit_day = 'Temporary Limit Date';
|
||||
$lang->limit_day_description = 'Description for Temporary Limit Date';
|
||||
$lang->limit_date = 'Limit Date';
|
||||
$lang->cmd_special_phone_number = 'Verification code exception';
|
||||
$lang->after_login_url = 'URL to redirect after Sign in';
|
||||
$lang->after_logout_url = 'URL to redirect after Sign out';
|
||||
$lang->redirect_url = 'URL to redirect after Sign up';
|
||||
|
|
@ -75,6 +76,7 @@ $lang->allow_message_type['F'] = 'Allow for Friends only';
|
|||
$lang->allow_message_type['N'] = 'Reject All';
|
||||
$lang->about_allow_message = 'You may allow or reject messages.';
|
||||
$lang->verify_by_sms = 'Verify';
|
||||
$lang->verify_by_sms_code = 'Verification code';
|
||||
$lang->verify_by_sms_confirm = 'Confirm';
|
||||
$lang->verify_by_sms_message = 'Your verification code is %s.';
|
||||
$lang->verify_by_sms_code_sent = 'A verification code has been sent to the number you entered.';
|
||||
|
|
@ -143,6 +145,7 @@ $lang->cmd_view_saved_document = 'Saved Articles';
|
|||
$lang->cmd_send_email = 'Send Mail';
|
||||
$lang->cmd_allow_duplicate_nickname = 'Allow Duplicate Nicknames';
|
||||
$lang->about_allow_duplicate_nickname = 'Allow more than one member to use the same nickname.';
|
||||
$lang->msg_special_code_incorrect_format = 'The verification code must be a 6-digit number.';
|
||||
$lang->msg_email_not_exists = 'You have entered an invalid email address.';
|
||||
$lang->msg_alreay_scrapped = 'This article is already scrapped.';
|
||||
$lang->msg_folder_alreay_exists = 'A folder with the same name already exists.';
|
||||
|
|
@ -235,6 +238,7 @@ $lang->about_enable_find_account_question = 'Check if you want to allow members
|
|||
$lang->about_enable_ssl = 'Personal information from Sign up/Modify Member Info/Sign in can be sent as SSL(https) mode if server provides SSL service.';
|
||||
$lang->about_limit_day = 'You can limit activation date after sign up';
|
||||
$lang->about_limit_date = 'Users cannot sign in until the specified date';
|
||||
$lang->about_special_phone_number = 'You can set up a special phone number that can be verified with a preconfigured code instead of sending an actual SMS.<br>This can be useful for development, testing, and app store review process.';
|
||||
$lang->about_after_login_url = 'You can set a URL after login. Blank means the current page.';
|
||||
$lang->about_after_logout_url = 'You can set a URL after logout. Blank means the current page.';
|
||||
$lang->about_redirect_url = 'Please select a page where users will go after sign up. When this is empty, it will be set as the previous page of the sign up page.';
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ $lang->member_limited = '임시 제한';
|
|||
$lang->limit_day = '임시 제한 일자';
|
||||
$lang->limit_day_description = '임시 제한 일자 설명';
|
||||
$lang->limit_date = '제한일';
|
||||
$lang->cmd_special_phone_number = '문자 인증 예외 전화번호';
|
||||
$lang->after_login_url = '로그인 후 이동할 주소(URL)';
|
||||
$lang->after_logout_url = '로그아웃 후 이동할 주소(URL)';
|
||||
$lang->redirect_url = '회원 가입 후 이동할 페이지';
|
||||
|
|
@ -75,6 +76,7 @@ $lang->allow_message_type['F'] = '등록된 친구들만 허용';
|
|||
$lang->allow_message_type['N'] = '모두 금지';
|
||||
$lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다.';
|
||||
$lang->verify_by_sms = '인증';
|
||||
$lang->verify_by_sms_code = '인증 코드';
|
||||
$lang->verify_by_sms_confirm = '인증번호 확인';
|
||||
$lang->verify_by_sms_message = '인증번호는 %s입니다.';
|
||||
$lang->verify_by_sms_code_sent = '인증번호가 SMS로 발송되었습니다.';
|
||||
|
|
@ -146,6 +148,7 @@ $lang->cmd_nickname_symbols_list = '다음의 문자만 허용:';
|
|||
$lang->cmd_member_profile_view = '회원 프로필사진 보이기';
|
||||
$lang->cmd_allow_duplicate_nickname = '닉네임 중복 허용';
|
||||
$lang->about_allow_duplicate_nickname = '여러 회원이 동일한 닉네임을 사용하는 것을 허용합니다. 주의: 잘못 사용할 경우 혼란이 발생할 수 있습니다.';
|
||||
$lang->msg_special_code_incorrect_format = '문자 인증 예외 코드는 6자리 숫자여야 합니다.';
|
||||
$lang->msg_email_not_exists = '이메일 주소가 존재하지 않습니다.';
|
||||
$lang->msg_alreay_scrapped = '이미 스크랩된 게시물입니다.';
|
||||
$lang->msg_folder_alreay_exists = '이미 존재하는 폴더 이름입니다.';
|
||||
|
|
@ -242,6 +245,7 @@ $lang->about_enable_find_account_question = '질문/답변을 통한 비밀번
|
|||
$lang->about_enable_ssl = '서버에서 보안접속(SSL) 지원이 될 경우 회원가입, 정보수정, 로그인 등의 개인정보가 서버로 보내질 때 SSL(https)을 이용하도록 할 수 있습니다.';
|
||||
$lang->about_limit_day = '회원 가입 후 정해진 일자동안 인증 제한을 할 수 있습니다.';
|
||||
$lang->about_limit_date = '지정한 날짜까지 로그인을 할 수 없습니다.';
|
||||
$lang->about_special_phone_number = '문자를 실제 발송하지 않고 미리 설정한 코드를 입력하여 인증을 통과할 수 있는 전화번호를 설정합니다.<br>개발 및 테스트 과정, 앱스토어 등록 심사 등에 활용할 수 있습니다.';
|
||||
$lang->about_after_login_url = '로그인 후 이동할 URL을 정할 수 있습니다. 입력하지 않으면 로그인 전의 페이지로 돌아갑니다.';
|
||||
$lang->about_after_logout_url = '로그아웃 후 이동할 URL을 정할 수 있습니다. 입력하지 않으면 로그아웃 전의 페이지로 돌아갑니다.';
|
||||
$lang->about_redirect_url = '회원 가입 후 이동할 페이지를 선택해 주세요. 선택된 페이지가 없는 경우 이전 페이지로 돌아갑니다.';
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ class memberAdminController extends member
|
|||
'limit_day',
|
||||
'limit_day_description',
|
||||
'emailhost_check',
|
||||
'redirect_url',
|
||||
'special_phone_number', 'special_phone_code', 'redirect_url',
|
||||
'phone_number_default_country', 'phone_number_hide_country', 'phone_number_allow_duplicate', 'phone_number_verify_by_sms',
|
||||
'profile_image', 'profile_image_max_width', 'profile_image_max_height', 'profile_image_max_filesize',
|
||||
'image_name', 'image_name_max_width', 'image_name_max_height', 'image_name_max_filesize',
|
||||
|
|
@ -365,6 +365,12 @@ class memberAdminController extends member
|
|||
$args->limit_day = (int)$args->limit_day;
|
||||
if($args->emailhost_check != 'allowed' && $args->emailhost_check != 'prohibited') $args->emailhost_check == 'allowed';
|
||||
|
||||
$args->special_phone_number = preg_replace('/[^0-9]/', '', $args->special_phone_number);
|
||||
$args->special_phone_code = preg_replace('/[^0-9]/', '', $args->special_phone_code);
|
||||
if ($args->special_phone_code !== '' && strlen($args->special_phone_code) !== 6)
|
||||
{
|
||||
return new BaseObject('-1', 'msg_special_code_incorrect_format');
|
||||
}
|
||||
if($args->redirect_url)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
|
|||
|
|
@ -3579,14 +3579,20 @@ class memberController extends member
|
|||
return new BaseObject(-1, 'msg_invalid_phone_number');
|
||||
}
|
||||
|
||||
$is_special = ($config->special_phone_number && $config->special_phone_number === preg_replace('/[^0-9]/', '', $phone_number));
|
||||
$code = intval(mt_rand(100000, 999999));
|
||||
$_SESSION['verify_by_sms'] = array(
|
||||
'country' => $phone_country,
|
||||
'number' => $phone_number,
|
||||
'code' => $code,
|
||||
'code' => $is_special ? intval($config->special_phone_code) : $code,
|
||||
'status' => false,
|
||||
);
|
||||
|
||||
if ($is_special)
|
||||
{
|
||||
return new BaseObject(0, 'verify_by_sms_code_sent');
|
||||
}
|
||||
|
||||
$sms = new Rhymix\Framework\SMS;
|
||||
$sms->addTo($phone_number, $phone_country_calling_code);
|
||||
$content = '[' . Context::get('site_module_info')->settings->title . '] ' . sprintf(lang('member.verify_by_sms_message'), $code);
|
||||
|
|
|
|||
|
|
@ -64,6 +64,14 @@
|
|||
<p class="x_help-inline">{$lang->multi_line_input}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="redirect_url">{$lang->cmd_special_phone_number}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="special_phone_number" value="{$config->special_phone_number}" placeholder="{$lang->phone_number}" />
|
||||
<input type="text" name="special_phone_code" value="{$config->special_phone_code}" placeholder="{$lang->verify_by_sms_code}" />
|
||||
<p class="x_help-block">{$lang->about_special_phone_number}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="redirect_url">{$lang->redirect_url}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue