Jump to content

Cannot find where to disable "Login to cPanel" and "Login to Webmail" links under "Actions" tab


bpotter

Recommended Posts

I have been searching for hours through templates and the entire codebase to find where to remove the "Login to cPanel" and "Login to Webmail" links under "Actions" in the "Product Details" page. Has anyone done this that can tell me what files to edit? I'm using the "Six" template. Thank you.

 

For reference:

 

Remove Links.png

Link to comment
Share on other sites

Hooks will do this for you. this can't really be done through WHMCS directly itself

For this specific action, create a php file in whmcs/includes/hooks/ . I called mine cPanellogin.php, but you can call it whatever you like. Put the following

<?php

<?php
use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)  
{
   if (!is_null($primarySidebar->getChild('Service Details Actions'))) {            
  $primarySidebar->getChild('Service Details Actions')
       ->removeChild('Login to cPanel');
  $primarySidebar->getChild('Service Details Actions')
       ->removeChild('Login to Webmail');
}
});


?>

 

Make sure to take a look through the linked documentation page for more tips on sidebar menu hooks.

Link to comment
Share on other sites

  • 1 year later...

I used this code and it started working.  Which is the same above?  I don't know.:wall1:

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->removeChild('Login to Webmail'); 
   }
});

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated