コード例 #1
0
<?php 
include_once 'CheckLogOut.php';
require_once 'CacheSessao.php';
require_once 'CacheArquivo.php';
$cacheArquivo = new CacheArquivo();
$cacheArquivo->set_valor($USERID);
$cacheSessao = new CacheSessao();
$USERID = $cacheSessao->set_valor('USERID');
$USERNAME = $cacheSessao->set_valor('USERNAME');
echo '<html>';
echo '<script>';
echo 'alert("Deslogado!");';
echo 'window.location="Index.php"';
echo '</script>';
echo '</html>';
コード例 #2
0
//include_once 'cache.arquivo.php';
require_once 'CacheArquivo.php';
require_once 'CacheSessao.php';
require_once 'Connection.php';
require_once 'User.php';
$c = new Connection();
$u = new User();
$cacheArquivo = new CacheArquivo();
$cacheSessao = new CacheSessao();
$UsId = $u->GetUserIdByUserName($_REQUEST['userName']);
$u->UserId($UsId);
$Contacts = $u->GetAllContacts($UsId);
$valor = json_encode($Contacts);
$cacheArquivo->set_valor($UsId, $valor);
if ($UsId > 0) {
    $cacheSessao->set_valor('USERID', $UsId);
    $cacheSessao->set_valor('USERNAME', $_REQUEST['userName']);
} else {
    $cacheSessao->set_valor('USERID');
    $cacheSessao->set_valor('USERNAME');
}
$u->UserName($_REQUEST['userName']);
$u->Password($_REQUEST['password']);
$res = $u->VerifyLogin();
if ($res) {
    echo '<html>';
    echo '<script language="JavaScript">';
    echo 'window.location="Main.php"';
    echo '</script>';
    echo '</html>';
} else {