41 lines
659 B
PHP
41 lines
659 B
PHP
|
|
<?php
|
|
require_once 'config.php';
|
|
require_once 'helper.php';
|
|
if(isset($_GET))
|
|
{
|
|
$res=$res_default;
|
|
$sel=0;
|
|
$nombre=isset($_GET['nombre']) ? trim($_GET['nombre']): null;
|
|
//isset($_GET['nombre']) ? trim($_GET['nombre']): null;
|
|
|
|
foreach ($denegados as $pc)
|
|
{
|
|
if($pc==$nombre)
|
|
{ $res='NO';
|
|
$sel=1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if($sel == 0)
|
|
{
|
|
foreach ($permitidos as $pc)
|
|
{
|
|
if($pc==$nombre)
|
|
{ $res='OK';
|
|
$sel=1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
$datos=date('Y-m-d H:i:s').';'.getUserIP().';'.$nombre.';'.$res. PHP_EOL;
|
|
|
|
$logfile = date('Y-m-d') . '.csv';
|
|
$file1 = fopen("log/" . $logfile, "a");
|
|
fwrite($file1, $datos);
|
|
fclose($file1);
|
|
echo $res;
|
|
|
|
} |