Alessandro1992 Posted May 30, 2018 Share Posted May 30, 2018 I created a custom page by adding in the WHMCS root assistenza-clienti.php with this code: <?php use WHMCS\ClientArea; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Assistenza clienti'); # Define the template filename to be used without the .tpl extension $ca->setTemplate('assistenza-clienti'); $ca->output(); ?> I created a custom page assistenza-clienti.tpl in the root of my custom template. The page works but when the client logging in the header dosen't see that the client is still logged in. An Example as shown into attached image. Please Help Me 0 Quote Link to comment Share on other sites More sharing options...
Neklawy Posted May 31, 2018 Share Posted May 31, 2018 I think should be adding $ca->requireLogin(); to above page code Regards 0 Quote Link to comment Share on other sites More sharing options...
Alessandro1992 Posted May 31, 2018 Author Share Posted May 31, 2018 Sorry this is not good, the page should be seen even if you are not logged in. But if logged it must show the menu as in the image. It is very strange, even if I am logged in as a customer if I visit, for example, the main page (home) and the other default pages, these show the menu as in the picture. As soon as I go to the custom Assistenza Clienti page, I show the menu as if I am not logged in. But in reality they are. 0 Quote Link to comment Share on other sites More sharing options...
Alessandro1992 Posted June 6, 2018 Author Share Posted June 6, 2018 No solution for my problem? 0 Quote Link to comment Share on other sites More sharing options...
Alessandro1992 Posted June 6, 2018 Author Share Posted June 6, 2018 Hi, I've added this code into assistenza-clienti.php but into primary menu dasen't show the first name. // Check login status if ($ca->isLoggedIn()) { /** * User is logged in - put any code you like here * * Here's an example to get the currently logged in clients first name */ $clientName = Capsule::table('tblclients') ->where('id', '=', $ca->getUserID())->pluck('firstname'); // 'pluck' was renamed within WHMCS 7.0. Replace it with 'value' instead. // ->where('id', '=', $ca->getUserID())->value('firstname'); $ca->assign('clientname', $clientName); } else { // User is not logged in $ca->assign('clientname', 'Random User'); } 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.