mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
add identifier choice
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9110 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c7b35ff5c7
commit
af4c27f832
12 changed files with 89 additions and 14 deletions
|
|
@ -15,7 +15,7 @@ class HTMLDisplayHandler {
|
|||
else
|
||||
$skin = $oModule->module_config->skin;
|
||||
|
||||
if ($skin){
|
||||
if ($skin && is_string($skin)){
|
||||
$theme_skin = explode('.', $skin);
|
||||
if (count($theme_skin) == 2)
|
||||
$template_path = sprintf('./themes/%s/modules/%s/', $theme_skin[0], $theme_skin[1]);
|
||||
|
|
@ -24,6 +24,7 @@ class HTMLDisplayHandler {
|
|||
}else{
|
||||
$template_path = $oModule->getTemplatePath();
|
||||
}
|
||||
|
||||
$tpl_file = $oModule->getTemplateFile();
|
||||
|
||||
$output = $oTemplate->compile($template_path, $tpl_file);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<action name="getMemberAdminColorset" type="model" standalone="true" />
|
||||
<action name="getMemberAdminInsertJoinForm" type="model" />
|
||||
|
||||
<action name="procMemberLogin" type="controller" standalone="true" ruleset="login" />
|
||||
<action name="procMemberLogin" type="controller" standalone="true" ruleset="@login" />
|
||||
<action name="procMemberOpenIDLogin" type="controller" standalone="true" ruleset="openidLogin" />
|
||||
<action name="procMemberOpenIDValidate" type="controller" standalone="true" />
|
||||
<action name="procMemberAddOpenIDToMember" type="controller" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -2319,4 +2319,10 @@ Bạn có thể quản lý thành viên bằng cách tạo những nhóm mới,
|
|||
<item name="msg_null_prohibited_id">
|
||||
<value xml:lang="ko"><![CDATA[추가할 금지 아이디를 입력해주세요.]]></value>
|
||||
</item>
|
||||
<item name="identifier">
|
||||
<value xml:lang="ko"><![CDATA[로그인 계정]]></value>
|
||||
</item>
|
||||
<item name="about_identifier">
|
||||
<value xml:lang="ko"><![CDATA[로그인에 사용할 계정을 선택해주세요.<br/> 이메일 주소 선택시 회원정보는 이메일 주소로 노출됩니다.]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@
|
|||
|
||||
// create Ruleset
|
||||
$this->_createSignupRuleset($signupForm);
|
||||
$this->_createLoginRuleset($args->identifier);
|
||||
}
|
||||
$output = $oModuleController->updateModuleConfig('member', $args);
|
||||
// default setting end
|
||||
|
|
@ -244,6 +245,31 @@
|
|||
|
||||
$xml_buff = sprintf($buff, implode('', $fields));
|
||||
FileHandler::writeFile($xml_file, $xml_buff);
|
||||
|
||||
$validator = new Validator($xml_file);
|
||||
$validator->setCacheDir('files/cache');
|
||||
$validator->getJsPath();
|
||||
}
|
||||
|
||||
function _createLoginRuleset($identifier){
|
||||
$xml_file = './files/ruleset/login.xml';
|
||||
$buff = '<?xml version="1.0" encoding="utf-8"?>'
|
||||
.'<ruleset version="1.5.0">'
|
||||
.'<customrules>'
|
||||
.'</customrules>'
|
||||
.'<fields>%s</fields>'
|
||||
.'</ruleset>';
|
||||
|
||||
$fields = array();
|
||||
$fields[] = sprintf('<field name="user_id" required="true" rule="%s"/>', $identifier);
|
||||
$fields[] = '<field name="password" required="true" />';
|
||||
|
||||
$xml_buff = sprintf($buff, implode('', $fields));
|
||||
FileHandler::writeFile($xml_file, $xml_buff);
|
||||
|
||||
$validator = new Validator($xml_file);
|
||||
$validator->setCacheDir('files/cache');
|
||||
$validator->getJsPath();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1390,10 +1390,21 @@
|
|||
if(!$trigger_output->toBool()) return $trigger_output;
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
// Get user_id information
|
||||
$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
|
||||
// Set an invalid user if no value returned
|
||||
if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id');
|
||||
|
||||
// check identifier
|
||||
$config = $oMemberModel->getMemberConfig();
|
||||
if ($config->identifier == 'email_address'){
|
||||
// Get user_id information
|
||||
$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
|
||||
// Set an invalid user if no value returned
|
||||
if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return new Object(-1, 'invalid_email_address');
|
||||
|
||||
}else{
|
||||
// Get user_id information
|
||||
$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
|
||||
// Set an invalid user if no value returned
|
||||
if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id');
|
||||
}
|
||||
// Password Check
|
||||
if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
|
||||
// If denied == 'Y', notify
|
||||
|
|
|
|||
|
|
@ -168,6 +168,21 @@
|
|||
return $member_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return member information with email_address
|
||||
**/
|
||||
function getMemberInfoByEmailAddress($email_address) {
|
||||
if(!$email_address) return;
|
||||
|
||||
$args->email_address = $email_address;
|
||||
$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$output->data) return;
|
||||
|
||||
$member_info = $this->arrangeMemberInfo($output->data);
|
||||
return $member_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return member information with member_srl
|
||||
**/
|
||||
|
|
|
|||
11
modules/member/queries/getMemberInfoByEmailAddress.xml
Normal file
11
modules/member/queries/getMemberInfoByEmailAddress.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getMemberInfoByEmailAddress" action="select">
|
||||
<tables>
|
||||
<table name="member" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="email_address" var="email_address" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<div class="header">{$lang->cmd_login}</div>
|
||||
|
||||
<form ruleset="login" action="./" method="post" id="fo_member_login">
|
||||
<form ruleset="@login" action="./" method="post" id="fo_member_login">
|
||||
<input type="hidden" name="act" value="procMemberLogin" />
|
||||
<fieldset class="login">
|
||||
<dl>
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
<th scope="col">{$lang->identifier}
|
||||
[<a href="#helpDefault" class="tgAnchor">?</a>]
|
||||
<div class="tgContent layer" id="helpDefault" style="right:0">
|
||||
<p>로그인시 사용할 필드를 선택합니다.</p>
|
||||
<p>{$lang->about_identifier}</p>
|
||||
</div>
|
||||
</th>
|
||||
<th scope="col">{$lang->use}</th>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<!--%import("./filter/openid_login.xml")-->
|
||||
<!--%import("./message.js")-->
|
||||
<div class="mLogin" id="gLogin">
|
||||
<form ruleset="login" action="./" method="post" id="gForm">
|
||||
<form ruleset="@login" action="./" method="post" id="gForm">
|
||||
<input type="hidden" name="act" value="procMemberLogin" />
|
||||
<fieldset>
|
||||
<ul class="idpw">
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
</publisher>
|
||||
<description xml:lang="ko">XE가 제공하는 기본 테마입니다.</description>
|
||||
<description xml:lang="en">The basic theme is provided by XE.</description>
|
||||
<skinInfos>
|
||||
<layoutInfo>
|
||||
<layout>
|
||||
<directory path="./layouts/xe_official" />
|
||||
</layoutInfo>
|
||||
</layout>
|
||||
<skinInfos>
|
||||
<skinInfo>
|
||||
<directory path="./modules/page/skins/default" />
|
||||
</skinInfo>
|
||||
|
|
|
|||
|
|
@ -12,9 +12,14 @@
|
|||
<!--%import("./js/login.js")-->
|
||||
|
||||
<fieldset id="login" class="login_{$colorset}">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<legend>{$lang->cmd_login}</legend>
|
||||
<form id="fo_login_widget" action="./" method="post" onsubmit="return procFilter(this, widget_login)">
|
||||
<input type="hidden" name="_filter" value="widget_login" />
|
||||
<form id="fo_login_widget" action="./" method="post" ruleset="@login">
|
||||
<input type="hidden" name="act" value="procMemberLogin" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('act', '')}" />
|
||||
|
||||
|
||||
<div class="idpwWrap">
|
||||
<div class="idpw">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue