1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Crypt Capthca: small updates

This commit is contained in:
Awilum
2012-09-25 23:04:46 +03:00
parent a72d99c4dd
commit 9bfe67ee0e

View File

@@ -5,17 +5,20 @@ if (session_id() == "") session_start();
$_SESSION['cryptdir'] = dirname($cryptinstall);
/**
* Render Capthca
*/
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>&nbsp;&nbsp;<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>";
}
/**
* Verify Code
*/
function chk_crypt($code) {
// V?rifie si le code est correct
include ($_SESSION['configfile']);
$code = addslashes ($code);
$code = str_replace(' ', '', $code); // supprime les espaces saisis par erreur.