View file sea/input.php

File size: 3Kb
<?
#-----------------------------------------------------#
#     ============ЗАГРУЗ-ЦЕНТР=============           #
#             	 Автор  :  Sea                   	  #
#               E-mail  :  [email protected]              #
#                  ICQ  :  355152215                   #
#   Вы не имеете права распространять данный скрипт.  #
#   		По всем вопросам пишите в ICQ.            #
#-----------------------------------------------------#
include 'moduls/ini.php';
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
session_name ('SID') ;
session_start() ;
include 'moduls/fun.php';
include 'moduls/connect.php';
$info = mysql_fetch_array(mysql_query("SELECT * FROM `loginlog` WHERE `id`='1';"));
$timeban = $time - $info['time'];
//-------------------------------
if($timeban < $setup['timeban'] ) {include "moduls/header.php"; die ("Следующая авторизация возможна через ".($setup['timeban']-$timeban)." секунд!"); }
//-------------------------------
if($info['access_num'] > $setup['countban'])
{
	include "moduls/header.php";
	$query = mysql_query("UPDATE `loginlog` SET `time`='".$time."', `access_num`='0' WHERE `id` = '1';");
	die ("Вы $setup[countban] раза ввели неверный пароль.Вы заблокированы на $setup[timeban] секунд");
}
//-------------------------------
//if ($_SESSION['autorise']!="" && $_SESSION['ip']!="" && $_SESSION['autorise']==$setup['password'] && $_SESSION['ip']==$ip)  header("Location: apanel.php?".SID."");
if(!isset($_POST['p']) and !isset($_GET['p']))
{
	include "moduls/header.php";
	echo '
<div class=mainzag>Вход для администратора:</div><div class=row>
<form method="post" action="input.php">
Пароль: <br>
<input class=enter type="password" name="p"> <br><br>
<input class=buttom type="submit" value="Войти" >
</form></div>';
list($msec,$sec)=explode(chr(32),microtime());
echo '<hr noshade size=1 class=hr>'.round(($sec+$msec)-$HeadTime,4).' сек.<br>&copy;[Sea][2007]</body></html>';
exit;
}
if((isset($_POST['p']) && $_POST['p']!="" && md5(clean($_POST['p'])) == $setup['password']) or ($setup['autologin']==1 && isset($_GET['p']) && $_GET['p']!="" && md5(clean($_GET['p'])) == $setup['password']))
{
	$ua = getenv("HTTP_USER_AGENT");
	$ua = substr($ua,0,50);
	$ipu = $ip;
	$query = mysql_query("INSERT INTO `loginlog` (`ua`, `ip`, `time`) VALUES ('".clean($ua)."', '".clean($ip)."', '".clean($time)."');");
	$autorise = md5(clean($_POST['p']));
	session_register("autorise");
	session_register("ipu");
	header ("Location: apanel.php?".SID."");
}
else
{
	include "moduls/header.php";
	print "Пароль введен неверно.Осталось попыток до блокировки: ".($setup['countban']-$info['access_num'])."";
	$query = mysql_query("UPDATE `loginlog` SET `access_num`='".($info['access_num']+1)."' WHERE `id` = '1';");
}
?>