Jump to content
jpmaster

Login to cPanel & Webmail on Client Product Details

Recommended Posts

Hello,

 

We are using 6.0.1 and came to our attention that the links on the Clients Product Details to login to cPanel and Webmail do not work correctly. Where can we find those lines of code to correct them?

 

We have looked around without luck all over the six template .tpl files.

 

Thanks for your great help.

 

Regards,

Share this post


Link to post
Share on other sites

Thanks, this was of great help. Now, how can I link it to each domain?

 

I have tried this code without luck:

 

<?php

 

if (!defined("WHMCS"))

die("This file cannot be accessed directly");

 

use WHMCS\View\Menu\Item as MenuItem;

 

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)

{

$primarySidebar->getChild('Service Details Actions')

->getChild('Login to cPanel')

->setUri('http://{$domain}/cpanel');

});

Share this post


Link to post
Share on other sites

Bah,

 

When hiding the item from the sidebar it produces a blank page on any other client area page....

 

Too bad for WHMCS

Share this post


Link to post
Share on other sites

try the hook below if you want to change the cpanel and webmail links.... it took me all afternoon to work this out (thanks to WHMCS and their lack of relevant documentation!). :roll:

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;

if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to cPanel')
                           ->setUri('http://'.$domain.'/cpanel');
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to Webmail')
                           ->setUri('http://'.$domain.'/webmail');
   }
});

obviously, because you're linking directly to these URLs, you can't use Single Sign-On - so the user will need to enter their username and password to log into cpanel/webmail.

  • Thanks 1
  • Confused 1

Share this post


Link to post
Share on other sites
try the hook below if you want to change the cpanel and webmail links.... it took me all afternoon to work this out (thanks to WHMCS and their lack of relevant documentation!). :roll:

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;

if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to cPanel')
                           ->setUri('http://'.$domain.'/cpanel');
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to Webmail')
                           ->setUri('http://'.$domain.'/webmail');
   }
});

obviously, because you're linking directly to these URLs, you can't use Single Sign-On - so the user will need to enter their username and password to log into cpanel/webmail.

 

Thanks for your great help. WHMCS really needs to have more relevant and accurate documentaton!

 

It does not matter if the user has to type login info, what really matters is the user being taken where he/she needs to go!

Share this post


Link to post
Share on other sites

I ran into an issue with this hook today - it works fine on a product linked to cPanel, but with other products it shows a blank page.

 

with the assistance of sentq, I was able to tweak it to work correctly.

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;
$servertype = $service->product->servertype;

# Not cPanel, no links added
   if ($servertype!="cpanel"){
       return;
   }

   if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to cPanel')
                           ->setUri('http://'.$domain.'/cpanel');
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to Webmail')
                           ->setUri('http://'.$domain.'/webmail');
   }

});

  • Like 1

Share this post


Link to post
Share on other sites
On 8/22/2015 at 10:29 PM, brian! said:

try the hook below if you want to change the cpanel and webmail links.... it took me all afternoon to work this out (thanks to WHMCS and their lack of relevant documentation!). :roll:

 

 


<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;

if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to cPanel')
                           ->setUri('http://'.$domain.'/cpanel');
            $primarySidebar->getChild('Service Details Actions')
                           ->getChild('Login to Webmail')
                           ->setUri('http://'.$domain.'/webmail');
   }
});
 

 

obviously, because you're linking directly to these URLs, you can't use Single Sign-On - so the user will need to enter their username and password to log into cpanel/webmail.

You're a marvel! thank you very much

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Similar Content

    • By Troy
      Since WHMCS is owned by cPanel can't you guys use the same algorithm for password strength? I have 90 set as a value in General Settings -> Minimum User Password Strength and 80 set for password strength in cPanel, and STILL there are passwords that will get through the WHMCS check but be rejected by cPanel.
      It's driving users (and me) crazy! I'm going to push the WHMCS setting up to 95 or maybe 100, but with the same ownership of both products you would think matching values on both sides would do the trick.
    • By HarryAdney
      Hi everyone,
       
      I created an account for a new client. I set them up with package 1. I later changed it to package 2, which shows fine in WHMCS client profile, however, in cPanel they are still provisioned with the original package.
      What do?
      Thanks.
    • By artaweb
      Hello,
      following this topic:
      What are the tags I need to use for Nameservers within template files? 
      Tried {$service_ns1} & {$service_ns2} but no luck. 
      Is there a cheatsheet for these tags? 
    • By ModulesGarden
      1. We are tremendously proud to announce that cPanel Extended For WHMCS, our absolutely bestselling module dedicated to all aspiring web hosting providers has just got even better. 
      The most essential addition to the newest 3.5.0 version that your clients will promptly and eagerly discover is the support for application cloning and staging that will let them create a copy of any application installed via Softaculous, and push the staging application to live whenever ready. Moreover, what has been greatly facilitated for your audience is the management of connected email accounts. Not only will they now be able to access all essential details of their email accounts with just a single click but set a new password for existing mailing lists from the client area directly as well when needed. Finally, they have been enabled to access the previously generated CSR key by simply navigating to the "SSL/TLS Management" section. 
      While this is no doubt a good amount of novelties to pick and choose from, still more await your attention on our website. 
      Learn more about cPanel Extended For WHMCS 3.5.0!
       
      2. Interested in the headway we have made in establishing compatibility between our modules and the latest WHMCS environment so far? Have a quick look at the record of our most recent updates, and view the complete WHMCS V7.7 modules support list as well! 

      Proxmox Cloud For WHMCS - 2.5.2 Proxmox VPS For WHMCS - 2.5.2 Unban Center For WHMCS - 2.1.3 DirectAdmin Extended For WHMCS - 3.0.2 Rackspace Email Extended For WHMCS - 1.2.10 Zendesk For WHMCS - 2.1.1


      Need Custom Software Development For Your Business?

      Get Your Free Quote Now!


      Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By Screamfox
      Hello everyone, 

      Well i forget to put the Cron Job task in my Cpanel runing every 5 minutes so, and now after 2 month many invoices as not sent and not due or generated automatically ,the right question is how can i generate all the invoices the cron task usually create for all clients ?  Because now all the 2 month automatic invoices is not here only the transaction ID from PayPal and CoinGate, but the invoice is not created/generated by the automatic system and i have more than two thousand clients so how can i generate again all invoice and put all has payed marked pay and others unpaid if unpaid ? 
       
      I only found this issue after 2 month so now i many "automatic" invoice is not here, there is a way to generate all invoice again ? and mark payed if the transaction is on that month, or a smiliar way ? 

      Very Important
      Regards
      Screamfox 
  • 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