session_start();
header("Cache-control: private"); //IE 6 Fix
$_SESSION['McMember_CurrentPage'] = "";
$_SESSION['McMember_CurrentPage'] = 1;
$_SESSION['McMember_SpecialTitle'] = "Reset Password";
// VALIDATE THAT THE USER IS ABLE TO CREATE MEMBERS.
// include "ValidateMember.php";
// Gets rid of all the error reporting on servers which are not configured appropriately.
error_reporting(E_ALL ^ E_NOTICE);
include "MakeRand.php";
function Encrypt($string) {//hash then encrypt a string
$crypted = crypt(md5($string), md5($string));
return $crypted;
}
// Get the PHP file containing the DbConnector class
require_once('DbConnector.php');
// Create an instance of DbConnector
$connector = new DbConnector();
$thehiddenSubmitter = $_POST['hiddensubmitter'];
$MemID=$_POST['MemID'];
$theNewMemId = $MemID;
If ($thehiddenSubmitter == "pookachoo"){
// UPDATE THE USER ID AND PASSWORD FOR THE NEW MEMBER
// -----------------------------------------------------------------
// GENERATE THE PASSWORD
$UserString = str_makerand(6,8,0,0,0);
$UserPass = Encrypt($UserString);
// ASSIGN THE DATA TO SESSION DETAILS
$_SESSION['McMember_UserPass'] = $UserString;
$_SESSION['McMember_UserHash'] = $UserPass;
echo " The New Password is : ".$_SESSION['McMember_UserPass']." ";
// UPDATE THE MEMBER RECORD IN THE DATABASE
$qVals15 = "UPDATE mem SET UPASS='".$UserPass."' WHERE MemId=".$theNewMemId;
$result15 = $connector->query($qVals15);
// TODO -----------------------------------------------------------------
// SEND THE NEW MEMBER A MAIL NOTIFICATION ASKING
// THEM TO ACTIVATE THEIR ACCOUNT
// SEND THE UID AND PASS TO THEM
// mail("scott@204.209.81.227", "My Subject", "Line 1\nLine 2\nLine 3","From:frbob@foo.com");
echo $_SESSION['McMember_UserPass'];
// echo $_SESSION['McMember_UserHash'];
// TODO -----------------------------------------------------------------
echo "The password has been changed. Click here to continue.";
// header("Location: ViewMembers.php?MCID=2");
}
$qVals11 = "SELECT * FROM oda LEFT JOIN mem ON oda.MemId = mem.MemID WHERE OrgId =".$_SESSION['McMember_OrgId']." AND mem.Deleted=0 ORDER BY mem.FirstName";
// echo $qVals11;
$result = $connector->query($qVals11);
$nrows = mysql_num_rows($result);
?>