// -------------------------------------------------------------
// File Members.html
// Desc : Displays the login page and the main menu of the
// members area.
// -------------------------------------------------------------
// Include the session settings and start the session
require_once("SessionSettings.php");
session_start();
require_once ("Admin/DatabaseConnection.php");
require_once ("Admin/Crypt.php");
require_once ("Admin/emailer.php");
require_once ("NavBar.php");
// CReate databse connection
$dbHandle=ConnectToMySql();
ConnectToDatabase("mrgamem_beegeesstory",$dbHandle);
$Command="";
$MSG="";
$Email="";
// Fetch paramaters from Get and Post arrays
if (isset( $_POST['Command'])) $Command = trim( $_POST['Command'] );
if (isset( $_POST['Email'])) $Email = trim( $_POST['Email'] );
// Lets just check the person is already logged in otherwise send them to the members page
if (isset($_SESSION['UserID']))
{
$UserID= $_SESSION['UserID'];
// A session ID is set so lets check it exists
$dbResult = mysql_query("select * from users where ID=".$UserID." limit 1", $dbHandle);
// If the id is valid then relocate to the members area
if ($dbResult && mysql_num_rows( $dbResult))
{
header("Location: Members.html");
exit();
}
}
// If this is a login command
if ($Command=="SendPassword")
{
if ( $Email=="" || strlen($Email)<3 ) $MSG="Error: The email fields were filled in incorrectly.";
// If MSG=="" then everything is still ok so we proceed with the database test
if ($MSG=="")
{
$CryptEmail = EncryptString( $Email , "Dallas" );
// Lets see if this sucker exists
$dbResult = mysql_query( "SELECT * FROM users WHERE Email='".$CryptEmail."' LIMIT 1 ",$dbHandle);
// if not found then compse error message
if ( !mysql_num_rows( $dbResult ) ) $MSG="Error: No account exists for this Email Address";
else
{
$User = mysql_fetch_object($dbResult);
$HTMLText="
Jive Talkin - The Bee Gee Story
The Smash Hit Theatre Show
Dear Member,
This email has been sent to you because a password reminder was requested for this email address on the www.beegeesstory.co.uk website.
Password : ".DecryptString($User->Password, 'Dallas')."
Kind Regards
Jive Talkin - Customer Support
http://www.beegeesstory.co.uk";
// Create the emailer object
$Emailer = new CEmailer();
// Setup constant email data
$Emailer->SetFromName("Jive Talkin - The Bee Gees Story");
$Emailer->SetSubject("Password Reminder");
$Emailer->SetFromAddress("contactus@beegeesstory.co.uk");
$Emailer->SetBodyText ( $HTMLText , $HTMLText );
$Emailer->SetToName (stripslashes($User->DisplayName));
$Emailer->SetToAddress ($Email);
$Emailer->Send();
$MSG="Your password has been emailed to
".$Email;
}
}
}
OpenPage("Password","","Jive Talking Bee Gees Tribute Band - Password Reminder");
?>