Well guys, I came here to offer something that to me was very helpful that is security for Time Login Panel because the original XPT which created the whole basis of my board has no time limit, if the player leave the browser open Panel will stay on forever until he or click the Exit (which I never remember) or if you close the browser, but I've seen player to hack to let the panel open and delete to their personal accounts.
Well follow the script, which can give the name of such verifica_tempo.php:
This script you can relocate it in the top of index.php as below:PHP Code:<?
if (!$_SESSION['tempo_permitido'] AND $_SESSION["ID"] <> '') {
//Gravamos o tempo atual em uma sessão, para compararmos depois.
$_SESSION['tempo_permitido'] = mktime(date('H:i:s'));
}
//Pegando o Tempo Atual
$agora= mktime(date('H:i:s'));
// subtraimos o tempo em que o usuário entrou, do tempo atual "a diferença é em segundos"
$segundos=(is_numeric($_SESSION['tempo_permitido']) and is_numeric($agora)) ? ($agora-$_SESSION['tempo_permitido']):false;
$tlogado = round($segundos/60,0);
//definimos os segundos que o usuário deverá ficar logado
define('TEMPO_LOGADO',1800);
//1800 é em segundos ou seja 30 minutos, dai vocês colocam quanto tempo julgam necessário.
if($segundos > TEMPO_LOGADO) {
echo 'Tempo esgotado, efetue login novamente.';
session_unregister("usercode");
$_SESSION["ID"]='';
$_SESSION["charDir"]='';
$_SESSION["charNum"]='';
$_SESSION["charID"]='';
$_SESSION["charName"]='';
$_SESSION["charLevel"]='';
$_SESSION["charClass"]='';
$_SESSION['tempo_permitido']='';
header("location: index.php");
}
?>
And in the index2.php in the position they choose to place:PHP Code:include_once "verifica_tempo.php";
Good use for those who are interested in the system, which despite being a simple additional security.PHP Code:Tempo Logado no Painel: <? echo $tlogado; ?>
Att, Mak


Reply With Quote

