mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
쪽지 발송 권한 설정 다듬기
This commit is contained in:
parent
b8b0e8978a
commit
5d3389a6ff
4 changed files with 50 additions and 74 deletions
|
|
@ -24,39 +24,14 @@ class communicationAdminController extends communication
|
|||
function procCommunicationAdminInsertConfig()
|
||||
{
|
||||
// get the default information
|
||||
$args = Context::gets('enable_message', 'enable_friend', 'skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group');
|
||||
$args = Context::gets('enable_message', 'enable_friend', 'skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_send_default','grant_send_group');
|
||||
$args->editor_colorset = $args->sel_editor_colorset;
|
||||
unset($args->sel_editor_colorset);
|
||||
|
||||
if(!$args->skin)
|
||||
{
|
||||
$args->skin = 'default';
|
||||
}
|
||||
|
||||
if(!$args->colorset)
|
||||
{
|
||||
$args->colorset = 'white';
|
||||
}
|
||||
|
||||
if(!$args->editor_skin)
|
||||
{
|
||||
$args->editor_skin = 'default';
|
||||
}
|
||||
|
||||
if(!$args->mskin)
|
||||
{
|
||||
$args->mskin = 'default';
|
||||
}
|
||||
|
||||
if(!$args->layout_srl)
|
||||
{
|
||||
$args->layout_srl = NULL;
|
||||
}
|
||||
|
||||
$oCommunicationModel = getModel('communication');
|
||||
$args->grant_write = $oCommunicationModel->getGrantArray($args->grant_write_default, $args->grant_write_group);
|
||||
unset($args->grant_write_default);
|
||||
unset($args->grant_write_group);
|
||||
$args->grant_send = $oCommunicationModel->getGrantArray($args->grant_send_default, $args->grant_send_group);
|
||||
unset($args->grant_send_default);
|
||||
unset($args->grant_send_group);
|
||||
|
||||
// create the module module Controller object
|
||||
$oModuleController = getController('module');
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class communicationController extends communication
|
|||
$oCommunicationModel = getModel('communication');
|
||||
$config = $oCommunicationModel->getConfig();
|
||||
|
||||
if(!$oCommunicationModel->checkWriteGrant($config->grant_write))
|
||||
if(!$oCommunicationModel->checkGrant($config->grant_send))
|
||||
{
|
||||
return new Object(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ class communicationModel extends communication
|
|||
{
|
||||
$config->mskin = 'default';
|
||||
}
|
||||
|
||||
if(!$config->grant_write)
|
||||
|
||||
if(!$config->grant_send)
|
||||
{
|
||||
$config->grant_write = array('default_grant' => 'member');
|
||||
$config->grant_send = array('default' => 'member');
|
||||
}
|
||||
|
||||
if(!$config->enable_message)
|
||||
|
|
@ -76,62 +76,54 @@ class communicationModel extends communication
|
|||
$grant = array();
|
||||
if($default)
|
||||
{
|
||||
switch($default)
|
||||
{
|
||||
case "-2":
|
||||
$grant = array("default_grant"=>"site");
|
||||
break;
|
||||
case "-3":
|
||||
$grant = array("default_grant"=>"manager");
|
||||
break;
|
||||
default :
|
||||
$grant = array("default_grant"=>"member");
|
||||
break;
|
||||
}
|
||||
}
|
||||
$grant = array('default' => $default);
|
||||
}
|
||||
else if(is_array($group))
|
||||
{
|
||||
$group_grant = array();
|
||||
$grant_group = array();
|
||||
foreach($group as $group_srl)
|
||||
{
|
||||
$group_grant[$group_srl] = true;
|
||||
$grant_group[$group_srl] = true;
|
||||
}
|
||||
|
||||
$grant = array('group_grant' => $group_grant);
|
||||
$grant = array('group' => $grant_group);
|
||||
}
|
||||
|
||||
return $grant;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check Write Grant
|
||||
* @brief Check Grant
|
||||
* @param array $arrGrant
|
||||
* @return boolean
|
||||
*/
|
||||
function checkWriteGrant($arrGrant)
|
||||
function checkGrant($arrGrant)
|
||||
{
|
||||
if(!$arrGrant) return false;
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == "Y") return true;
|
||||
if($logged_info->is_admin == 'Y') return true;
|
||||
|
||||
if($arrGrant['default_grant'])
|
||||
if($arrGrant['default'])
|
||||
{
|
||||
if($arrGrant['default_grant'] == "member" && Context::get('is_logged')) return true;
|
||||
|
||||
if($arrGrant['default_grant'] == "site" && $this->site_srl == $logged_info->site_srl) return true;
|
||||
|
||||
if($arrGrant['default_grant'] == "manager" && $logged_info->is_admin == "Y") return true;
|
||||
if($arrGrant['default'] == 'member')
|
||||
{
|
||||
if(Context::get('is_logged')) return true;
|
||||
}
|
||||
else if($arrGrant['default'] == 'site')
|
||||
{
|
||||
if($this->site_srl == $logged_info->site_srl) return true;
|
||||
}
|
||||
else if($arrGrant['default'] == 'manager')
|
||||
{
|
||||
if($logged_info->is_admin == 'Y') return true;
|
||||
}
|
||||
}
|
||||
|
||||
if($arrGrant['group_grant'])
|
||||
else if(is_array($arrGrant['group']))
|
||||
{
|
||||
$group_grant = $arrGrant['group_grant'];
|
||||
if(!is_array($group_grant)) return false;
|
||||
|
||||
foreach($logged_info->group_list as $group_srl => $title)
|
||||
{
|
||||
if($group_grant[$group_srl]) return true;
|
||||
if(isset($arrGrant['group'][$group_srl])) return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,18 +101,27 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="mlayout_srl">{$lang->communication_send_message_grant}</label>
|
||||
<label class="x_control-label" for="grant_send">{$lang->communication_send_message_grant}</label>
|
||||
<div class="x_controls">
|
||||
<select name="grant_write_default" class="grant_default">
|
||||
<option value="-1" selected="selected"|cond="$config->grant_write['default_grant']=='member'">{$lang->grant_to_login_user}</option>
|
||||
<option value="-2" selected="selected"|cond="$config->grant_write['default_grant']=='site'">{$lang->grant_to_site_user}</option>
|
||||
<option value="-3" selected="selected"|cond="$config->grant_write['default_grant']=='manager'">{$lang->grant_to_admin}</option>
|
||||
<option value="" selected="selected"|cond="$config->grant_write['default_grant']==''">{$lang->grant_to_group}</option>
|
||||
<select name="grant_send_default" class="grant_default" id="grant_send">
|
||||
<option value="member" selected="selected"|cond="$config->grant_send['default'] == 'member'">
|
||||
{$lang->grant_to_login_user}
|
||||
</option>
|
||||
<option value="site" selected="selected"|cond="$config->grant_send['default'] == 'site'">
|
||||
{$lang->grant_to_site_user}
|
||||
</option>
|
||||
<option value="manager" selected="selected"|cond="$config->grant_send['default'] == 'manager'">
|
||||
{$lang->grant_to_admin}
|
||||
</option>
|
||||
<option value="" selected="selected"|cond="$config->grant_send['default'] == ''">
|
||||
{$lang->grant_to_group}
|
||||
</option>
|
||||
</select>
|
||||
<div id="zone_grant_write" hidden style="margin:8px 0 0 0">
|
||||
<label loop="$group_list => $group_srl, $group_item" for="group_{$group_srl}">
|
||||
<input type="checkbox" class="checkbox" name="grant_write_group[]" value="{$group_item->group_srl}" id="group_{$group_item->group_srl}" checked="checked"|cond="isset($config->grant_write['group_grant'][$group_srl])"/>
|
||||
{$group_item->title}
|
||||
|
||||
<div id="zone_grant_send" style="margin:8px 0 0 0" hidden>
|
||||
<label loop="$group_list => $group_srl, $item" for="group_{$group_srl}">
|
||||
<input type="checkbox" name="grant_send_group[]" value="{$group_srl}" checked="checked"|cond="isset($config->grant_send['group'][$group_srl])" id="group_{$group_srl}"/>
|
||||
{$item->title}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue