Jump to content

Auto Login users to WHMCS


joshmarty

Recommended Posts

Hi guys!

 

I am wondering if you could help me with my problem to auto login users to WHMCS. I have a system wherein I want to login my users to WHMCS whenever they want to pay my subscriptions.

I see that the ValidateLogin API function works well with this but I don't know what to do with the passwordhash that this function returns. I can already get the passwordhash but I can't see how to use this to auto-log my users to WHMCS. Any help would be greatly appreciated.. :)

Link to comment
Share on other sites

  • 3 months later...
Hi guys!

 

I am wondering if you could help me with my problem to auto login users to WHMCS. I have a system wherein I want to login my users to WHMCS whenever they want to pay my subscriptions.

I see that the ValidateLogin API function works well with this but I don't know what to do with the passwordhash that this function returns. I can already get the passwordhash but I can't see how to use this to auto-log my users to WHMCS. Any help would be greatly appreciated.. :)

 

$postfields = array();

$postfields["action"] = "getclientpassword";

$postfields["userid"] = $uid; //assume you called validatelogin and got the user id

 

$response = whmcs_request($postfields); // make a request to the API

 

$upw = $response['password'];

 

$_SESSION['uid'] = $uid;

$_SESSION['upw'] = md5( $uid . $upw . $_SERVER['REMOTE_ADDR']);

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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