mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +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->user_name = 'User Name';
|
||||||
$lang->nick_name = 'Nick Name';
|
$lang->nick_name = 'Nick Name';
|
||||||
$lang->email_address = 'Email';
|
$lang->email_address = 'Email';
|
||||||
|
$lang->phone_number = 'Phone Number';
|
||||||
$lang->homepage = 'Homepage';
|
$lang->homepage = 'Homepage';
|
||||||
$lang->blog = 'Blog';
|
$lang->blog = 'Blog';
|
||||||
$lang->birthday = 'Birthday';
|
$lang->birthday = 'Birthday';
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ $lang->writer = '글쓴이';
|
||||||
$lang->user_name = '이름';
|
$lang->user_name = '이름';
|
||||||
$lang->nick_name = '닉네임';
|
$lang->nick_name = '닉네임';
|
||||||
$lang->email_address = '이메일 주소';
|
$lang->email_address = '이메일 주소';
|
||||||
|
$lang->phone_number = '전화번호';
|
||||||
$lang->homepage = '홈페이지';
|
$lang->homepage = '홈페이지';
|
||||||
$lang->blog = '블로그';
|
$lang->blog = '블로그';
|
||||||
$lang->birthday = '생일';
|
$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->retroactive_application = 'retroact';
|
||||||
$lang->signature_html_retroact = 'also remove HTML in past inseted HTML signature. Can not be reversed.';
|
$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'] = 'Email Address';
|
||||||
|
$lang->search_target_list['email_address'] = 'Phone Number';
|
||||||
$lang->search_target_list['regdate'] = 'Sign up Date';
|
$lang->search_target_list['regdate'] = 'Sign up Date';
|
||||||
$lang->search_target_list['regdate_more'] = 'Sign up Date (more)';
|
$lang->search_target_list['regdate_more'] = 'Sign up Date (more)';
|
||||||
$lang->search_target_list['regdate_less'] = 'Sign up Date (less)';
|
$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->retroactive_application = '소급적용';
|
||||||
$lang->signature_html_retroact = '이전에 입력된 HTML 서명에서도 HTML을 제거 합니다. 되돌릴 수 없습니다.';
|
$lang->signature_html_retroact = '이전에 입력된 HTML 서명에서도 HTML을 제거 합니다. 되돌릴 수 없습니다.';
|
||||||
$lang->search_target_list['email_address'] = '이메일';
|
$lang->search_target_list['email_address'] = '이메일';
|
||||||
|
$lang->search_target_list['phone_number'] = '전화번호';
|
||||||
$lang->search_target_list['regdate'] = '가입일시';
|
$lang->search_target_list['regdate'] = '가입일시';
|
||||||
$lang->search_target_list['regdate_more'] = '가입일시(이상)';
|
$lang->search_target_list['regdate_more'] = '가입일시(이상)';
|
||||||
$lang->search_target_list['regdate_less'] = '가입일시(이하)';
|
$lang->search_target_list['regdate_less'] = '가입일시(이하)';
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@ class memberAdminController extends member
|
||||||
global $lang;
|
global $lang;
|
||||||
$signupForm = array();
|
$signupForm = array();
|
||||||
$items = 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',
|
'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_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',
|
'image_mark', 'image_mark_max_width', 'image_mark_max_height', 'image_mark_max_filesize',
|
||||||
|
|
@ -482,11 +482,11 @@ class memberAdminController extends member
|
||||||
{
|
{
|
||||||
global $lang;
|
global $lang;
|
||||||
$oMemberModel = getModel('member');
|
$oMemberModel = getModel('member');
|
||||||
|
|
||||||
// Get join form list which is additionally set
|
// Get join form list which is additionally set
|
||||||
$extendItems = $oMemberModel->getJoinFormList();
|
$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');
|
$mustRequireds = array('email_address', 'nick_name', 'password');
|
||||||
$orgRequireds = array('email_address', 'password', 'user_id', 'nick_name', 'user_name');
|
$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');
|
$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->required = in_array($key, $orgRequireds);
|
||||||
$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
|
$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
|
||||||
$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
|
$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';
|
$signupItem->isPublic = 'N';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -218,10 +218,11 @@ class member extends ModuleObject {
|
||||||
// Check scrap folder table
|
// Check scrap folder table
|
||||||
if(!$oDB->isColumnExists("member_scrap", "folder_srl")) return true;
|
if(!$oDB->isColumnExists("member_scrap", "folder_srl")) return true;
|
||||||
|
|
||||||
|
// Check signup form
|
||||||
$oModuleModel = getModel('module');
|
$oModuleModel = getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('member');
|
$config = $oModuleModel->getModuleConfig('member');
|
||||||
// check signup form ordering info
|
|
||||||
if(!$config->signupForm || !is_array($config->signupForm)) return true;
|
if(!$config->signupForm || !is_array($config->signupForm)) return true;
|
||||||
|
$phone_found = false;
|
||||||
foreach($config->signupForm as $signupItem)
|
foreach($config->signupForm as $signupItem)
|
||||||
{
|
{
|
||||||
if($signupItem->name === 'find_account_question')
|
if($signupItem->name === 'find_account_question')
|
||||||
|
|
@ -232,12 +233,23 @@ class member extends ModuleObject {
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if($signupItem->name === 'phone_number')
|
||||||
|
{
|
||||||
|
$phone_found = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if(!$phone_found)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check agreements
|
||||||
if(!$config->agreements)
|
if(!$config->agreements)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check skin
|
||||||
if($config->skin)
|
if($config->skin)
|
||||||
{
|
{
|
||||||
$config_parse = explode('.', $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"));
|
$oDB->addIndex("member_scrap","idx_folder_srl", array("folder_srl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check signup form
|
||||||
$oModuleModel = getModel('module');
|
$oModuleModel = getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('member');
|
$config = $oModuleModel->getModuleConfig('member');
|
||||||
$oModuleController = getController('module');
|
$oModuleController = getController('module');
|
||||||
|
|
||||||
$oMemberAdminController = getAdminController('member');
|
$oMemberAdminController = getAdminController('member');
|
||||||
// check signup form ordering info
|
if(!$config->identifier)
|
||||||
|
{
|
||||||
|
$config->identifier = 'email_address';
|
||||||
|
}
|
||||||
if(!$config->signupForm || !is_array($config->signupForm))
|
if(!$config->signupForm || !is_array($config->signupForm))
|
||||||
{
|
{
|
||||||
$config->identifier = 'user_id';
|
$config->signupForm = $oMemberAdminController->createSignupForm($config);
|
||||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
|
||||||
$output = $oModuleController->updateModuleConfig('member', $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')
|
if($signupItem->name === 'find_account_question')
|
||||||
{
|
{
|
||||||
$config->identifier = $config->identifier ?: 'user_id';
|
unset($config->signupForm[$no]);
|
||||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
$config->signupForm = array_values($config->signupForm);
|
||||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
$changed = true;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if($signupItem->name === 'email_address' && $signupItem->isPublic !== 'N')
|
if($signupItem->name === 'email_address' && $signupItem->isPublic !== 'N')
|
||||||
{
|
{
|
||||||
$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)
|
if(!$config->agreements)
|
||||||
{
|
{
|
||||||
$config = memberModel::getMemberConfig();
|
$agreement = new stdClass;
|
||||||
$config->identifier = $config->identifier ?: 'user_id';
|
$agreement->title = lang('agreement');
|
||||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
$agreement->content = $config->agreement;
|
||||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
$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)
|
if($config->skin)
|
||||||
{
|
{
|
||||||
$config_parse = explode('.', $config->skin);
|
$config_parse = explode('.', $config->skin);
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="uDrag">
|
<tbody class="uDrag">
|
||||||
{@ $disabled_list = array('find_account_question')}
|
{@ $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)-->
|
<!--@foreach($config->signupForm as $item)-->
|
||||||
<!--@if(in_array($item->name, $disabled_list))-->
|
<!--@if(in_array($item->name, $disabled_list))-->
|
||||||
<!--@elseif($item->isIdentifier)-->
|
<!--@elseif($item->isIdentifier)-->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue