Hi all,
I found a post from 2016 with the following code, which no longer works. What changes would be made to allow it to work with the current code ?
Original thread -
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
function hook_ForceEveryoneToLogin($vars) {
$clientID = intval($_SESSION['uid']);
$adminID = intval($_SESSION['adminid']);
if ($adminID===0){
if (!in_array($vars['filename'], array("login","dologin","clientarea","pwreset", "register")) && $clientID===0){
header("Location: login.php");
exit;
}
}
}
add_hook("ClientAreaPage", 1, "hook_ForceEveryoneToLogin");