"; //$full_ip="147.162.84.198" ; if ( !empty( $_GET["override_ip"] ) ) { $candidate_ip=trim( $_GET["override_ip"] ); $debug_msg=""; if ( preg_match( '/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/' , $candidate_ip ) ) { $full_ip=$candidate_ip; } } if ( preg_match( '/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/' , $full_ip ) ) { $ip = explode( "." , $full_ip); $aula = $ip[2] ; $macchina = $ip[3] ; /* //echo "$full_ip\n"; //echo "$macchina\n"; if ( $ip[0]=='147' && $ip[1]=='162' && $ip[2]=='84' ) { read_data_from_file( $macchina, $data_file); } else { echo implode( ":", array( "$full_ip - apparentemente il docente non ha prenotato questa aula", $postazione_da_ip, "$full_ip", $data_file, //nome "- Postazione non menzionata nel file relativo a questo turno", //cognome "support@math.unipd.it" //email ) ) ; } */ //in alternativa a file locali: https://gestionedidattica.unipd.it/Aule/eventi_giornalieri.php?Giorno=2022-01-06 $file = 'easyroom.json'; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/json'); header('Content-Disposition: attachment; filename="'.basename($file).'"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); echo readfile($file); exit; } } else { echo "MALFORMED ENVIRNMENT DATA\n"; } } else { echo "UNEXPECTED ENVIRNMENT\n"; /* read_data_from_file(198, $data_file); */ } /* total 28 -rw-r--r-- 1 root root 8360 Nov 11 08:25 2019-11-11_GGA1-ModA_turni-n1.csv -rw-r--r-- 1 root root 7416 Nov 11 08:25 2019-11-11_GGA1-ModA_turni-n2.csv -rw-r--r-- 1 root root 7793 Nov 11 08:25 2019-11-11_GGA1-ModA_turni-n3.csv */ ?>