Файл: input.php
Строк: 19
<?
include('core/core.php');
include('style/head.php');
$get_login = check($_GET['login']);
$get_pass = check($_GET['pass']);
if(!empty($get_login) && !empty($get_pass)){
$pass = sha1(md5(md5(sha1($get_pass))));
$user = DB::run() -> queryFetch("SELECT * FROM `users` WHERE `login`=? LIMIT 1",array($get_login));
if(!empty($user['login']) && $pass == $user['pass']){
$save = check($_REQUEST['save']);
if($save == 1){
setcookie("login",$user['login'],time()+(86400 * 30),'/');
setcookie("pass",$user['pass'],time()+(86400 * 30),'/');
} else {
setcookie("login",$user['login'],time()+3600,'/');
setcookie("pass",$user['pass'],time()+3600,'/');
}
$ip = preg_replace('|[^0-9.]|', '', $_SERVER['REMOTE_ADDR']);
DB::run() -> query("UPDATE `users` SET `last`=?,`ip`=? WHERE `login`=?",array(times(),$ip,$user['login']));
header ('location: /');
}
}
include('style/foot.php');
?>