mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
Add phone number to signup form (disabled by default)
This commit is contained in:
parent
09819b107e
commit
c2e08338d0
7 changed files with 81 additions and 19 deletions
|
|
@ -94,6 +94,7 @@ $lang->writer = 'Author';
|
|||
$lang->user_name = 'User Name';
|
||||
$lang->nick_name = 'Nick Name';
|
||||
$lang->email_address = 'Email';
|
||||
$lang->phone_number = 'Phone Number';
|
||||
$lang->homepage = 'Homepage';
|
||||
$lang->blog = 'Blog';
|
||||
$lang->birthday = 'Birthday';
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ $lang->writer = '글쓴이';
|
|||
$lang->user_name = '이름';
|
||||
$lang->nick_name = '닉네임';
|
||||
$lang->email_address = '이메일 주소';
|
||||
$lang->phone_number = '전화번호';
|
||||
$lang->homepage = '홈페이지';
|
||||
$lang->blog = '블로그';
|
||||
$lang->birthday = '생일';
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ $lang->about_webmaster_email = 'This setting can be changed in the <a href="inde
|
|||
$lang->retroactive_application = 'retroact';
|
||||
$lang->signature_html_retroact = 'also remove HTML in past inseted HTML signature. Can not be reversed.';
|
||||
$lang->search_target_list['email_address'] = 'Email Address';
|
||||
$lang->search_target_list['email_address'] = 'Phone Number';
|
||||
$lang->search_target_list['regdate'] = 'Sign up Date';
|
||||
$lang->search_target_list['regdate_more'] = 'Sign up Date (more)';
|
||||
$lang->search_target_list['regdate_less'] = 'Sign up Date (less)';
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ $lang->about_webmaster_email = '이 설정은 <a href="index.php?module=admin&ac
|
|||
$lang->retroactive_application = '소급적용';
|
||||
$lang->signature_html_retroact = '이전에 입력된 HTML 서명에서도 HTML을 제거 합니다. 되돌릴 수 없습니다.';
|
||||
$lang->search_target_list['email_address'] = '이메일';
|
||||
$lang->search_target_list['phone_number'] = '전화번호';
|
||||
$lang->search_target_list['regdate'] = '가입일시';
|
||||
$lang->search_target_list['regdate_more'] = '가입일시(이상)';
|
||||
$lang->search_target_list['regdate_less'] = '가입일시(이하)';
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ class memberAdminController extends member
|
|||
global $lang;
|
||||
$signupForm = array();
|
||||
$items = array(
|
||||
'user_id', 'password', 'user_name', 'nick_name', 'email_address', 'homepage', 'blog', 'birthday', 'signature',
|
||||
'user_id', 'password', 'user_name', 'nick_name', 'email_address', 'phone_number', 'homepage', 'blog', 'birthday', 'signature',
|
||||
'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',
|
||||
'image_mark', 'image_mark_max_width', 'image_mark_max_height', 'image_mark_max_filesize',
|
||||
|
|
@ -486,7 +486,7 @@ class memberAdminController extends member
|
|||
// Get join form list which is additionally set
|
||||
$extendItems = $oMemberModel->getJoinFormList();
|
||||
|
||||
$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
|
||||
$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'phone_number', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
|
||||
$mustRequireds = array('email_address', 'nick_name', 'password');
|
||||
$orgRequireds = array('email_address', 'password', 'user_id', 'nick_name', 'user_name');
|
||||
$orgUse = array('email_address', 'password', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
|
||||
|
|
@ -504,7 +504,7 @@ class memberAdminController extends member
|
|||
$signupItem->required = in_array($key, $orgRequireds);
|
||||
$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
|
||||
$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
|
||||
if(in_array($key, array('find_account_question', 'password', 'email_address')))
|
||||
if(in_array($key, array('find_account_question', 'password', 'email_address', 'phone_number')))
|
||||
{
|
||||
$signupItem->isPublic = 'N';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,10 +218,11 @@ class member extends ModuleObject {
|
|||
// Check scrap folder table
|
||||
if(!$oDB->isColumnExists("member_scrap", "folder_srl")) return true;
|
||||
|
||||
// Check signup form
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
// check signup form ordering info
|
||||
if(!$config->signupForm || !is_array($config->signupForm)) return true;
|
||||
$phone_found = false;
|
||||
foreach($config->signupForm as $signupItem)
|
||||
{
|
||||
if($signupItem->name === 'find_account_question')
|
||||
|
|
@ -232,12 +233,23 @@ class member extends ModuleObject {
|
|||
{
|
||||
return true;
|
||||
}
|
||||
if($signupItem->name === 'phone_number')
|
||||
{
|
||||
$phone_found = true;
|
||||
}
|
||||
}
|
||||
if(!$phone_found)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check agreements
|
||||
if(!$config->agreements)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check skin
|
||||
if($config->skin)
|
||||
{
|
||||
$config_parse = explode('.', $config->skin);
|
||||
|
|
@ -389,40 +401,86 @@ class member extends ModuleObject {
|
|||
$oDB->addIndex("member_scrap","idx_folder_srl", array("folder_srl"));
|
||||
}
|
||||
|
||||
// Check signup form
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
$oModuleController = getController('module');
|
||||
|
||||
$oMemberAdminController = getAdminController('member');
|
||||
// check signup form ordering info
|
||||
if(!$config->identifier)
|
||||
{
|
||||
$config->identifier = 'email_address';
|
||||
}
|
||||
if(!$config->signupForm || !is_array($config->signupForm))
|
||||
{
|
||||
$config->identifier = 'user_id';
|
||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
||||
$config->signupForm = $oMemberAdminController->createSignupForm($config);
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
}
|
||||
foreach($config->signupForm as $signupItem)
|
||||
$changed = false;
|
||||
$phone_number_found = false;
|
||||
foreach($config->signupForm as $no => $signupItem)
|
||||
{
|
||||
if($signupItem->name === 'find_account_question')
|
||||
{
|
||||
$config->identifier = $config->identifier ?: 'user_id';
|
||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
unset($config->signupForm[$no]);
|
||||
$config->signupForm = array_values($config->signupForm);
|
||||
$changed = true;
|
||||
continue;
|
||||
}
|
||||
if($signupItem->name === 'email_address' && $signupItem->isPublic !== 'N')
|
||||
{
|
||||
$signupItem->isPublic = 'N';
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
$changed = true;
|
||||
continue;
|
||||
}
|
||||
if($signupItem->name === 'phone_number')
|
||||
{
|
||||
$phone_number_found = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Insert phone number after email address
|
||||
if(!$phone_found)
|
||||
{
|
||||
$newForm = array();
|
||||
foreach($config->signupForm as $signupItem)
|
||||
{
|
||||
$newForm[] = $signupItem;
|
||||
if($signupItem->name === 'email_address')
|
||||
{
|
||||
$newItem = new stdClass;
|
||||
$newItem->isDefaultForm = true;
|
||||
$newItem->name = $newItem->title = 'phone_number';
|
||||
$newItem->mustRequired = false;
|
||||
$newItem->imageType = false;
|
||||
$newItem->required = false;
|
||||
$newItem->isUse = false;
|
||||
$newItem->isPublic = 'N';
|
||||
$newForm[] = $newItem;
|
||||
}
|
||||
}
|
||||
$config->signupForm = $newForm;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
// Check agreements
|
||||
if(!$config->agreements)
|
||||
{
|
||||
$config = memberModel::getMemberConfig();
|
||||
$config->identifier = $config->identifier ?: 'user_id';
|
||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
||||
$agreement = new stdClass;
|
||||
$agreement->title = lang('agreement');
|
||||
$agreement->content = $config->agreement;
|
||||
$agreement->use_editor = 'Y';
|
||||
$agreement->type = 'required';
|
||||
$config->agreements[] = $agreement;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
// Save updated config
|
||||
if($changed)
|
||||
{
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
}
|
||||
|
||||
// Check skin
|
||||
if($config->skin)
|
||||
{
|
||||
$config_parse = explode('.', $config->skin);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
</thead>
|
||||
<tbody class="uDrag">
|
||||
{@ $disabled_list = array('find_account_question')}
|
||||
{@ $fixed_public_list = array('nick_name', 'password', 'email_address')}
|
||||
{@ $fixed_public_list = array('nick_name', 'password', 'email_address', 'phone_number')}
|
||||
<!--@foreach($config->signupForm as $item)-->
|
||||
<!--@if(in_array($item->name, $disabled_list))-->
|
||||
<!--@elseif($item->isIdentifier)-->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue