<?
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# DataDivisions, Build 1.0, 12/11/2003 #
# FileName: login.php #
# File Description: #
# Sets up functionality for user to login to application #
# #
# +-----------------------------------------------------------------------+ #
# | DataDivisions - Website Statistic Visualization Software | #
# | Copyright (c) 2003, Brian Willison | #
# +-----------------------------------------------------------------------+ #
# | The contents of this file are subject to the GNU General Public | #
# | License version 2 (June 1991). This file and all its contents (incl. | #
# | functions, methods, etc.) are free for general use within any | #
# | community. This software is distributed with the intent to allow | #
# | developers the opportunity to copy, manipulate and revamp this | #
# | application in part or whole for best use cases. | #
# | | #
# | This software is distributed "AS-IS" with no warranties of any kind | #
# | either expressed or implied. | #
# | | #
# | Please refer to the GPL license document for more information: | #
# | (_docs/gplLicense.pdf) | #
# +-----------------------------------------------------------------------+ #
# | Developer, Designer, Initial Creator: | #
# | Brian Willison (hide@address.com) | #
# +-----------------------------------------------------------------------+ #
# | Initial Download Reference: | #
# | http://datadivisions.sourceforge.net | #
# +-----------------------------------------------------------------------+ #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
// Include Necessary Files
require("includes/varFile.php");
require(funcGlobalFile);
require(funcLoginFile);
// Generate Login Form
if (!isset($_POST['submit'])) {
genLoginForm(0);
}
// Check Login Credentials If Submitted
else {
$loginCheck = checkLoginForm($_POST);
// Check For Submit Error Reports
if ($loginCheck == "blankSubmit") {
genLoginForm(1);
} else if ($loginCheck == "passwordFailed") {
genLoginForm(2);
} elseif ($loginCheck == "noUserInDb") {
genLoginForm(3);
// Login/Submit Info Okay
} else {
setAppSessionCookie($loginCheck); // set session cookie with username
redirectToDisplayPage($loginCheck); // redirect to display page with username
}
}
?>