mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Fix #1393 allow adding module admin by email address
This commit is contained in:
parent
09c48abee9
commit
5e9d9ef02f
7 changed files with 32 additions and 23 deletions
|
|
@ -90,7 +90,7 @@ $lang->password = '비밀번호';
|
|||
$lang->password1 = '새 비밀번호';
|
||||
$lang->password2 = '새 비밀번호 확인';
|
||||
$lang->password3 = '비밀번호 확인';
|
||||
$lang->admin_id = '관리자ID';
|
||||
$lang->admin_id = '관리자 ID';
|
||||
$lang->admin_email_address = '관리자 Email 주소';
|
||||
$lang->writer = '글쓴이';
|
||||
$lang->user_name = '이름';
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ $lang->about_list_count = 'You can limit the number of article to show on one pa
|
|||
$lang->about_search_list_count = 'You may set the number of articles to be exposed when you use search or category function. (default is 20)';
|
||||
$lang->about_page_count = 'You can set the number of page links to move pages in a bottom of the page. (default is 10)';
|
||||
$lang->about_mobile_page_count = 'You can set the number of page links to move pages in a bottom of the page. (default is 5)';
|
||||
$lang->about_admin_id = 'You can grant a manager to have all permissions to the module.';
|
||||
$lang->about_admin_id = 'You can grant someone permission to manage this module. Please enter the user ID or email address of the person you wish to add.';
|
||||
$lang->about_grant_deatil = 'Registered users mean users who signed-up to the virtual sites (e.g., cafeXE).';
|
||||
$lang->about_module = 'Rhymix consists of modules except the basic library. [Module Manage] module will show all installed modules and help you to manage them.';
|
||||
$lang->about_extra_vars_default_value = 'This is only for select,checkbox and radio button. If multiple default values are needed, you can link them with comma.';
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ $lang->about_list_count = '한 페이지에 표시될 글 수를 지정할 수
|
|||
$lang->about_search_list_count = '검색, 카테고리 선택 등을 할 경우 표시될 글 수를 지정할 수 있습니다. (기본 20개)';
|
||||
$lang->about_page_count = '목록 하단, 페이지를 이동하는 링크 수를 지정할 수 있습니다. (기본 10개)';
|
||||
$lang->about_mobile_page_count = '목록 하단, 페이지를 이동하는 링크 수를 지정할 수 있습니다. (기본 5개)';
|
||||
$lang->about_admin_id = '해당 모듈에 대해 최고 권한을 가지는 관리자를 지정할 수 있습니다.';
|
||||
$lang->about_admin_id = '특정 회원에게 이 모듈의 관리 권한을 부여할 수 있습니다. 권한을 부여할 회원의 아이디 또는 이메일 주소를 입력해 주세요.';
|
||||
$lang->about_grant_deatil = '가입한 사용자는 cafeXE 등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다.';
|
||||
$lang->about_module = 'Rhymix는 기본 라이브러리를 제외한 나머지는 모두 모듈로 구성되어 있습니다. 모듈 관리 모듈은 설치된 모든 모듈을 보여주고 관리를 돕습니다.';
|
||||
$lang->about_extra_vars_default_value = '다중/단일 선택 등 기본 값이 여러 개가 필요한 경우 , (콤마)로 연결하면 됩니다.';
|
||||
|
|
|
|||
|
|
@ -283,6 +283,10 @@ class moduleAdminController extends module
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
if(!$module_info) throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// Register Admin ID
|
||||
$oModuleController->deleteAdminId($module_srl);
|
||||
$admin_member = Context::get('admin_member');
|
||||
|
|
@ -296,11 +300,10 @@ class moduleAdminController extends module
|
|||
$oModuleController->insertAdminId($module_srl, $admin_id);
|
||||
}
|
||||
}
|
||||
|
||||
// List permissions
|
||||
$xml_info = $oModuleModel->getModuleActionXML($module_info->module);
|
||||
|
||||
$grant_list = $xml_info->grant;
|
||||
|
||||
$grant_list->access = new stdClass();
|
||||
$grant_list->access->default = 'guest';
|
||||
$grant_list->manager = new stdClass();
|
||||
|
|
@ -353,6 +356,8 @@ class moduleAdminController extends module
|
|||
}
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_grants:$module_srl");
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -804,21 +804,26 @@ class moduleController extends module
|
|||
function insertAdminId($module_srl, $admin_id)
|
||||
{
|
||||
$oMemberModel = getModel('member');
|
||||
$member_config = $oMemberModel->getMemberConfig();
|
||||
|
||||
if($member_config->identifier == 'email_address')
|
||||
if(strpos($admin_id, '@') !== false)
|
||||
{
|
||||
$member_info = $oMemberModel->getMemberInfoByEmailAddress($admin_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$member_info = $oMemberModel->getMemberInfoByUserID($admin_id);
|
||||
|
||||
if(!$member_info->member_srl) return;
|
||||
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_admins:$module_srl");
|
||||
}
|
||||
if(!$member_info->member_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$args->module_srl = intval($module_srl);
|
||||
$args->member_srl = $member_info->member_srl;
|
||||
return executeQuery('module.insertAdminId', $args);
|
||||
$output = executeQuery('module.insertAdminId', $args);
|
||||
|
||||
Rhymix\Framework\Cache::delete("site_and_module:module_admins:" . intval($module_srl));
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ function doInsertAdmin() {
|
|||
sel_obj.options[sel_obj.options.length] = opt;
|
||||
|
||||
fo_obj.admin_id.value = '';
|
||||
sel_obj.size = sel_obj.options.length;
|
||||
sel_obj.size = Math.max(3, sel_obj.options.length);
|
||||
sel_obj.selectedIndex = -1;
|
||||
|
||||
var members = new Array();
|
||||
|
|
@ -125,7 +125,7 @@ function doDeleteAdmin() {
|
|||
var sel_obj = fo_obj._admin_member;
|
||||
sel_obj.remove(sel_obj.selectedIndex);
|
||||
|
||||
sel_obj.size = sel_obj.options.length;
|
||||
sel_obj.size = Math.max(3, sel_obj.options.length);
|
||||
sel_obj.selectedIndex = -1;
|
||||
|
||||
var members = new Array();
|
||||
|
|
|
|||
|
|
@ -20,18 +20,17 @@
|
|||
</label>
|
||||
<div class="x_controls">
|
||||
<div class="x_input-append" style="margin-bottom:8px">
|
||||
<select name="_admin_member" multiple="multiple" size="{count($admin_member)?count($admin_member):1}">
|
||||
<input type="text" name="admin_id" />
|
||||
<button class="x_btn" type="button" onclick="doInsertAdmin()">{$lang->cmd_insert}</button>
|
||||
</div><br />
|
||||
<div class="x_input-append" style="margin-bottom:8px">
|
||||
<select name="_admin_member" multiple="multiple" size="{max(3, count($admin_member))}">
|
||||
<option loop="$admin_member => $key, $val" value="{$val->email_address}"|cond="$member_config->identifier=='email_address'" value="{$val->user_id}"|cond="$member_config->identifier!='email_address'">
|
||||
{$val->nick_name} (<block cond="$member_config->identifier=='email_address'">{$val->email_address}</block><block cond="$member_config->identifier!='email_address'">{$val->user_id}</block>)
|
||||
</option>
|
||||
</select>
|
||||
<button class="x_btn" type="button" onclick="doDeleteAdmin()">{$lang->cmd_delete}</button>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x_input-append">
|
||||
<input type="text" name="admin_id" />
|
||||
<button class="x_btn" type="button" onclick="doInsertAdmin()">{$lang->cmd_insert}</button>
|
||||
</div>
|
||||
</div><br />
|
||||
<p id="adminListHelp" class="x_help-block">{$lang->about_admin_id}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue