mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Fix #2119 being allowed to set 0 as category_srl
This commit is contained in:
parent
b8465cc022
commit
73c60b1297
2 changed files with 29 additions and 1 deletions
|
|
@ -62,6 +62,34 @@ class BoardController extends Board
|
||||||
throw new Rhymix\Framework\Exception('msg_content_too_long');
|
throw new Rhymix\Framework\Exception('msg_content_too_long');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check category
|
||||||
|
$category_list = DocumentModel::getCategoryList($this->module_srl);
|
||||||
|
if (count($category_list) > 0)
|
||||||
|
{
|
||||||
|
if ($obj->category_srl)
|
||||||
|
{
|
||||||
|
if (isset($category_list[$obj->category_srl]))
|
||||||
|
{
|
||||||
|
if (!$category_list[$obj->category_srl]->grant)
|
||||||
|
{
|
||||||
|
return new BaseObject(-1, 'msg_not_permitted');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$obj->category_srl = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$obj->category_srl && ($this->module_info->allow_no_category ?? 'N') !== 'Y')
|
||||||
|
{
|
||||||
|
if (!$this->grant->manager)
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception('categoryneeded');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// unset document style if not manager
|
// unset document style if not manager
|
||||||
if(!$this->grant->manager)
|
if(!$this->grant->manager)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -926,7 +926,7 @@ class BoardView extends Board
|
||||||
/**
|
/**
|
||||||
* add JS filters
|
* add JS filters
|
||||||
**/
|
**/
|
||||||
if(Context::get('logged_info')->is_admin == 'Y' || $this->module_info->allow_no_category == 'Y')
|
if($this->grant->manager || $this->module_info->allow_no_category == 'Y')
|
||||||
{
|
{
|
||||||
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
|
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue