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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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