Jump to content

MrGeneral

Member
  • Posts

    8
  • Joined

  • Last visited

Everything posted by MrGeneral

  1. So sorry for the delay in visiting your solution. I didn't have time to check. [Wed Sep 20 15:45:30.008534 2023] [proxy_fcgi:error] [pid 20236:tid 140477797701376] [remote ***] AH01071: Got error 'PHP message: Stored password hash: ***PHP message: Hashed entered password: **PHP message: Password check failed for user: ***PHP message: Entered password:***', referer: https://*** It never matches, I must be doing something wrong. Any idea? My authenticate file is the following: <?php session_start(); $dbHost = "localhost"; $dbUser = "***"; $dbPassword = "***"; $dbName = "***"; $db = new mysqli($dbHost, $dbUser, $dbPassword, $dbName); if ($db->connect_error) { die("Connection failed: " . $db->connect_error); } if (!isset($_POST["email"]) || !isset($_POST["password"])) { // Redirect back to login with an error message $_SESSION['errorMessage'] = "Please provide both email and password!"; header("Location: login.php"); exit(); } $email = $db->real_escape_string($_POST["email"]); $password = $_POST["password"]; $query = $db->prepare("SELECT id, firstname, lastname, password FROM tblclients WHERE email = ?"); $query->bind_param("s", $email); $query->execute(); $result = $query->get_result(); if ($result->num_rows === 0) { // No user with this email address $_SESSION['errorMessage'] = "No user found with this email address!"; header("Location: login.php"); exit(); } $row = $result->fetch_assoc(); $storedHashedPassword = $row['password']; // Print the stored password hash and hashed entered password for debugging error_log("Stored password hash: $storedHashedPassword"); error_log("Hashed entered password: " . password_hash($password, PASSWORD_BCRYPT)); // Use password_verify to check if the provided password matches the stored bcrypt hash if (password_verify($password, $storedHashedPassword)) { // Password matches $_SESSION['clientName'] = $row['firstname'] . ' ' . $row['lastname']; $_SESSION['clientId'] = $row['id']; header("Location: welcome.php"); exit(); } else { // Log some additional information for debugging error_log("Password check failed for user: $email"); error_log("Entered password: $password"); // Redirect back to login with an error message $_SESSION['errorMessage'] = "Invalid login credentials!"; header("Location: login.php"); exit(); } ?>
  2. Forgot to add, I did try to use cc_encryption_hash as salt... both with bcrypt and sha1, didn't work.
  3. Hey there, I'm currently trying to build a frontend for WHMCS, instead of doing it via templates, as this doesn't allow exactly to change the look and feel, I'll just build a frontend, entirely separate to the WHMCS setup. So I'm trying to validate the login, the entered password never matches the stored hash... What's the stored hash/salt used for users? The tblclients have: email and password tables, trying to get this working, the hash that's entered never, never matches the one in the DB even though I'm entering it correctly. Cheers,
  4. Hi guys, Working on a template, fully customized, does anyone have the hook to display the service list, organized per subcategories, eg: shared hosting, reseller hosting, that'll be available in all WHMCS pages? Would need this as the sidebar would look fantastic with the service list there, for an easier management, and better UI experience. Maybe @brian! ? Or someone else amazing?
  5. Brian, Heard you're an expert! It's all solved - thank you. I had a string for gravatar support, and unfortunately that messed up header.tpl, it wasn't being read as the string wasn't defined as the script wasn't load. My bad. I did check the logs, but forgot to check activity logs, like, the most basic logs... RE: image, yeah, I deleted it, as support helped me checking the logs - what a newbie! :-) Cheers!
  6. Hi guys, So I've been developing a template, started from six, from the new template with the 7.7 changes, all good, until I upgraded WHMCS to v7.7. Now, WHMCS isn't loading header.tpl at all. What file references this? I assume it's an encrypted file that's referrencing this. As you can imagine, it broke my template, completely. Image here: https://i.gyazo.com/6abc7dd7ef72463219e66d0cc4c06305.png Only footer.tpl loads. Header.tpl doesn't load so no sidebar, no jquery (scripts.min.js), etc. It was working fine before the upgrade to v7.7, even though I started this template from six, with the recent changes to v7.7. I've opened a support ticket, I doubt I can get much help from there, I can't provide remote access as well as we're under GDPR in EU. It's a tough situation. Not detecting header.tpl. Even tried to set the title there manually to see if it'd load it at least, no dice. Any idea guys?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated