(root)/login-do.php - Rev 27
Rev 483 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
<?php
require '_taios.php';
$page = new Taios_Page
('Login');
$username = $_POST['username'];
$password = $_POST['password'];
$remember = $_POST['remember'] == 'yes';
if (empty($username))
{
$page->redirect('login.php?error=No Username Specified');
}
if (empty($password))
{
$page->redirect('login.php?error=No Password Specified');
}
$user = $page->getUserByUsername($username);
if (!$user || $user->password != sha1($password))
{
$page->redirect('login.php?error=Incorrect Username or Password');
}
$expires = -1;
if ($remember)
{
$expires = time() + 60 * 60 * 24 * 30;
}
setcookie('Tim32_Login', $user->username . '|~|' . $user->password, $expires, '/');
$page->redirect('index.php');
?>