Fix: Corrige bug bloquant

This commit is contained in:
Laurent Destailleur 2007-09-11 17:06:58 +00:00
parent 5d7888f123
commit ffa92de2a2
3 changed files with 13 additions and 5 deletions

View File

@ -18,9 +18,10 @@
function dsp_crypt($cfg=0,$reload=1) {
// Affiche le cryptogramme
echo "<table><tr><td><img id='cryptogram' src='".$_SESSION['cryptdir']."/cryptographp.php?cfg=".$cfg."&".SID."'></td>";
if ($reload) echo "<td><a title='".($reload==1?'':$reload)."' style=\"cursor:pointer\" onclick=\"javascript:document.images.cryptogram.src='".$_SESSION['cryptdir']."/cryptographp.php?cfg=".$cfg."&".SID."&'+Math.round(Math.random(0)*1000)+1\"><img src=\"".$_SESSION['cryptdir']."/images/reload.png\"></a></td>";
echo "</tr></table>";
// FIX LDR. Le nom de session etait mal passe.
echo "<table><tr><td><img id='cryptogram' src='".$_SESSION['cryptdir']."/cryptographp.php?cfg=".$cfg."&sn=".session_name()."'></td>";
if ($reload) echo "<td><a title='".($reload==1?'':$reload)."' style=\"cursor:pointer\" onclick=\"javascript:document.images.cryptogram.src='".$_SESSION['cryptdir']."/cryptographp.php?cfg=".$cfg."&sn=".session_name()."&'+Math.round(Math.random(0)*1000)+1\"><img src=\"".$_SESSION['cryptdir']."/images/reload.png\"></a></td>";
echo "</tr></table>";
}

View File

@ -22,10 +22,15 @@ if ((!isset($_COOKIE['cryptcookietest'])) and ($_GET[$_GET['sn']]==""))
exit;
}
if ($_GET[$_GET['sn']]=="") unset ($_GET['sn']);
session_start();
// FIX LDR. Le bon nom de session n'etait pas positionne faisant stocker les variable dans la mauvaise.
session_name($_GET['sn']);
//print "zz".session_name().session_id();print_r($_SESSION);exit;
if ($_GET[$_GET['sn']]=="") unset ($_GET['sn']);
session_start();
// N'accepte que les fichiers de config du meme répertoire
if (is_file($_GET['cfg']) and dirname($_GET['cfg'])=='.' ) $_SESSION['configfile']=$_GET['cfg'];
else $_SESSION['configfile']="cryptographp.cfg.php";

View File

@ -11,6 +11,8 @@
// => Voir fichier Licence_CeCILL_V2-fr.txt)
// -----------------------------------------------
// FIX LDR. Le bon nom de session n'etait pas positionne faisant echouer le session_name plus loin.
session_name($_GET['sn']);
session_start();
error_reporting(E_ALL ^ E_NOTICE);