session_start();
session_register("CAPTCHA_session");
?>
ob_start();
?>
require("Lib/sqllib.stm"); ?>
require("Lib/adovbs.inc"); ?>
require("Lib/urls.inc"); ?>
require("Lib/login.inc"); ?>
$IsPageGood=true;
$GlobalMsg="";
$FailedFields="";
$pin=($_POST["pin"]);
$firstname=($_POST["firstname"]);
$lastname=($_POST["lastname"]);
$zip=($_POST["zip"]);
$maidenname=($_POST["maidenname"]);
if ($_POST["RESET"]=="CLEAR FORM")
{
$pin="";
$firstname="";
$lastname="";
$zip="";
$maidenname="";
}
if ($_POST["SUBMIT"]=="SUBMIT FORM")
{
CheckTheForm();
}
function IsBadData1($infield)
{
extract($GLOBALS);
if ($IsPageGood==false)
{
$infield=$infield.",";
if ((strpos($FailedFields,$infield) ? strpos($FailedFields,$infield)+1 : 0)>0)
{
$function_ret="";
}
}
return $function_ret;
}
function MyEmpty($instring)
{
extract($GLOBALS);
if ($_POST[$instring]=='' || strlen(trim($_POST[$instring]))==0)
{
$function_ret=true;
}
else
{
$function_ret=false;
}
return $function_ret;
}
function CheckTheForm()
{
extract($GLOBALS);
if (MyEmpty("maidenname"))
{
$GlobalMsg="Please enter your mother's maiden name.";
$FailedFields=$FailedFields."maidenname,";
$IsPageGood=false;
}
if (MyEmpty("zip"))
{
$GlobalMsg="Please enter your zip code.";
$FailedFields=$FailedFields."zip,";
$IsPageGood=false;
}
if (MyEmpty("lastname"))
{
$GlobalMsg="Please enter your last name.";
$FailedFields=$FailedFields."lastname,";
$IsPageGood=false;
}
if (MyEmpty("firstname"))
{
$GlobalMsg="Please enter your first name.";
$FailedFields=$FailedFields."firstname,";
$IsPageGood=false;
}
if (MyEmpty("pin"))
{
$GlobalMsg="Please enter your PIN number.";
$FailedFields=$FailedFields."pin#,";
$IsPageGood=false;
}
if ($IsPageGood==true)
{
InfoCheck();
}
return $function_ret;
}
function InfoCheck()
{
extract($GLOBALS);
$idquery="SELECT status FROM PVPINnums WHERE pin_s = "."'".$pin."'";
$infoquery="SELECT fname,lname,password,centername,address1,city,state,zip,phone,email,maidenname FROM PVMemberTable1 where pin_ = ".$sQuote[$pin];
$Conn=$fnADOConn["PVIEW"];
// $userIDrs is of type "ADODB.Recordset"
$rs=mysql_query($idquery);
if (mysql_num_rows($userIDrs_query)<1)
{
$GlobalMsg="The PIN number you entered is invalid.";
$FailedFields=$FailedFields."pin,";
$IsUserGood=false;
$userIDrs=null;
$Conn->Close;
$Conn=null;
}
else
if ($userIDrs["status"]="-NotInUse")
{
$GlobalMsg="The PIN number you entered is invalid.";
$FailedFields=$FailedFields."pin,";
$IsUserGood=false;
$userIDrs=null;
$Conn->Close;
$Conn=null;
}
else
{
// $infoRS is of type "ADODB.Recordset"
$rs=mysql_query($infoquery);
if ($firstname!=$InfoRS["fname"])
{
$GlobalMsg="Some or all of the information you entered is invalid.";
$IsUserGood=false;
$InfoRS=null;
$Conn->Close;
$Conn=null;
}
else
if ($lastname!=$InfoRS["lname"])
{
$GlobalMsg="Some or all of the information you entered is invalid.";
$IsUserGood=false;
$InfoRS=null;
$Conn->Close;
$Conn=null;
}
else
if ($zip!=$InfoRS["zip"])
{
$GlobalMsg="Some or all of the information you entered is invalid.";
$IsUserGood=false;
$InfoRS=null;
$Conn->Close;
$Conn=null;
}
else
if ($maidenname!=$InfoRS["maidenname"])
{
$GlobalMsg="Some or all of the information you entered is invalid.";
$IsUserGood=false;
$InfoRS=null;
$Conn->Close;
$Conn=null;
}
else
{
$emailfound=$InfoRS["email"];
$pwdfound=$InfoRS["password"];
$addressfound=$InfoRS["address1"];
$cityfound=$InfoRs["city"];
$statefound=$InfoRs["state"];
$zipfound=$InfoRs["zip"];
$phonefound=$InfoRs["phone"];
$centernamefound=$InfoRs["centername"];
$InfoRS=null;
$Conn->Close;
$Conn=null;
$IsUserGood=true;
}
}
if ($IsUserGood==true)
{
$Msg="Here Is Your Password: ".$Pwdfound;
// $Mail is of type "Persits.Mailsender"
$Mail->Host="mail.Nutech.Com";
$Mail->From=("Webmaster@Parent-View.Com");
$Mail->Fromname="Webmaster";
$Mail->Addaddress($emailfound);
$Mail->Ishtml=$Ishtml;
$Mail->Subject="Password Request";
$Mail->Body=$Msg;
$Mail->Send();
$Mail=null;
$msg=("This user forgot thier password:"."\r\n"."\r\n".
;
$firstname." ".$lastname."\r\n"."\r\n".
"Address: ".$addressfound."\r\n".
"City, State, Zip: ".$cityfound.", ".$statefound." ".$zipfound."\r\n"."\r\n".
"Phone Number: ".$phonefound."\r\n"."\r\n".
"Email: ".$emailfound."\r\n"."\r\n".
"Center Name: ".$centernamefound."\r\n"."\r\n".
"Please check on the status of this user.");
// $Mail is of type "Persits.MailSender"
$mail->Host="mail.nutech.com";
$mail->From="postmaster@nutech.com";
$mail->FromName=$firstname." ".$lastname;
$mail->AddAddress("webmaster@parent-view.com");
$mail->isHtml=$isHtml;
$mail->Subject="User Password Request";
$mail->Body=$msg;
$mail->Send();
$mail=null;
$_SESSION["PIN"]=$pin;
$_SESSION["centername"]=$centernamefound;
$_SESSION["firstname"]=$firstname;
$_SESSION["lastname"]=$lastname;
fnTrackUser("-User:ForgotPassword");
header("Location: "."pwdsent.php");
}
return $function_ret;
}
?>