Skip to content

Commit

Permalink
Redirection vers emulateur
Browse files Browse the repository at this point in the history
Redirection vers emulateur si appel du service depuis navigateur
  • Loading branch information
ludosevilla authored Feb 11, 2024
1 parent 9ec2720 commit 62d8ebc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MiniPaviCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*
* Communication avec la passerelle MiniPavi
*
* 11/02/2024 : Redirection vers émulateur Minitel si appel direct depuis un navigateur
*
*/

namespace MiniPavi;
Expand Down Expand Up @@ -86,7 +88,9 @@ class MiniPaviCli {

static function start() {
if (strpos(@$_SERVER['HTTP_USER_AGENT'],'MiniPAVI') === false) {
echo "<!DOCTYPE html><head></head><body><h2>Cette page ne peut être appellée que via la psserelle MiniPAVI<br/><br/>This page can only be reached using the MiniPAVI gateway.</h2><hr/></body>";
$currentUrl = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$redirectUrl = 'http://www.minipavi.fr/emulminitel/indexws.php?url='.urlencode('wss://go.minipavi.fr:8181?url='.$currentUrl);
header("Location: $redirectUrl");
exit;
}
$rawPostData = file_get_contents("php://input");
Expand Down

0 comments on commit 62d8ebc

Please sign in to comment.