[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: reset-password.php
<?php // ini_set('display_errors', 1); // ini_set('display_startup_errors', 1); // error_reporting(E_ALL); require_once 'PHPMailer/src/PHPMailer.php'; require_once 'PHPMailer/src/Exception.php'; require_once 'PHPMailer/src/SMTP.php'; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; include("functions.php"); $password = mt_rand(100000, 999999); $success_message = ""; if ($_SERVER['REQUEST_METHOD'] === 'POST') { // CSRF token validation if (!csrf_token_is_valid() || !csrf_token_is_recent()) { $success_message = "<p class='alert alert-danger text-center' role='alert'>Sorry, Token Authentication invalid.</p>"; } else { $email = sql_prep($_POST['email']); $email = dirty_html($email); $email = h($email); if (empty($email)) { $success_message = '<div class="alert alert-danger">Email is required</div>'; } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $success_message = '<div class="alert alert-danger">Valid email is required</div>'; } else { $stmt = mysqli_prepare($new, 'SELECT email FROM barber_admin WHERE email = ?'); mysqli_stmt_bind_param($stmt, 's', $email); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) < 1) { $success_message = '<div class="alert alert-danger">This email is not registered</div>'; } else { $hashed_password = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]); $stmt = mysqli_prepare($new, "UPDATE barber_admin SET password = ? WHERE email = ?"); mysqli_stmt_bind_param($stmt, 'ss', $hashed_password, $email); $update_success = mysqli_stmt_execute($stmt); if ($update_success) { // Set up PHPMailer $mail = new PHPMailer(true); // Enable exceptions try { // Server settings $mail = new PHPMailer(); $mail->addAddress($email); $mail->setFrom('noreply@thesalonfriend.com', 'thesalonfriend'); $mail->Subject = 'New Password Generated'; $mail->isHTML(true); $mail->CharSet = 'UTF-8'; // Content $mail->isHTML(true); $mail->Body = ' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Password Reset</title> </head> <body style="margin: 0; padding: 0; font-family: \'Helvetica Neue\', Helvetica, Arial, sans-serif; background-color: #f4f4f4; color: #333333;"> <table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width: 600px; margin: auto; background-color: #ffffff; border-radius: 8px; overflow: hidden; margin-top: 40px; margin-bottom: 40px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);"> <!-- Header --> <tr> <td style="padding: 0;"> <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td style="background-color: #0a2540; padding: 30px 40px; text-align: center;"> <h1 style="color:#ffffff">Thesalonfriend</h1> </td> </tr> </table> </td> </tr> <!-- Main Content --> <tr> <td style="padding: 40px 40px 20px 40px;"> <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td> <h1 style="margin: 0 0 20px 0; font-size: 28px; line-height: 32px; font-weight: bold; color: #0a2540;">Password Reset</h1> <p style="margin: 0 0 25px 0; font-size: 16px; line-height: 24px; color: #4a5568;">We\'ve generated a new password for your account.</p> <div style="background-color: #f8f9fa; border-left: 4px solid #0a2540; padding: 20px; margin-bottom: 25px; border-radius: 4px;"> <p style="margin: 0; font-size: 16px; line-height: 24px; color: #4a5568;">Your new password is:</p> <p style="margin: 10px 0 0 0; font-size: 20px; font-weight: bold; color: #0a2540; font-family: monospace;">' . $password . '</p> </div> <p style="margin: 0 0 25px 0; font-size: 16px; line-height: 24px; color: #4a5568;">For security reasons, we recommend changing this password immediately after logging in.</p> <table role="presentation" cellspacing="0" cellpadding="0" border="0" style="margin: 30px 0;"> <tr> <td style="border-radius: 4px; background-color: #0a2540; text-align: center;"> <a href="https://thesalonfriend.com/auth/index" target="_blank" style="display: inline-block; padding: 16px 36px; font-size: 16px; color: #ffffff; text-decoration: none; border-radius: 4px; font-weight: bold;">Login to Your Account</a> </td> </tr> </table> <p style="margin: 0 0 25px 0; font-size: 16px; line-height: 24px; color: #4a5568;">If you did not request this password reset, please contact our support team immediately.</p> </td> </tr> </table> </td> </tr> <!-- Security Notice --> <tr> <td style="padding: 0 40px 40px 40px;"> <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-top: 1px solid #e2e8f0; padding-top: 20px;"> <tr> <td style="padding: 0;"> <p style="margin: 0; font-size: 14px; line-height: 22px; color: #718096;"> <strong>Security Tip:</strong> Never share your password with anyone. Thesalonfriend representatives will never ask for your password. </p> </td> </tr> </table> </td> </tr> <!-- Footer --> <tr> <td style="padding: 0;"> <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background-color: #f8f9fa;"> <tr> <td style="padding: 30px 40px; text-align: center;"> <p style="margin: 0 0 15px 0; font-size: 14px; line-height: 22px; color: #718096;"> © 2024 Thesalonfriend. All rights reserved. </p> <p style="margin: 0; font-size: 14px; line-height: 22px; color: #718096;"> If you have any questions, please contact our <a href="mailto:support@thesalonfriend.com" style="color: #0a2540; text-decoration: underline;">support team</a>. </p> <p style="margin: 20px 0 0 0;"> </p> </td> </tr> </table> </td> </tr> </table> </body> </html> '; // Send email $mail->send(); $success_message = '<div class="alert alert-success">A new password has been sent to your email.</div>'; } catch (Exception $e) { $success_message = '<div class="alert alert-danger">Failed to send email. Error: ' . $mail->ErrorInfo . '</div>'; } } else { $success_message = '<div class="alert alert-danger">Failed to update password.</div>'; } } } } } ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Required Meta Tags Always Come First --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Title --> <title>Reset Password | The Salon Friend</title> <!-- Favicon --> <link rel="shortcut icon" href="../assets/icon.png" type="image/x-icon"> <link rel="icon" href="../assets/icon.png" type="image/x-icon"> <!-- Font --> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet"> <!-- CSS Implementing Plugins --> <link rel="stylesheet" href="assets/vendor/bootstrap-icons/font/bootstrap-icons.css"> <!-- CSS Unify Template --> <link rel="stylesheet" href="assets/css/theme.min.css"> </head> <body class="d-flex align-items-center min-h-100 bg-dark"> <!-- ========== MAIN CONTENT ========== --> <main id="content" role="main" class="flex-grow-1 overflow-hidden"> <!-- Content --> <div class="container content-space-t-1 content-space-t-lg-0 content-space-b-2 content-space-b-lg-0"> <div class="mx-lg-auto" style="max-width: 55rem;"> <div class="d-flex justify-content-center align-items-center flex-column min-vh-lg-100"> <!-- ========== HEADER ========== --> <header id="header" class="navbar navbar-height navbar-light mb-3"> <div class="container"> <!-- <a class="navbar-brand mx-auto" href="index.html" aria-label="Unify"> <img class="navbar-brand-logo" src="assets/svg/logos/logo-white.svg" alt="Image Description"> </a> --> </div> </header> <!-- ========== END HEADER ========== --> <div class="position-relative"> <!-- Card --> <div class="card card-shadow card-login"> <div class="row"> <div class="col-md-7"> <div class="card-body"> <form method="POST"> <?php echo csrf_token_tag(); ?> <div class="text-center"> <div class="mb-5"> <h3 class="card-title">Forgot password?</h3> </div> <?php echo $success_message;?> </div> <div class="mb-4"> <div class="row"> <div class="col-sm-12"> <div class="mb-8"> <label class="form-label">Email address</label> <input type="email" class="form-control form-control-lg" name="email" id="resetPasswordSrEmail" tabindex="1" required> </div> </div> </div> </div> <div class="d-grid gap-4"> <button type="submit" name="submit" class="btn btn-primary btn-lg">Reset password</button> <p class="card-text text-muted">Remember your password? <a class="link" href="index">Log in</a></p> </div> </form> <!-- End Form --> </div> </div> <!-- End Col --> <div class="col-md-5 d-md-flex justify-content-center flex-column bg-soft-primary p-8 p-md-5" style="background-image: url(assets/svg/components/wave-pattern.svg);"> <h5 class="mb-4">The easiest way to manage your Salon and Spa:</h5> <!-- List Checked --> <ul class="list-checked list-checked-primary list-py-2"> <li class="list-checked-item">Maintain Customer/Staff records</li> <li class="list-checked-item">Generate customized reports</li> <li class="list-checked-item">Calculate staff commissions and many more advanced features</li> <li class="list-checked-item">Run staff payroll with ease</li> </ul> <!-- End List Checked --> <span class="d-block"> <a class="link link-pointer" href="#">Learn more</a> </span> </div> <!-- End Col --> </div> <!-- End Row --> </div> <!-- End Card --> <!-- SVG Shape --> <figure class="position-absolute top-0 end-0 zi-n1 d-none d-sm-block mt-n7 me-n10" style="width: 4rem;"> <img class="img-fluid" src="assets/svg/components/pointer-up.svg" alt="Image Description"> </figure> <!-- End SVG Shape --> <!-- SVG Shape --> <figure class="position-absolute bottom-0 start-0 d-none d-sm-block ms-n10 mb-n10" style="width: 15rem;"> <img class="img-fluid" src="assets/svg/components/curved-shape.svg" alt="Image Description"> </figure> <!-- End SVG Shape --> </div> </div> </div> </div> <!-- End Content --> </main> <!-- ========== END MAIN CONTENT ========== --> <!-- JS Global Compulsory --> <script src="assets/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script> <!-- JS Implementing Plugins --> <!-- JS Unify --> <script src="assets/js/theme.min.js"></script> <script> $(document).ready(function () { window.setTimeout(function() { $(".alert").fadeTo(1000, 0).slideUp(1000, function(){ $(this).remove(); }); }, 2500); }); </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: 60.07 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