Source for file login.php
Documentation is available at login.php
* This file displays the login form for HRDI users.
* This file is part of HRDIODB.
* HRDIODB 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.
* HRDIODB 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 HRDIODB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
/** Configuration file */
require_once("conf.php");
/** HRDI database class */
require_once("hrdi_db_class.php");
require_once("session_class.php");
require_once("user_class.php");
require_once("common_class.php");
/** Debugging functions */
require_once("debugging.php");
// Create class instances
$user = new user ($hdb, $session);
// If we're already authenticated, go back to where we were
if ($user->authenticated()) {
$session->go_to_last_page();
// Perform the login procedure
if (isset ($_POST['login'])) {
if ($user->authenticate($_POST['email'], $_POST['password'])) {
// We're successfully authenticated. Magically go back to where we were.
$session->go_to_last_page();
// Include the page header
require_once("header.php");
// Print out the login form
<form name="login_form" method="post" action=" <?php print $_SERVER['PHP_SELF']; ?>">
<td colspan="2" align="center"><b>HRDI User Login</b></td>
<td align="right">E-mail:</td>
<td><input type="text" name="email" size="20" maxlength="255" value=" <?php print common::get_value('email', $_POST)?>"></td>
<td align="right">Password:</td>
<td><input type="password" name="password" size="20"></td>
<td colspan="2" align="right"><input type="submit" name="login" value="Login"></td>
<li><a href="passreset.php">I forgot my password</a></li>
<li><a href="user.php?mode=register">Register</a></li>
<script type="text/javascript">
<?php // Grab the focus and smack it in the e-mail input box ?>
document.login_form.email.focus();
// Include the page footer
require_once("footer.php");
|