Currently Reading

Removing Login to cPanel from WHMCS 6 Client Area

As a reseller and I wanted to hide SSO logins (both Login to cPanel button in sidebar and also the Quick shortcuts in client area product details).

I searched this forum for a solution, but found only partial answers, so here I am with a good solution (which worked for me, WHMCS 6.x)

Remove Quick Shortcuts

You need FileManager / FTP for this. Copy the tpl file located at /modules/servers/cpanel/templates/overview.tpl and paste it in your template folder at the following path – /templates/yourtemplatename/modules/servers/cpanel/overview.tpl (here your template name will probably be five or six and you may need to create folders modules/servers/cpanel, because they are not present by default).

Now, edit the line # 137 to look like this (just add && 0)

{if $systemStatus == 'Active' && 0}

Basically, you have created a override template file which overrides the default functionality and removes the Quick Shortcuts etc in the client area.

Read more at Working with Module Templates

Remove Login to cPanel in Sidebar

This bit is fairly easy, no need to edit any tpl files etc. Just create an empty file at /includes/hooks folder (name it expresstech_cpanel_removal.php) and paste the following content. Done!

<?php
/**
* Remove cPanel Login from WHMCS Client Area
*
* @package    WHMCS
* @author     Express Tech <hi@expresstech.io>
* @copyright  Copyright (c) WHMCS Limited 2005-2013
* @license    http://www.whmcs.com/license/ WHMCS Eula
* @version    $Id$
* @link       http://www.whmcs.com/
*/

if (!defined("WHMCS"))
die("This file cannot be accessed directly");

use WHMCS\View\Menu\Item as MenuItem;

// Add social media links to the end of all secondary sidebars.
add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar)
{
    if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
         $primarySidebar->getChild('Service Details Actions')->removeChild('Login to cPanel');
    }

});

Read more at Client Area Sidebar Cheatsheet

Leave a Reply

Your email address will not be published. Required fields are marked *