Quantcast
Channel: WHMCS Community Forums
Viewing all articles
Browse latest Browse all 13458

Is a client logged in?

$
0
0
It seems some things have changed with regard to checking the logged in status of a client from outside the WHMCS directory. Before, it all that was required was:

PHP Code:

if ($_SESSION['uid']){
  
//code here


But now WHMCS is not setting that session variable. All I need is whether the client is logged in and their user ID for integration into other services. Having looked at the documentation, I concluded that having a file within the WHMCS installation directory that contains a function for a new page was the way to go, but now it seems this prevents the rest of the page from loading.

PHP Code:

function checkLogin(){
  require(
'init.php');
  
$ca = new WHMCS_ClientArea();
  if (
$ca->isLoggedIn()){
    return array(
false$ca->getUserID());
  } else {
    return array(
falsefalse);
  }


Has anyone solved this problem? Or are there any WHMCS staff/Matt that can provide some insight into how this could work?

Thanks.

Viewing all articles
Browse latest Browse all 13458

Trending Articles