<? 
/* Авторизация */
$_db_inc_ = true;
include("engine/scripts/cfg.php");

$login = htmlspecialchars($_POST['m_login']);
$password = htmlspecialchars($_POST['m_password']);
$login_result = mysql_query("SELECT `login` FROM `user` WHERE `login`='$login' AND `password`='".base64_encode(pack('H*', sha1($password)))."'"); 

if(!mysql_error() && @mysql_num_rows($login_result) == 1) 
	{  
		session_set_cookie_params(180000, "/");  session_start();
		$_SESSION["LineageLogin"] = $login;
		$_SESSION["LineagePassword"] = base64_encode(pack('H*', sha1($password)));
		header("Location: l2.php"); 
		exit; 
	}
else if (!mysql_error()) 
	{
		header("Location: login.php?id=1"); 
	} 
else 
	{
		echo mysql_error(); 
	}
?>