Jump to content

How To Disable Cpanel Functions in WHMCS Customer Portal?


Recommended Posts

On 2/21/2020 at 10:38 AM, benneth said:

I'd like to disable any access to cpanel functions in the client portal. I don't want customers trying to create emails, view databases, see the file manager. I want all of these functions disabled/hidden. How do you do this? 

just to expand on the previous advice given to edit the original overview.tpl file, there is no point in doing that as any changes you make to the template will be overwritten during a WHMCS update...

you could duplicate the template in your template folder and edit the duplicate version and that should be safe from the updater.

https://docs.whmcs.com/Working_with_Module_Templates

Quote

To create an override template, simply make a copy of the original template file within the following folder structure inside your custom template: /templates/yourtemplatename/modules/moduletype/modulename/.

For example, in the case of the provisioning module "cpanel", /modules/servers/cpanel/overview.tpl could be customised by creating the following template file: /templates/yourtemplatename/modules/servers/cpanel/overview.tpl

you would also have to hide the two cpanel links in the sidebar - ideally, that would require an action hook and i've previously posted examples of how to remove those links.

possibly in your case, as you seem to be using Six, you could kill two birds with one stone and use custom CSS code (in /templates/(active theme)/css/custom.css) to hide the cPanel sidebar links and also the Quick Shortcuts table too.

#cPanelQuickShortcutsPanel,
#Primary_Sidebar-Service_Details_Actions-Login_to_cPanel,
#Primary_Sidebar-Service_Details_Actions-Login_to_Webmail {display:none;}

just remember to keep a copy of the custom.css file in case you haven't renamed the Six template and the WHMCS updater overwrites it. 🙂

Link to comment
Share on other sites

Hey Brian,

I've been messing with CSS. Some lines work, some don't. 

 

Any suggestions? Here's my custom.css

 

/* Public View - Hide Elements */
body > div.home-shortcuts,
#home-banner
{
    display: none !important;
}

/* Client View - Hide Main Nav Elements */

#Primary_Navbar-Support-Network_Status,
#Primary_Navbar-Support-Knowledgebase,
#Primary_Navbar-Billing-Mass_Payment,
#Primary_Navbar-Services-View_Available_Addons,
#Secondary_Navbar-Account-Email_History 
{
     display: none !important;
}

/* Client View - Hide Sidebar Elements */
#main-body > div > div > div:nth-child(2) > div,
#Secondary_Sidebar-My_Services_Actions-View_Available_Addons,
#main-body > div > div > div:nth-child(2) > div,
#main-body > div > div > div.col-md-3.pull-md-left.sidebar.sidebar-secondary > div:nth-child(1),
#main-body > div > div > div:nth-child(2) > div,
#Secondary_Sidebar-Billing-Mass_Payment,
#Secondary_Sidebar-Support-Knowledgebase,
#Secondary_Sidebar-Support-Network_Status,
#Secondary_Sidebar-My_Services_Actions-View_Available_Addons,
#Primary_Sidebar-Announcements_Months-RSS_Feed
#btnShowSidebar,
#Primary_Sidebar-My_Account-Email_History
{
    display: none !important;
}

/* HEADER STYLING */
#nav 
{
    background: red !important;
}

Link to comment
Share on other sites

1 hour ago, benneth said:

Hey Brian,

I've been messing with CSS. Some lines work, some don't. 

 

Any suggestions? Here's my custom.css

 

/* Public View - Hide Elements */
body > div.home-shortcuts,
#home-banner
{
    display: none !important;
}

/* Client View - Hide Main Nav Elements */

#Primary_Navbar-Support-Network_Status,
#Primary_Navbar-Support-Knowledgebase,
#Primary_Navbar-Billing-Mass_Payment,
#Primary_Navbar-Services-View_Available_Addons,
#Secondary_Navbar-Account-Email_History 
{
     display: none !important;
}

/* Client View - Hide Sidebar Elements */
#main-body > div > div > div:nth-child(2) > div,
#Secondary_Sidebar-My_Services_Actions-View_Available_Addons,
#main-body > div > div > div:nth-child(2) > div,
#main-body > div > div > div.col-md-3.pull-md-left.sidebar.sidebar-secondary > div:nth-child(1),
#main-body > div > div > div:nth-child(2) > div,
#Secondary_Sidebar-Billing-Mass_Payment,
#Secondary_Sidebar-Support-Knowledgebase,
#Secondary_Sidebar-Support-Network_Status,
#Secondary_Sidebar-My_Services_Actions-View_Available_Addons,
#Primary_Sidebar-Announcements_Months-RSS_Feed
#btnShowSidebar,
#Primary_Sidebar-My_Account-Email_History
{
    display: none !important;
}

/* HEADER STYLING */
#nav 
{
    background: red !important;
}

// EDIT // Yes, I have clicked "Empty Template Cache" after making the css updates.

Link to comment
Share on other sites

Hi @benneth

3 hours ago, benneth said:

I've been messing with CSS. Some lines work, some don't. 

it might have been slightly helpful if you had mentioned which ones worked and which didn't! 🙄

from quick testing, I think they would all work apart from the nth child sidebars and the simplistic navbar colour change.

if you intend to remove all sidebars from a particular page, then you're probably better off using a hook because simply hiding with css wouldn't allow the page width to adjust (unless you prefer it not to adjust).

additionally, some of the sidebar children are conditional and therefore there would be no guarantee when removing them with nth child that you could specify them accurately with css.

with regards to navbar colouring, then you will need to tweak the active/focus etc colours too...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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