1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-19 03:11:24 +02:00

Add Monstra from HG Commit 683dcb70c4cc

This commit is contained in:
Awilum
2012-09-25 19:09:50 +03:00
parent d2db42b2bb
commit 4a5fea5f5b
251 changed files with 35026 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
if (session_id() == "") session_start();
$_SESSION['cryptdir'] = dirname($cryptinstall);
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>";
}
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.
$code = ($difuplow ? $code : strtoupper($code));
switch (strtoupper($cryptsecure)) {
case "MD5" : $code = md5($code); break;
case "SHA1" : $code = sha1($code); break;
}
if ($_SESSION['cryptcode'] and ($_SESSION['cryptcode'] == $code)) {
unset($_SESSION['cryptreload']);
if ($cryptoneuse) unset($_SESSION['cryptcode']);
return true;
} else {
$_SESSION['cryptreload'] = true;
return false;
}
}