/********************************************************************** * uptimes.noctumdesign.com * Copyright (c) 2002 Ryan Grove . All rights reserved. * * This script is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************** * login.php * * Take a wild guess what this does. **********************************************************************/ require_once("lib/functions.php"); require_once("lib/ui.class.php"); $ui = new infoui; $op = getVar("op"); switch($op) { case "": $ui->header(); $ui->template_open(); $ui->message("Login", "Enter your username and password to log in. Having memory trouble? Enter your username or email address, leave the password field blank, and click 'login'. We'll email your password to you."); ?>
$ui->template_close(); $ui->footer(); break; case "login": if ((isset($_POST["save"])) && ($_POST["save"] == 1)) $save = true; else $save = false; $result = userLogin(trim($_POST["user"]), $_POST["pass"], $save); if ($result === true) { header("Location: ./"); } elseif ($result == "email") { $ui->header(); $ui->template_open(); $ui->message("Password Sent", "Your password has been emailed to you. You should receive it shortly."); $ui->template_close(); $ui->footer(); } else { $ui->header(); $ui->template_open(); $ui->message("Invalid Login", "Either the password you provided was invalid or the username does not exist. Please try again."); $ui->template_close(); $ui->footer(); } break; default: echo "Wow. You certainly should never see this. Something must have gone horribly wrong."; break; } ?>