/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/reset.php (6537B)
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.'; $error_msg = ""; $userid = $_POST['email']; $password = filter_input(INPUT_POST, 'p', FILTER_UNSAFE_RAW); if (strlen($password) != 128) { $error_msg .= '

Invalid password configuration.

'; } $password = password_hash($password, PASSWORD_BCRYPT); $date = date('Y/m/d H:i'); $token = $_SESSION['token']; $tok_stmt = $mysqli->prepare("SELECT * FROM tokens WHERE token = ? AND used = '0'"); if ($tok_stmt) { $tok_stmt->bind_param('s', $token); $tok_stmt->execute(); $result = $tok_stmt->get_result(); $row = $result->fetch_assoc(); $tok_stmt->close(); } if (!$row) { set_flash_msg('Invalid token!', 'warning'); header('Location: reset.php'); exit(); } $email=$row['email']; $users_name=$row['userid']; $used=$row['used']; $Admin_ID = $row['Admin_ID']; $Manager_ID = $row['Manager_ID']; $Master_ID = $row['Master_ID']; $Teacher_ID = $row['Teacher_ID']; If($userid == $email && $used == 0){ $prof_stmt = $mysqli->prepare("SELECT * FROM teacher_profile WHERE Admin_ID = ? AND Master_ID = ? AND Manager_ID = ? AND Teacher_ID = ? AND Email = ? AND User_Name = ?"); if ($prof_stmt) { $prof_stmt->bind_param('ssssss', $Admin_ID, $Master_ID, $Manager_ID, $Teacher_ID, $email, $users_name); $prof_stmt->execute(); $result = $prof_stmt->get_result(); $Admin = $result->fetch_assoc(); $prof_stmt->close(); } $Username = $Admin ? $Admin['Teacher_ID'] : 0; //header('Location: reset.php?error='. $mysqli->error . '-'.$token); //header('Location: reset.php?error='. $mysqli->error . '-'.$email); //exit(); if($Username > 0){ $se="1"; $upd_stmt = $mysqli->prepare("UPDATE teacher_profile SET Password = ? WHERE Teacher_ID = ? AND Admin_ID = ? AND Master_ID = ? AND Manager_ID = ? AND Email = ?"); if (!$upd_stmt) { set_flash_msg('Password Update is failed!', 'warning'); header('Location: reset.php'); exit(); } $upd_stmt->bind_param('ssssss', $password, $Teacher_ID, $Admin_ID, $Master_ID, $Manager_ID, $email); if (!$upd_stmt->execute()) { set_flash_msg('Password Update is failed!', 'warning'); header('Location: reset.php'); exit(); } $upd_stmt->close(); $upd_stmt2 = $mysqli->prepare("UPDATE tokens SET used = ?, update_date = ? WHERE token = ?"); if (!$upd_stmt2) { set_flash_msg('Password Update is failed!', 'warning'); header('Location: reset.php'); exit(); } $upd_stmt2->bind_param('sss', $se, $date, $token); if (!$upd_stmt2->execute()) { set_flash_msg('Password Update is failed!', 'warning'); header('Location: reset.php'); exit(); } $upd_stmt2->close(); $url = "http://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $subject = "Your Password Updated"; $uri = 'https://'. $_SERVER['HTTP_HOST'] ; $message = ' Workloadmatch: Your Password Updated

Dear User,


"'."Thank you for choosing Workloadmatch. - Your password has been updated.".'"


'; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: Workloadmatch Support' . "\r\n"; //$headers = "MIME-Version: 1.0" . "\r\n"; //$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; //$headers .= 'Bcc: support' . "\r\n"; // mail($email,$subject,$message,$headers); //$mail = new PHPMailer(true); // //try { // //Server settings // $mail->isSMTP(); // $mail->Host = 'mail.workloadmatch.com'; // $mail->SMTPAuth = true; // $mail->Username = 'support@workloadmatch.com'; // $mail->Password = 'qND%cDNnI$97'; // $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"); // header('Location: index.php?err=Success - We have sent the password reset link to your email.'); // exit(); //} catch (Exception $e) { // header('Location: index.php?err=Mail could not be sent. Mailer Error: ' . $mail->ErrorInfo); // exit(); //} header('Location: index.php?err=Your password has been successfully updated!.'); exit(); }else { //header('Location: reset.php?error='.$mysqli->error); set_flash_msg('Invalid link or Password already changed!', 'warning'); header('Location: reset.php'); exit(); } }else{ set_flash_msg('Invalid link!', 'warning'); header('Location: reset.php'); exit(); } // recaptcha else branches disabled for local dev //}else{ // header('Location: ../reset.php?err=Robot verification failed, please try again'); // exit(); //} //}else //{ // header('Location: ../reset.php?err=Please click on the reCAPTCHA box.'); // exit(); //} }