mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Move SSL redirection logic to Context::init()
This commit is contained in:
parent
65df40ad9f
commit
b5740052fc
15 changed files with 199 additions and 126 deletions
|
|
@ -602,6 +602,38 @@ class moduleModel extends module
|
|||
return $action_forward[$act];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get SSL action setting
|
||||
*/
|
||||
public static function getActionSecurity($act = null)
|
||||
{
|
||||
$action_security = Rhymix\Framework\Cache::get('action_security');
|
||||
if($action_security === null)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$output = executeQueryArray('module.getActionSecurity', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$action_security = array();
|
||||
foreach($output->data as $item)
|
||||
{
|
||||
$action_security[$item->act] = true;
|
||||
}
|
||||
|
||||
Rhymix\Framework\Cache::set('action_security', $action_security, 0, true);
|
||||
}
|
||||
|
||||
if(!isset($act))
|
||||
{
|
||||
return $action_security;
|
||||
}
|
||||
|
||||
return isset($action_security[$act]) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get trigger functions
|
||||
*/
|
||||
|
|
@ -1347,6 +1379,9 @@ class moduleModel extends module
|
|||
|
||||
// Get action forward
|
||||
$action_forward = self::getActionForward();
|
||||
|
||||
// Get action security
|
||||
$action_security = self::getActionSecurity();
|
||||
|
||||
foreach ($searched_list as $module_name)
|
||||
{
|
||||
|
|
@ -1431,6 +1466,15 @@ class moduleModel extends module
|
|||
$info->need_update = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if all secure actions are registered
|
||||
foreach ($module_action_info->action ?: [] as $action_name => $action_info)
|
||||
{
|
||||
if ($action_info->use_ssl === 'true' && !isset($action_security[$action_name]))
|
||||
{
|
||||
$info->need_update = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
$list[] = $info;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue