mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Accommodate standalone=auto setting in other relevant places
This commit is contained in:
parent
741a714abd
commit
4a34b3dfa8
3 changed files with 25 additions and 10 deletions
|
|
@ -371,11 +371,18 @@ class ModuleHandler extends Handler
|
|||
}
|
||||
|
||||
// check if the current action allows standalone access (without mid)
|
||||
if(!$this->mid && isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->standalone === 'false')
|
||||
if(isset($xml_info->action->{$this->act}))
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
if($xml_info->action->{$this->act}->standalone === 'auto' && (!$this->module && !$this->mid))
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
}
|
||||
if($xml_info->action->{$this->act}->standalone === 'false' && !$this->mid)
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!isset($this->module_info->use_mobile))
|
||||
{
|
||||
$this->module_info->use_mobile = 'N';
|
||||
|
|
@ -432,7 +439,19 @@ class ModuleHandler extends Handler
|
|||
$module = strtolower($matches[1]);
|
||||
$xml_info = ModuleModel::getModuleActionXml($module);
|
||||
|
||||
if($xml_info->action->{$this->act} && ($this->module == 'admin' || $xml_info->action->{$this->act}->standalone != 'false'))
|
||||
if(!isset($xml_info->action->{$this->act}))
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
}
|
||||
elseif ($xml_info->action->{$this->act}->standalone === 'auto' && $this->module !== 'admin' && $this->module !== $module)
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
}
|
||||
elseif ($xml_info->action->{$this->act}->standalone === 'false' && $this->module !== 'admin')
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
}
|
||||
else
|
||||
{
|
||||
$forward = new stdClass();
|
||||
$forward->module = $module;
|
||||
|
|
@ -442,10 +461,6 @@ class ModuleHandler extends Handler
|
|||
$forward->meta_noindex = $xml_info->action->{$this->act}->meta_noindex;
|
||||
$forward->act = $this->act;
|
||||
}
|
||||
else
|
||||
{
|
||||
return self::_createErrorMessage(-1, 'msg_invalid_request');
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($forward->module))
|
||||
|
|
|
|||
|
|
@ -1275,7 +1275,7 @@ class moduleController extends module
|
|||
$forwardable_routes = array();
|
||||
foreach ($module_action_info->action ?: [] as $action_name => $action_info)
|
||||
{
|
||||
if (count($action_info->route) && $action_info->standalone !== 'false')
|
||||
if (count($action_info->route) && $action_info->standalone === 'true')
|
||||
{
|
||||
$forwardable_routes[$action_name] = array(
|
||||
'type' => $module_action_info->action->{$action_name}->type,
|
||||
|
|
|
|||
|
|
@ -1514,7 +1514,7 @@ class moduleModel extends module
|
|||
$forwardable_routes = array();
|
||||
foreach ($module_action_info->action ?? [] as $action_name => $action_info)
|
||||
{
|
||||
if (count($action_info->route) && $action_info->standalone !== 'false')
|
||||
if (count($action_info->route) && $action_info->standalone === 'true')
|
||||
{
|
||||
$forwardable_routes[$action_name] = array(
|
||||
'regexp' => array(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue