extract($_REQUEST);
include("../../includes/incl_url-variable.php");
include("../../connect/mysql_connect.php");
include("../../connect/mysql_db.php");
if ($index=="")
{
include("login.html");
}
$x=0;
$treffer=mysql_query("SELECT * FROM admin where aktiv like '1'");
while($row=mysql_fetch_row($treffer))
{
$count2++;
}
if ($count2=="" or $count2=="0")
{
echo "";
die;
}
/*---------------------------------------------Login------------------------------------------------------------*/
if ($index=="1")
{
$treffer=mysql_query("SELECT * FROM admin where passwort = '$pass' and name = '$name' and aktiv like '1'");
while($row=mysql_fetch_row($treffer))
{
$x=1;
$time=time()+1800;
$ipadresse ="$REMOTE_ADDR";
$login=md5(uniqid(rand()));
mysql_query("UPDATE admin SET login='$login',time='$time', ip='$ipadresse' where id like '$row[0]'");
echo "";
die;
}
/*-----------------------------------------Login Negativ------------------------------------------------------*/
if ($x !="1")
{
$ip ="$REMOTE_ADDR";
$time2=time()-600;
$time3=time();
mysql_query("INSERT INTO login_neg (ip,time)Values ('$ip','$time3')");
$treffer=mysql_query("SELECT * FROM login_neg where time > '$time2'");
while($row=mysql_fetch_row($treffer))
{
$count++;
}
If ($count > 24)
{
mysql_query("UPDATE admin SET aktiv='0'");
echo "";
die;
}
echo "";
die;
}
}
?>