[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: change-password.php
<?php include("functions.php"); error_reporting(0); if(request_is_post() && request_is_same_domain()) { if(!csrf_token_is_valid() || !csrf_token_is_recent()) { $response = "<p class='alert alert-danger text-center ' role='alert'>Sorry, Token Authentication invalid.</p>"; $_SESSION['response'] = $response; } else { $email = h($email); $email = dirty_html($email); $email = sql_prep($_POST['email']); $password = h($password); $password = dirty_html($password); $password = sql_prep($_POST['password']); $confirm_password = h($confirm_password); $confirm_password = dirty_html($confirm_password); $confirm_password = sql_prep($_POST['confirm_password']); $reset_token = h($reset_token); $reset_token = dirty_html($reset_token); $reset_token = sql_prep($_POST['reset_token']); if($password != $confirm_password){ $response = "<p class='alert alert-danger text-center ' role='alert'>Password do not match</p>"; $_SESSION['response'] = $response; } else { $sql = "SELECT * FROM barber_admin WHERE email = '$email'"; $result = mysqli_query($new, $sql); if (mysqli_num_rows($result) > 0) { $user = mysqli_fetch_object($result); if ($user->reset_token == $reset_token) { $password1 = password_hash($password,PASSWORD_BCRYPT, array('cost'=>12)); $reset_token1 = ''; $stmt_update_service = $con->prepare("UPDATE barber_admin SET reset_token = ?,password = ? WHERE email = ?"); $stmt_update_service->execute(array($reset_token,$password1,$email)); $response = "<p class='alert alert-success text-success ' role='alert'>Password has been changed.You can now login into your account</p>"; $_SESSION['response'] = $response; header("location:index.php"); } else { $response = "<p class='alert alert-danger text-danger ' role='alert'>Recovery email has been expired</p>"; $_SESSION['response'] = $response; header("location:index.php"); } } else { $response = "<p class='alert alert-danger text-danger ' role='alert'>Email does not exists</p>"; $_SESSION['response'] = $response; } } } } ?> <!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>Change 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"> <div class="position-relative"> <?php if(isset($_SESSION['response'])){ echo $_SESSION['response']; unset($_SESSION['response']); } ?> <!-- Card --> <div class="card card-shadow card-login"> <div class="row"> <div class="col-md-7"> <div class="card-body"> <!-- Form --> <?php if(isset($_GET['email']) and $_GET['reset_token']){ $email = sql_prep($_GET["email"]); $reset_token = sql_prep($_GET["reset_token"]); } $sql = "SELECT * FROM barber_admin WHERE email = '$email'"; $result = mysqli_query($new, $sql); if (mysqli_num_rows($result) > 0) { $user = mysqli_fetch_object($result); if ($user->reset_token == $reset_token) { ?> <form method="POST"> <?php echo csrf_token_tag(); ?> <div class="text-center"> <div class="mb-5"> <h3 class="card-title">Reset password?</h3> </div> </div> <!-- Form --> <div class="mb-4"> <label class="form-label" for="resetPasswordSrEmail" tabindex="0">New Password</label> <input type="password" class="form-control form-control-lg" name="password" required> </div> <div class="mb-4"> <label class="form-label" for="resetPasswordSrEmail" tabindex="0">Confrim password</label> <input type="password" class="form-control form-control-lg" name="confirm_password" required> </div> <input type="hidden" name="email" value="<?php echo $email;?>"> <input type="hidden" name="reset_token" value="<?php echo $reset_token;?>"> <!-- End Form --> <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> <?php } else { echo "<p class='alert alert-danger text-center ' role='alert'>Recovery email has been expired</p>"; echo '<a href="index" class="btn btn-primary">Login</a>'; } } else { echo "<p class='alert alert-danger text-center ' role='alert'>Email does not exists</p>"; echo '<a href="index" class="btn btn-primary">Login</a>'; } ?> <!-- 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: 59.7 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