Jump to content
benneth

How To Disable Cpanel Functions in WHMCS Customer Portal?

Recommended Posts

I'd like to disable any access to cpanel functions in the client portal. See screenshot.

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?

disable-cpanel-functions-in-whmcs-client-portal.JPG

Share this post


Link to post
Share on other sites

Thanks John. I presume this is where the front end customization happens (html, php hooks)?

If I do remove these menu elements from the user portal, how can I be sure that users are unable to login to cpanel (and not just from the front-end)?

Share this post


Link to post
Share on other sites
7 hours ago, benneth said:

how can I be sure that users are unable to login to cpanel (and not just from the front-end)? 

Never tell the user about the login.

Share this post


Link to post
Share on other sites
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. 🙂

Share this post


Link to post
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;
}

Share this post


Link to post
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.

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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