2 if (@$config == NULL) die ("");
4 //==============================================================
5 // Ñêðèïò âõîäà ïîëüçîâàòåëÿ
6 //==============================================================
7 if (empty($_SESSION['account_id']))
10 if(@$_POST['script'] == 'result')
12 $name = @$_POST['account_name'];
13 $username = strtoupper(@$_POST['account_name']);
14 $password = strtoupper(@$_POST['account_pass']);
16 if (empty($username) OR empty($password))
17 echo $lang['login_err_empty'];
20 $list = $rDB->selectRow("SELECT * FROM `account` WHERE `username` = ? AND `sha_pass_hash` = SHA1(?)", $username, $username.":".$password);
21 // Îæèäàåì 3 ñåêóíäû - ÷òîá ïðåäîòâðàòèòü ïîäáîð ïàðîëÿ
24 echo $lang['user_login_err_name_pass'];
27 $_SESSION['account_id'] = $list['id'];
28 $_SESSION['username'] = $list['username'];
29 echo '<a href="?user">'.$lang['user_login_succes'].'</a>';
30 echo "<script language=javascript>setTimeout(\"location.href='?user'\", 5);</script>";
38 echo '<form method="post" action="?user=login" name="acc">';
39 echo '<input type="hidden" name="script" value="result">';
40 echo '<table class=find>';
41 echo '<tr><td class=top colspan=2>';
42 echo '<table class=findtop><tr><td class=topleft> </td><td class=top>'.$lang['user_login'].'</td><td class=topright> </td></tr></table>';
44 echo '<tr><td>'.$lang['user_login_name'].'</td><td><input type="text" name="account_name" maxlength="16" size="30" value="'.@$name.'"></td></tr>';
45 echo '<tr><td>'.$lang['user_login_pass'].'</td><td><input type="password" name="account_pass" maxlength="16" size="30"></td></tr>';
46 echo '<tr><td class=bottom colspan=2><input type=submit value="'.$lang['user_login_ok'].'"></td></tr>';