From 81cbe98dfc4426c39d89353ea53b01a1e991209d Mon Sep 17 00:00:00 2001 From: Claire DELBOS Date: Wed, 1 Mar 2017 09:53:36 +0100 Subject: [PATCH] Modif gestion d'erreur --- .../controllers/InextensoController.php | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 application/modules/achatclient/controllers/InextensoController.php diff --git a/application/modules/achatclient/controllers/InextensoController.php b/application/modules/achatclient/controllers/InextensoController.php new file mode 100644 index 000000000..bd398273b --- /dev/null +++ b/application/modules/achatclient/controllers/InextensoController.php @@ -0,0 +1,122 @@ +logger = Zend_Registry::get('logger'); + } + } + + /** + * Page d'accueil et de redirection + */ + public function indexAction() + { + $testidentities=array( + 'valide de test' => array( + 'partner' => "inextenso", + 'user' => "jpdurail.demo@gmail.com", + 'mail' => "jpdurail.demo@gmail.com", + 'name' => "RICOIS", + 'lastname' => "Michael", + ), + 'mcdo' => array( + 'partner' => "inextenso", + 'user' => "test20170227091241@intescia.com", + 'mail' => "test20170227091241@intescia.com", + 'name' => "DELBOS", + 'lastname' => "Claire", + ), + 'nouveau de test' => array( + 'partner' => "inextenso", + 'user' => "test".Date("YmdHis")."@intescia.com", + 'mail' => "test".Date("YmdHis")."@intescia.com", + 'name' => "DELBOS", + 'lastname' => "Claire", + ), + 'invalide de test' => array( + 'partner' => "inextenso2", + 'user' => "invalide.demo@gmail.com", + 'mail' => "invalide.demo@gmail.com", + 'name' => "VILAIN", + 'lastname' => "Claire", + ), + ); + $identity=$testidentities['nouveau de test']; + $mytime = time(); + $key = 'rh5s4z'; + $data = $identity['mail'] . '/' . $mytime . '/' . $key; + $token = hash('sha256', $data); + //$token=base64_encode(hash_hmac('sha256',$data)); + $url2='http://extranet.sd.dev/sso/inextenso'; + $url='http://extranet.sd.dev/auth?partner=inextenso'; + echo ' + + +
+ + partner :
+ mail :
+ name :
+ lastname :
+ codeclient :
+ token :
+ time : '.Date('Y-m-d H:i:s',$mytime).'
+ Si vous n\'ĂȘtes pas automatiquement redirigĂ© vers le service, cliquez sur ce bouton : + Ouvrir +
+ + + '; + + $login = $identity['mail']; + $name = $identity['name']; + $lastname = $identity['lastname']; + $time = $mytime; + + /* + $login = 'jpdurail.demo@gmail .com'; + $name = 'Jean Paul'; + $lastname = 'DURAIL'; + $time = '1434629722'; + */ + + $key = 'rh5s4z'; + $data = $login . '/' . $time . '/' . $key; + $token = hash('sha256', $data); + + echo "Lien : Ouvrir"; + echo "
"; + echo "SHA256 : ".$token; + echo "
"; + echo "TOKEN : ".base64_encode($token); + echo "
"; + echo "SHA256 HMAC : ".hash_hmac('sha256',$data,$key); + echo "
"; + echo "TOKEN : ".base64_encode(hash_hmac('sha256',$data,$key)); + echo "
"; + + /* + echo "

"; + $algos = hash_algos(); + foreach ($algos as $item) { + echo $item." TOKEN : ".hash($item, $data)." - BASE64 : ".base64_encode(hash($item, $data)); + echo "
"; + } + */ + die; + + } + +} +?> +