Hi,
I created a custom login page and added a hook to redirect non-logged in user to the custom login page.
Here the hook:
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPage', 1, function($vars) {
// Perform hook code here...
$client = Menu::context('client');
if (is_null($client)) {
header("Location: https://www.mysite.com/clientarea/login.html");
}
});
I tested and is working fine.
How can I exclude certain templatefile from redirecting to the custom login page? I need to exclude logout.php, pwreset.php from redirecting to the custom login page.
It seem the hook I created forces all non-logged in user that touch the clientareapage to redirect to the custom login page, including logout.php, pwreset.php etc.
Any advise?