/home/techb158/workloadmatch.com/includes
NameSizeModeActions
config_loader.php9630644editdlrm
CSRF_Protect.php22240644editdlrm
db_connect.php5680644editdlrm
error.php4850644editdlrm
firebase_auth.php63180644editdlrm
footer.php6170644editdlrm
forgetpassword.php108250644editdlrm
forgetpassword_Bak.php74480644editdlrm
functions.php313300644editdlrm
geoiploc.php25204350644editdlrm
header.php18040644editdlrm
hex.php10500644editdlrm
hexbin.php9420644editdlrm
login_page.php29930644editdlrm
logout.php8700644editdlrm
migrate_last_activity.php12780644editdlrm
process_login.php21190644editdlrm
psl-config-Bak.php12130644editdlrm
psl-config.php18830644editdlrm
reset.php65370644editdlrm
Edit: /home/techb158/workloadmatch.com/includes/forgetpassword_Bak.php (7448B)
verifyRequest(); // recaptcha disabled for local dev //if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){ ///////////////////your site secret key //$secret = RECAPTCHA_SECRET_KEY; //get verify response data // $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']); // $responseData = json_decode($verifyResponse); // if($responseData->success){ //$succMsg = 'Your contact request have submitted successfully.'; $url = "http://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; function getRandomStringd($length) { $validCharacters = "ABCDEFGHIJKLMNPQRSTUXYVWZ123456789"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result; } function mailresetlink($to,$token,$Teacher_SMS_Carrier){ //echo "".$to." ".$token.""; $subject = "Forgot your password"; $uri = 'https://'. $_SERVER['HTTP_HOST'] ; $message = ' Workloadmatch: Forgot your password

Dear User,


Click on the given link to reset your password Reset password


"'."Thank you for choosing Workloadmatch.".'"


'; //$headers = "MIME-Version: 1.0" . "\r\n"; //$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; //$headers .= 'From: support' . "\r\n"; ////$headers .= 'Bcc: support' . "\r\n"; $mail = new PHPMailer(true); try { //Server settings $mail->isSMTP(); $mail->Host = 'mail.workloadmatch.com'; $mail->SMTPAuth = true; $mail->Username = 'support@workloadmatch.com'; $mail->Password = getenv('SMTP_PASSWORD'); $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; $mail->Port = 465; //$to="abala@rsb.qc.ca"; //Recipients $mail->setFrom('support@workloadmatch.com', 'Workloadmatch Support'); $mail->addAddress($to); // Add a recipient // Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $message; $mail->send(); $Broker_Name="WorkloadMatch"; $Broker_Email="support@workloadmatch.com"; $messages = 'New Update on your file, please visit your profile to view it.'; mail($Teacher_SMS_Carrier, $subject, "$messages", "From: $Broker_Name <$Broker_Email>\r\n"); set_flash_msg('Success - We have sent the password reset link to your email.', 'warning'); header('Location: forgetpassword.php'); exit(); } catch (Exception $e) { set_flash_msg('Mail could not be sent. Mailer Error: ' . $mail->ErrorInfo, 'warning'); header('Location: forgetpassword.php'); exit(); } //if(mail($to,$subject,$message,$headers)){ //$Broker_Name="WorkloadMatch"; //$Broker_Email="support@workloadmatch.com"; ////echo "

Success


"; ////echo ""; //$messages = 'New Update on your file, please visit your profile to view it.'; //mail($Teacher_SMS_Carrier, $subject, "$messages", "From: $Broker_Name <$Broker_Email>\r\n"); //header('Location: forgetpassword.php?error=Success - We have sent the password reset link to your email.'); //exit(); //}else{ // //echo "

Warning


"; //header('Location: forgetpassword.php?error=Warning - Sorry, please insert correct information.'); //exit(); //} } $Emails =$_POST['email']; $Names = $_POST['userid']; $date = date('Y/m/d H:i'); $query = "SELECT * FROM teacher_profile WHERE Email = ? AND User_Name = ?"; $stmt = $mysqli->prepare($query); $stmt->bind_param('ss', $Emails, $Names); $stmt->execute(); $result = $stmt->get_result(); $Admin = $result->fetch_assoc(); $stmt->close(); if ($Admin === null) { set_flash_msg('No account found with that email and username combination.', 'warning'); header('Location: forgetpassword.php'); exit(); } $accessds = $Admin['User_Access']; $Admin_ID = $Admin['Admin_ID']; $Manager_ID = $Admin['Manager_ID']; $Master_ID = $Admin['Master_ID']; $Teacher_ID = $Admin['Teacher_ID']; $User_Type_ID = $Admin['User_Type_ID']; $First_Name = $Admin['First_Name']; $Last_Name = $Admin['Last_Name']; if($accessds != "" && $accessds != 0) { $Teacher_Phone = $Admin['Phone']; $Teacher_SMS_Carrier = $Admin['SMS_Carrier']; if($Teacher_SMS_Carrier !="") { $queryee = "SELECT * FROM sms_gateways WHERE Gateways_ID = ?"; $stmtee = $mysqli->prepare($queryee); $stmtee->bind_param('s', $Teacher_SMS_Carrier); $stmtee->execute(); $resultee = $stmtee->get_result(); $roweee = $resultee->fetch_assoc(); $stmtee->close(); $Teacher_SMS_Carrier = $roweee ? $Teacher_Phone .''. $roweee['Gateway'] : ''; } //$token=getRandomStringd(10); $token=encrypt_decrypt('encrypt', getRandomStringd(10)); //header('Location: forgetpassword.php?error='.$accessds); $tokens = encrypt_decrypt('decrypt', $token); if ($insert_stmt = $mysqli->prepare("INSERT INTO tokens (Admin_ID, Master_ID, Manager_ID, Teacher_ID,token,email,first_name,last_name,userid, date) VALUES (?,?,?,?,?,?, ?, ?, ?, ?)")) { $insert_stmt->bind_param('ssssssssss',$Admin_ID,$Master_ID,$Manager_ID,$Teacher_ID,$tokens,$Emails,$First_Name,$Last_Name,$Names,$date); // Execute the prepared query. if (! $insert_stmt->execute()) { set_flash_msg($insert_stmt->error, 'warning'); header('Location: forgetpassword.php'); //header('Location: index.php?error=Warning!'); exit(); }else { $to = $_POST['email']; if(isset($Emails))mailresetlink($to,$token,$Teacher_SMS_Carrier); set_flash_msg('We have sent the password reset link to your email.!', 'warning'); header('Location: forgetpassword.php'); exit(); } //header('Location: forgetpassword.php?error='.$mysqli->error); set_flash_msg('Sorry, please insert all information.', 'warning'); header('Location: forgetpassword.php'); exit(); } }else{ set_flash_msg('Please enter your short email address and try again.', 'warning'); header('Location: ../forgetpassword.php'); exit(); } // recaptcha else branches disabled for local dev //}else{ //header('Location: ../forgetpassword.php?error=Robot verification failed, please try again'); //exit(); //} //}else //{ // header('Location: ../forgetpassword.php?error=Please click on the reCAPTCHA box.'); // exit(); //} }