diff --git a/src/nineskeletor-1.0/src/Controller/SondeController.php b/src/nineskeletor-1.0/src/Controller/SondeController.php new file mode 100644 index 0000000..4579370 --- /dev/null +++ b/src/nineskeletor-1.0/src/Controller/SondeController.php @@ -0,0 +1,43 @@ +getParameter("appEnv")!="PROD"); + + // Calcul du login + $user=$this->getUser(); + if($user) $loginsonde=crypt($user->getUsername(),"dkywqZPYNHtWDnSxACjXVcIsFuaiQT"); + else $loginsonde=""; + + // Calcul du profil + $profilsonde="visiteur"; + if($user) { + $profilsonde="utilisateur"; + $attributes=$this->get('session')->get('attributes'); + if(isset($attributes["ENTPersonProfils"])) $profilsonde=$attributes["ENTPersonProfils"]; + } + + // Calcul de la provenance + $e = explode('.', $_SERVER["REMOTE_ADDR"]); + $s = sizeof($e); + if(($e[0]=="172"&&$e[1]=="30")||($e[0]=="172"&&$e[1]=="16")||($e[0]=="10"&&($e[1]=="77"||$e[1]=="93"||$e[1]=="94"))) + $provenancesonde='interne'; + else + $provenancesonde='externe'; + + $url=$this->getParameter("sondeUrl"); + $app=$this->getParameter("appAlias"); + $urlsonde = $url."?appli=$app&profil=$profilsonde&login=$loginsonde&provenance=$provenancesonde&fgdebug=$fgdebug"; + + return $this->render('Sonde/sonde.html.twig',['urlsonde' => $urlsonde]); + } + + +} diff --git a/src/nineskeletor-1.0/templates/Sonde/sonde.html.twig b/src/nineskeletor-1.0/templates/Sonde/sonde.html.twig new file mode 100644 index 0000000..5614c28 --- /dev/null +++ b/src/nineskeletor-1.0/templates/Sonde/sonde.html.twig @@ -0,0 +1,3 @@ +{% if not urlsonde is empty %} + +{% endif %} \ No newline at end of file