Jump to content

Recommended Posts

Im trying to use Githubs version of AutoAuth:
https://github.com/JonTheWong/whmcs-autoauth-invoice

I've followed the steps in the description, but are getting wrong login credentials error. Below you can see the different steps and the code that i have;

To install this script you need to place all files in your root directory of WHMCS
example: /home/user/public_html/domain/whmcs/
Generate a hash and enter it in configuration.php above the last ?>

$autoauthkey = "REPLACE-WITH-SYSTEM-KEY";
Also include it into the script.
You can generate a hash using; openssl rand -hex 32 on linux.
Then add this value to the top of your email template;

{assign var='hash' value=$client_email|cat:"REPLACE-THIS-PART-WITH-SECRET-KEY"}
Then add this link anywhere in your email template.
Login Auth: {$whmcs_url}lauth.php?email={$client_email}&zmkey={$hash|md5}
Invoice Auth: {$whmcs_url}iauth.php?email={$client_email}&invoice={$invoice_num}&zmkey={$hash|md5}
Quote Auth: {$whmcs_url}qauth.php?email={$client_email}&quote={$quote_number}&zmkey={$zmkey|md5}

Notes

Quick not for version 7+
Due to security settings, you have to modify configuration.php and add the following code to the bottom, above the last ?>

$smarty_security_policy = array(
    'mail' => array(
        'php_modifiers' => array(
            'md5',
            'time',
            'sha1',
            'urlencode',
            'header',

        ),
    ),
);

 

In the config file:
$hash = "302BEA0FDBC6ADB8F8A25919318B532D";
$autoauthkey = "Correct_password";
$smarty_security_policy = array(
    'mail' => array(
        'php_modifiers' => array(
            'md5',
            'time',
            'sha1',
            'urlencode',
            'header',

        ),
    ),
);

?>

 

In the iauth file:
 

<?php
/*
Created by JonTheWong @ Zenith Media Canada - www.zenithmedia.ca
Visit our public repo - https://github.com/JonTheWong/whmcs-autoauth-invoice
*/

$whmcsurl = "https://www.webbsnacks.se/whmcs/dologin.php"; /* replace with your url */
$autoauthkey = "Correct_password"; /* same as in configuration.php */
$secretkey = "A_new_key_generated"; /* generate a new key for this script */

if (md5($_GET['email'].$secretkey) != $_GET['zmkey'])
die('Något fel har skett, vänligen kontakta oss på info@webbsnacks.se för att gå vidare.');

$email = $_GET['email'];
$timestamp = time();
$hash = sha1($email.$timestamp.$autoauthkey);
$goto = "viewinvoice.php?id=".$_GET['invoice'];

$url = $whmcsurl."?email=$email&timestamp=$timestamp&hash=$hash&goto=".urlencode($goto);
header("Location: $url");
exit;
?>

 

 

Do anyone know what the issue might be? Since im not getting the "die" text, there should be nothing wrong with the hash, correct?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By sokalsondha
      Hello community...
      I came back again. Can someone help me with my system.
      What happened is..
      We sell yearly service. Let's say client bought service 01/04/2018
      And his next due date is 31/03/2019.
      Now system generate invoice on 15/03/209
       
      But he didn't paid.
      He decide to pay on may..
      I knw the service will be suspended. But it's not a problem.
      Now if he pay on may .. I see his next due date will be 31/03/2020 not 01/05/2020
       
      So he is loosing a month when he didn't used the service in April.
      Can we have a hook to update the next invoice date the customer paid+365 days? 
      Please help me
       
    • By ovi
      I'm using WHMCS 7.7.1 & WordPress.
      I have integrate WordPress with WHMCS using whmcs-bridge.
      Problem is, a client register for hosting and domain & complete the payment for the invoice but after his payment the invoice still showing unpaid.
      Note that: After payment client redirecting to client area this one working fine. Only invoice showing unpaid
      Please help me to solve it 
    • By Shivansh
      Hi Community,
      Anyone help me regard this when our client is the visit our invoice in our website prohosty.com then Rupees Symbol is working Fine See this screenshot http://prntscr.com/myl1j4 and 
      if client download invoices then rupees symbols change into "?" symbol see this screenshot http://prntscr.com/myl1r8
      Please help to fix it
    • By Esi
      Hi all
      i need to solve a problem with a wrong invoice ( obv paid from my client ) due a wrong data insert in registration from client. in my 7.5 whmcs version there's checked "Store Client Data Snapshot" option and it's working correctly, i need so ( i think that is the only way ) modify wrong data from db table mod_invoicedata.customfields and mod_invoicedata.clientdetails but value that i need to change is into a big array and i don't know how touch correctly it.
      Someone has some suggestions or workaround to solve this problem that i think could be really common after whmcs upgrade system and changing ?
      Thank you so much.
      Regards
       
       
    • By Screamfox
      Hello everyone, 

      Well i forget to put the Cron Job task in my Cpanel runing every 5 minutes so, and now after 2 month many invoices as not sent and not due or generated automatically ,the right question is how can i generate all the invoices the cron task usually create for all clients ?  Because now all the 2 month automatic invoices is not here only the transaction ID from PayPal and CoinGate, but the invoice is not created/generated by the automatic system and i have more than two thousand clients so how can i generate again all invoice and put all has payed marked pay and others unpaid if unpaid ? 
       
      I only found this issue after 2 month so now i many "automatic" invoice is not here, there is a way to generate all invoice again ? and mark payed if the transaction is on that month, or a smiliar way ? 

      Very Important
      Regards
      Screamfox 
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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