mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +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
|
|
@ -49,6 +49,32 @@ class moduleController extends module
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add action security
|
||||
*/
|
||||
function insertActionSecurity($act)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->act = $act;
|
||||
$output = executeQuery('module.insertActionSecurity', $args);
|
||||
|
||||
Rhymix\Framework\Cache::delete('action_security');
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Delete action security
|
||||
*/
|
||||
function deleteActionSecurity($act)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->act = $act;
|
||||
$output = executeQuery('module.deleteActionSecurity', $args);
|
||||
|
||||
Rhymix\Framework\Cache::delete('action_security');
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add trigger callback function
|
||||
*
|
||||
|
|
@ -1362,6 +1388,28 @@ class moduleController extends module
|
|||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all secure actions are registered. If not, register them.
|
||||
*
|
||||
* @param string $module_name
|
||||
* @return object
|
||||
*/
|
||||
public function registerSecureActions(string $module_name)
|
||||
{
|
||||
$action_security = ModuleModel::getActionSecurity();
|
||||
$module_action_info = ModuleModel::getModuleActionXml($module_name);
|
||||
|
||||
foreach ($module_action_info->action ?: [] as $action_name => $action_info)
|
||||
{
|
||||
if ($action_info->use_ssl === 'true' && !isset($action_security[$action_name]))
|
||||
{
|
||||
$output = $this->insertActionSecurity($action_name);
|
||||
}
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
}
|
||||
/* End of file module.controller.php */
|
||||
/* Location: ./modules/module/module.controller.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue