".__('Security error. Please contact the administrator.').''; } else { $downloadable_file = ''; $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); $parse_sec2_query = explode('=', $parse_all_queries[1]); // Metaconsole have a route distinct than node. $main_file_manager = (is_metaconsole() === true) ? 'advanced/metasetup' : 'godmode/setup/file_manager'; $main_collections = (is_metaconsole() === true) ? 'advanced/collections' : 'enterprise/godmode/agentes/collections'; if ($parse_sec2_query[0] === 'sec2') { switch ($parse_sec2_query[1]) { case $main_file_manager: case 'operation/snmpconsole/snmp_mib_uploader': $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/'.$file; break; case 'extensions/files_repo': $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file; break; case 'godmode/servers/plugin': $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/plugin/'.$file; break; case $main_collections: $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/collection/'.$file; break; default: $downloadable_file = ''; // Do nothing break; } } if ($downloadable_file === '' || !file_exists($downloadable_file)) { echo "

".__('File is missing in disk storage. Please contact the administrator.').'

'; } else { header('Content-type: aplication/octet-stream;'); header('Content-type: '.mime_content_type($downloadable_file).';'); header('Content-Length: '.filesize($downloadable_file)); header('Content-Disposition: attachment; filename="'.basename($downloadable_file).'"'); readfile($downloadable_file); } }