request("admin","string",0)==1 ) { $g_user=new Noalyss_user(new Database()); if ($g_user->admin != 1) { $g_user->audit('FAIL', "ADMIN: export admin".var_export($_REQUEST,true)); echo_warning(_("Accès interdit")); exit(); } if ( $hi->get("action")=="logfile") { $directory=dir( NOALYSS_BASE.DIRECTORY_SEPARATOR."log"); $a_file=[]; while ( $file = $directory->read()) { if (preg_match("/noalyss.*log/", $file)) { $a_file[]=$file; } } $file=$hi->get("file"); if (! in_array($file,$a_file ) ) { echo_warning(sprintf("%s non trouvé",$file)); return; } header('Content-Type: application/x-download'); header('Content-Disposition: attachment; filename="'.$file.'"'); header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public'); echo file_get_contents(NOALYSS_BASE.DIRECTORY_SEPARATOR."/log/{$file}"); } return; } //------------------------------------------------ // Connect the user to the current folder and export file //------------------------------------------------ $cn=Dossier::connect(); $g_user=new Noalyss_user($cn); $g_user->Check(); /** * check if 2FA is completed */ if ( ! $g_user->is_double_identified()) { exit(); } $gDossier=dossier::id(); $g_parameter=new Noalyss_Parameter_Folder($cn); $action=$g_user->check_dossier($gDossier); $action=$hi->get("act"); if ( $action=='X' || $g_user->check_print($action)==0 ) { echo alert(_('Accès interdit')); redirect("do.php?".dossier::get()); exit(); } // get file and execute it $prfile=$cn->get_value("select me_file from menu_ref where me_code=$1",array($action)); if ( LOGINPUT) { $file_loginput=fopen($_ENV['TMP'].'/export-'.$prfile.'-'.$_SERVER['REQUEST_TIME'].'.php','a+'); fwrite ($file_loginput,"