Jump to content

WHMCS account status from outside?


Recommended Posts

Hello all! I'm trying to get user logged-in status/session from OUTSIDE of WHMCS. I'm using latest apache, php 7.2 and WHMCS 7.8.3.

Site is on example.com and WHMCS is portal.example.com.

WHMCS directory is a subdirectory within the root of the main site ie example.com/account-management/

Using Code:

<?php

require("init.php");

$ca = new WHMCS_ClientArea();

$userid = $ca->getUserID() ;

If ($userid > 0) { $loggedin = true; }

else { $loggedin = false; }

if ($loggedin) { echo "Logged in"; }

else { echo "Not logged in"; }

?>

When calling the file directly from portal.example.com It shows as expected when logged in. 

When accessing from trying to poll getuserid.php (above code) from main site or via sub-directory, result is always 0/Logged out.

I'm sure it's an Apache or WHMCS permissions issue that my tired brain is overlooking.

 

Thanks! ❤️

 

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