Файл: login.php
Строк: 34
<?php
include('common.php');
echo theader($lang['login']);
if(getarg('username') != NULL && getarg('password') != NULL){
if(checkpassword(getarg('username'), getarg('password'))){
$_SESSION['username'] = getarg('username');
$_SESSION['password'] = getarg('password');
$_SESSION['time'] = clean(time());
$useragent = trim(clean($_SERVER['HTTP_USER_AGENT']));
$userip = isset($_SERVER['X_FORWARDED_FOR']) ? (empty($_SERVER['X_FORWARDED_FOR']) ? trim(clean($_SERVER['REMOTE_ADDR'])) : trim(clean($_SERVER['X_FORWARDED_FOR']))) : trim(clean($_SERVER['REMOTE_ADDR']));
@mysql_query('UPDATE `users` SET `useragent` = '' . $useragent . '', `userip` = '' . $userip . '' WHERE `id` = '' . getid(getarg('username')) . '';');
echo '<div class="list2">' . $lang['loggedin'] . '</div>
<div class="list2"><a href="/index.php">' . $lang['continue'] . '</a></div>';
}else{
echo '<div class="list2">' . $lang['notloggedin'] . '<br />
<a href="/index.php">' . $lang['back'] . '</a></div>';
}
}else{
echo '<div class="list2">' . $lang['noinputdata'] . '<br />
<a href="/index.php">' . $lang['back'] . '</a></div>';
}
echo tfooter();
exit();
?>