Exemple #1
0
function Read_Time_Blocked($FileHandle)
{
    global $DomainList, $Earliest;
    while (!feof($FileHandle)) {
        $Line = fgets($FileHandle);
        //Read Line of LogFile
        if (substr($Line, 4, 1) == ' ') {
            //dnsmasq puts a double space for single digit dates
            $Seg = explode(' ', str_replace('  ', ' ', $Line));
        } else {
            $Seg = explode(' ', $Line);
        }
        //Split Line into segments
        if (strtotime($Seg[2]) >= $Earliest) {
            //Check if time in log > Earliest required
            if ($Seg[4] == 'config' && $Seg[5] != $Dedup) {
                $DomainList[] = ReturnURL($Seg[5]) . '-';
                $Dedup = $Seg[5];
            }
        }
    }
    return null;
}
// Lê dados do $_POST
$Pedido->formaPagamentoBandeira = $_POST["codigoBandeira"];
if ($_POST["formaPagamento"] != "A" && $_POST["formaPagamento"] != "1") {
    $Pedido->formaPagamentoProduto = $_POST["tipoParcelamento"];
    $Pedido->formaPagamentoParcelas = $_POST["formaPagamento"];
} else {
    $Pedido->formaPagamentoProduto = $_POST["formaPagamento"];
    $Pedido->formaPagamentoParcelas = 1;
}
$Pedido->dadosEcNumero = CIELO;
$Pedido->dadosEcChave = CIELO_CHAVE;
$Pedido->capturar = $_POST["capturarAutomaticamente"];
$Pedido->autorizar = $_POST["indicadorAutorizacao"];
$Pedido->dadosPedidoNumero = rand(1000000, 9999999);
$Pedido->dadosPedidoValor = $_POST["produto"];
$Pedido->urlRetorno = ReturnURL();
// ENVIA REQUISIÇÃO SITE CIELO
$objResposta = $Pedido->RequisicaoTransacao(false);
$Pedido->tid = $objResposta->tid;
$Pedido->pan = $objResposta->pan;
$Pedido->status = $objResposta->status;
$urlAutenticacao = "url-autenticacao";
$Pedido->urlAutenticacao = $objResposta->{$urlAutenticacao};
// Serializa Pedido e guarda na SESSION
$StrPedido = $Pedido->ToString();
$_SESSION["pedidos"]->append($StrPedido);
echo '<script type="text/javascript">
			window.location.href = "' . $Pedido->urlAutenticacao . '"
		 </script>';
?>
Exemple #3
0
function Load_HistoricLog_Blocked($LogDate)
{
    global $DomainList;
    $LogFile = '/var/log/notrack/dns-' . $LogDate . '.log';
    if (file_exists($LogFile)) {
        $FileHandle = fopen($LogFile, 'r');
        while (!feof($FileHandle)) {
            $Line = trim(fgets($FileHandle));
            //Read Line of LogFile
            if (substr($Line, -1, 1) == '-') {
                $DomainList[] = ReturnURL(substr($Line, 0, -1)) . '-';
            }
        }
    }
}