<commit_before><?php
/**
*
* PRINT
* This script render final document necessary to create the pdf file from DEDALO_PDF_RENDERER (wkhtmltopdf)
* Is accesible for DEDALO_PDF_RENDERER without login (user data is created from actual logged user)
*/

require_once( dirname(dirname(dirname(__FILE__))) .'/config/config4.php');
require_once( dirname(__FILE__) .'/class.tool_layout_print.php'); 

	#
	# VERIFY VARS
		if( !isset($_REQUEST['template_tipo']) ) return print("Error Processing Request. Few vars are received (template_tipo)");
		if( !isset($_REQUEST['template_id'])   ) {
				dump($_REQUEST, " _REQUEST ".to_string());
			return print("Error Processing Request. Few vars are received (template_id)");
		}
		if( !isset($_REQUEST['section_tipo'])  ) return print("Error Processing Request. Few vars are received (section_tipo)");
		if( !isset($_REQUEST['section_id'])	   ) return print("Error Processing Request. Few vars are received (section_id)");

	# VARS
		$section_tipo 		= (string)$_REQUEST['section_tipo'];
		$section_id 		= (string)$_REQUEST['section_id'];	
		$section_layout_tipo= (string)$_REQUEST['template_tipo'];
		$section_layout_id 	= (string)$_REQUEST['template_id'];	
	
	
	#
	# AUTOLOGIN
		/*
		$autologged=false;
		if(login::is_logged()!==true) {

			$user_id 	= isset($_REQUEST['user_id']) ? (int)$_REQUEST['user_id'] : false;
		
			$_SESSION['dedalo4']['auth']['user_id']   	= $user_id;
			$_SESSION['dedalo4']['auth']['is_logged'] 	= 1;
			$_SESSION['dedalo4']['auth']['salt_secure'] = DEDALO_SALT_STRING;

			if(login::is_logged()!==true) {
				$string_error = "Auth error: please login";
				print dd_error::wrap_error($string_error);
				die();
			}
			$autologged=true;
		}//end if(login::is_logged()!==true) {
		*/

	#
	# TEMPLATE FROM DATA
		/*
		$folder_path 	= dirname(__FILE__).'/data/'.$_SESSION['dedalo4']['auth']['user_id'];<commit_msg>Security update; enforce for prevent XSS<commit_after><?php
/**
*
* PRINT
* This script render final document necessary to create the pdf file from DEDALO_PDF_RENDERER (wkhtmltopdf)
* Is accesible for DEDALO_PDF_RENDERER without login (user data is created from actual logged user)
*/
require_once( dirname(dirname(dirname(__FILE__))) .'/config/config4.php');
require_once( dirname(__FILE__) .'/class.tool_layout_print.php'); 

	#
	# VERIFY VARS
		if( !isset($_REQUEST['template_tipo']) ) { 
			return print('Error Processing Request. Few vars are received (template_tipo)');
		}
		if( !isset($_REQUEST['template_id'])   ) {			
			return print('Error Processing Request. Few vars are received (template_id)');
		}
		if( !isset($_REQUEST['section_tipo'])  ) {
			return print('Error Processing Request. Few vars are received (section_tipo)');
		}
		if( !isset($_REQUEST['section_id'])	   ) {
			return print('Error Processing Request. Few vars are received (section_id)');
		}

	# VARS
		$section_tipo 		= (string)common::setVar('section_tipo');
		$section_id 		= (string)common::setVar('section_id');	
		$section_layout_tipo= (string)common::setVar('template_tipo');
		$section_layout_id 	= (string)common::setVar('template_id');
	
	
	#
	# AUTOLOGIN
		/*
		$autologged=false;
		if(login::is_logged()!==true) {

			$user_id 	= isset($_REQUEST['user_id']) ? (int)safe_xss($_REQUEST['user_id']) : false;
		
			$_SESSION['dedalo4']['auth']['user_id']   	= $user_id;
			$_SESSION['dedalo4']['auth']['is_logged'] 	= 1;
			$_SESSION['dedalo4']['auth']['salt_secure'] = DEDALO_SALT_STRING;

			if(login::is_logged()!==true) {
				$string_error = "Auth error: please login";
				print dd_error::wrap_error($string_error);
				die();
			}
			$autologged=true;
		}//end if(login::is_logged()!==true) {
		*/

	#
	# TEMPLATE FROM DATA
		/*
		$folder_path 	= dirname(__FILE__).'/data/'.$_SESSION['dedalo4']['auth']['user_id'];
{'fraction_non_alphanumeric': 0.1725231175693527, 'fraction_numerical': 0.003170409511228534, 'mean_word_length': 5.166123778501628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3621323', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1321, 'n_words': 249}