diff --git a/adapters/rest_generic/rest_generic_command.php b/adapters/rest_generic/rest_generic_command.php index 5e17479b..7b23722c 100644 --- a/adapters/rest_generic/rest_generic_command.php +++ b/adapters/rest_generic/rest_generic_command.php @@ -64,6 +64,19 @@ function eval_IMPORT() { foreach ( $parser_list as $op_eval => $sub_parsers ) { $running_conf = sendexpectone ( __FILE__ . ':' . __LINE__, $sms_sd_ctx, $op_eval, "" ); + + /**************** BEGIN Hook for FortiSase ***************************/ + $post_import=(string)$sub_parsers[0]->post_template; + /* if the post template of the MS contains "ADD_ENDPOINT" + change the json to add a new root element, with a new ENDPOINT + element that contains not only the call endpoint/URI + */ + if ( strpos($post_import, "ADD_ENDPOINT") !== false ){ + $running_conf["ENDPOINT"]=$op_eval; + $running_conf = array( "ROOT" => $running_conf ); + } + /**************** END Hook for FortiSase ***************************/ + foreach ( $sub_parsers as $parser ) { $parser->parse ( $running_conf, $objects ); }