<?
/*
File: login.php
Belongs to Script Name: Burning Auth V 1.0
Author: Luca Vignaroli
Email: luca@burning.it
Description:
Burning Auth is a script to handle user authenticated access to php scripts.
The goal is quite simple: protect from unauthorized access those pages who
need to be kept under admin control, such as data/content administration and/or
members only areas on a website.
Security is achieved through a database authentication and mantained with a
Session variable set to the authenticated user's name. Every page can be protected
including the file 'shield.php'; at the beginning of it.
Check out the file README for installation instructions. This script is freeware.
*/
include ("burnauth.php");
$burn = new burnauth();
//If the Session User variable is set we let the user access the default page.
if (isset($_SESSION['user'])) {
Header("Location: admin.php");
}
/*If we are in "submit mode" for the form we check if the given Username and Password
are valid then, if successful, we let the user to the default page*/
elseif (($_REQUEST["mode"] == "submit") && ($burn->shield($_REQUEST["user"], $_REQUEST["pass"]))) {
Header("Location: admin.php");
}
//Error message and Form rendering
else {
if (($_REQUEST['mode'] == "submit") && (!$burn->shield($_REQUEST["user"], $_REQUEST["pass"]))) {
$error = "<font color=red>Access Denied</font>";
}
$burn->drawloginform($error);
}
?>
|