WHMCS auto login

Instalado sem funcionar no dog e no ave

Em desenvolvimento no dog

Ficheiros

auth.php
includes/hooks/autologin_email.php

Placeholders

{$whmcs_url}/auth.php?email={$client_email}&userid={$client_id}&firstname={$client_first_name}&lastname={$client_last_name}&hash={$hash}&whmcsurl={$whmcs_url}&goto=viewinvoice.php?id={$invoice_id}
{$whmcs_url}/auth.php?email={$client_email}&userid={$client_id}&firstname={$client_first_name}&lastname={$client_last_name}&hash={$hash}&whmcsurl={$whmcs_url}&goto=viewticket.php?tid={$ticket_id}%26c={$ticket_c}

Links

WHMCS Auto login

Responder a: Hash inválido

Hash inválido


Another implementation

http://www.whmcsjet.com/autologin-link-in-whmcs-email/

On email templates

Click below to login automatically:
{assign var=’hash’ value=$client_email|concat:”your_secret_key”}

http://yourdomain.com/autologin.php?email={$client_email}&hash={$hash|md5}

File whmcsRoot/auth.php

# Define WHMCS URL & AutoAuth Key
$whmcsurl = "http://yourdomain.com/dologin.php";
$autoauthkey = "auto_auth_key"; #AutoAuth Key, ATTENTION: should be defined in configuration.php aswell!
$secret_key = "your_secret_key"; #Should be same as you defined in email template
 
if (md5($_GET['email'].$secret_key) != $_GET['hash'])
die();//dying here because hash is not equal
 
$timestamp = time(); # Get current timestamp
$email = $_GET['email']; # Clients Email Address to Login
$goto = "clientarea.php"; # Here you can set default user page
 
$hash = sha1($email.$timestamp.$autoauthkey); # Generate Hash
 
# Generate AutoAuth URL & Redirect
$url = $whmcsurl."?email=$email&timestamp=$timestamp&hash=$hash&goto=".urlencode($goto);
header("Location: $url");
exit;