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:
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.
Has anyone solved this problem? Or are there any WHMCS staff/Matt that can provide some insight into how this could work?
Thanks.
PHP Code:
if ($_SESSION['uid']){
//code here
}
PHP Code:
function checkLogin(){
require('init.php');
$ca = new WHMCS_ClientArea();
if ($ca->isLoggedIn()){
return array(false, $ca->getUserID());
} else {
return array(false, false);
}
}
Thanks.