Jump to content

Validate Login and Loggin In


alpha2x

Recommended Posts

Hi guys,

 

Hope someone can help me. I am trying to integrate as part of a script automated login into my system, I have got a far as getting ValidateLogin to return a uid and hash from the API, however I really am not sure what I am ment to do with this information, I have put it into 2 session variables as described in the wiki.

 

Any help really appreciated.

Link to comment
Share on other sites

Its fairly simple. First off, the script you using needs to be on the same domain as the WHMCS installation. Otherwise, the session variables will not work. Once you have the uid and encrypted password hash, do the following in your PHP code.

 

if (!session_id()) session_start();

$_SESSION['uid'] = $uid;
$_SESSION['upw'] = md5($uid.$passwordhash.$_SERVER['REMOTE_ADDR']);
// You're now logged in, redirect to your client area

 

 

One note, if you're using the ValidateLogin API call. I am not sure what the "passwordhash" is that is returned by that. If its simply a dump from the tblclients database table, the above should work fine. However, this may not be the case, and if this doesnt work you might need to check with support on what actually gets returned by ValidateLogin.

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