start();
$user->setup();
$auth->acl($user->data);
// End session management
$redirect = $username = $password = '';
extract($_GET);
extract($_POST);
// Do the login/logout/form/whatever
if (isset($login) || isset($logout))
{
if (isset($login) && $user->data['user_id'] == ANONYMOUS)
{
$autologin = (!empty($autologin)) ? true : false;
$viewonline = (!empty($viewonline)) ? 0 : 1;
// Is the board disabled? Are we an admin? No, then back to the index we go
if (!empty($config['board_disable']) && !$auth->acl_get('a_'))
{
redirect("index.$phpEx$SID");
}
if (($result = $auth->login($username, $password, $autologin, $viewonline)) !== true)
{
// If we get a non-numeric (e.g. string) value we output an error
if (!is_numeric($result))
{
trigger_error($result, E_USER_ERROR);
}
// If we get an integer zero then we are inactive, else the username/password is wrong
$message = ($result === 0) ? $user->lang['ACTIVE_ERROR'] : $user->lang['LOGIN_ERROR'];
$message .= '