Jump to content
Sign in to follow this  
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.

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');
   }

});

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.
Sign in to follow this  

  • Similar Content

    • By ModulesGarden
      1. Halloween Promotion

      No Halloween celebration can do without a fully-fledged trick-or-treat. And it so happens that ModulesGarden is an exceptionally generous host this year! Feel the mystical Halloween vibe with our fang-tastic 7% discount applicable until the end of this week to every single product available in our Marketplace!

      Promo Code: 7%Halloween!

      To turn this spooktacular event into a really memorable experience, we invite you to maximize the savings by combining the Halloween deal with other promotions, such as the deal of the day and week, the discount for a bulk order as well as for the purchase of products we recommend specifically.

      Get ready for the spine-tingling treat!


      2. Advanced Billing For WHMCS v3.6.0

      Have you ever experienced how one simple tool can make your work routines a whole lot easier? This is exactly how our Advanced Billing For WHMCS works its wonders - it makes billing your clients for the exact resource usage not only possible, but also incredibly simple!

      To enhance your billing strategies even further, we have just brought out the module’s brand new 3.6.0 version. Apart from the perfect compatibility with WHMCS V8.0.4, you can now take full advantage of Prepaid Billing allowing you to charge your customers for their products by collecting only the prepaid credits. To keep the entire process as transparent as possible, the use of credits will be shown in the summaries instead of generating invoices.

      Explore the ins and outs of Advanced Billing For WHMCS v3.6.0!


      3. cPanel Survey - Last Call

      Have you already put to use the 10% promo code received after completing our 60-second survey?

      If you have not yet claimed your exclusive gift for answering a few questions about your cPanel experience, there isn’t much time left to do so, as the discount is valid only until the end of October! Let us know how you feel about the recently introduced price increase of cPanel plans, and what solutions you plan to incorporate to lower your running costs. Your valuable input will be rewarded with a special 10% discount for all modules available on our website!

      Have your say right away!


      4. Polish Language Translation For WHMCS v1.4.0

      With our highly regarded Polish Language Translation For WHMCS, you can choose Polish to be default language in both admin and client area of your WHMCS, or even give visitors the freedom to switch between language settings as they please. If this introduction excited your interest already, you’d better keep on reading!

      It is with indescribable joy that we present to you today the spanking new 1.4.0 version of our translation, updated comprehensively to secure tip-top integration with WHMCS V8.0.4. Almost 800 new and updated translation records remain at your full disposal!

      Hungry for more? Grab the source code of our spick-and-span translation available for the next 24 hours as our Deal Of The Day and save 30% in the process!

      Rediscover your WHMCS V8.0.4 with Polish language version!


      4. Last but not least, make sure to follow other updates that we have lately released as well:
       
      Client Area Designer For WHMCS - v1.1.7 CRM For WHMCS - v2.6.3 HOT! DigitalOcean Droplets For WHMCS - v1.6.3 DirectAdmin Licenses For WHMCS - v1.4.2 Discount Center For WHMCS - v1.4.9 EasyDCIM Dedicated Servers For WHMCS - v1.7.3 G Suite For WHMCS - v1.3.4 Hetzner VPS For WHMCS - v1.4.1 Proxmox Cloud For WHMCS - v2.9.3 Proxmox VPS For WHMCS - v2.9.3 Zendesk For WHMCS - v2.2.4

      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 ModulesGarden
      cPanel has left its users scratching their heads in disbelief after the recent price increase, as this already is the second such change in the space of one year.
      How heavily have cPanel's decisions weighed on your business?
       


      Let us know where you stand amid cPanel's controversy via our 60-second survey, and accept a special appreciation gift in the form of a 10% discount for all the modules available in our Marketplace.
       
      Have your say and claim the promo code!
    • By ModulesGarden
      1. 60-Second Survey For cPanel Users

      The recent decision of cPanel to introduce yet another price increase has evoked mixed feelings across the web hosting community, to say the least. Would you call it a change for the better?

      Devote just 60 seconds to answering a few simple questions, and by doing so give us better understanding of how we can help with what your business goes through due to the controversial cPanel pricing policies. We will be happy to compensate for your time with an exclusive 10% promo code on the entire range of ModulesGarden software gear! Sounds appealing enough?*

      Share your cPanel experience with us!


      2. Buzzworthy Reveal Into WHMCS V8.0

      If you are with us for a while, you already know that we often like to spice things up. This time we have chosen to add some extra thrill to the ongoing WHMCS V8.0 vogue by sharing our very personal viewpoint on the novelties packed into this major update.

      Curious to find out what we really think about its all-new features, and how much they will contribute to transforming our WHMCS offer?

      Sneak a look at our latest Blog publication for some straight talk!


      3. Proxmox Reselling Revolution - 50% OFF!

      If you are toying with the idea of reselling your Proxmox servers directly through WHMCS or any other platform of your choice - there is no time like the present!

      With the outstanding promotion we have just put in motion, you can join the powers of your Proxmox VPS For WHMCS with our newly developed Products Reseller For WHMCS module at a colossal 50% discount, equal to $100!

      Worried that such a huge deal will slip you by because you are not into Proxmox offerings? Cheer up, Products Reseller For WHMCS has got you covered on all fronts, as it allows you to resell products and services of other types as well - and you can still indulge your business with an appealing cost-cutting offer!

      Ready to brainstorm this concept some further?


      4. Amazon EC2 For WHMCS v1.3.0

      We are pleased to announce that recent efforts of our Product Development team have led into the quality update of Amazon EC2 For WHMCS. There are several new implements that the module’s 1.3.0 version bears to make the provisioning of Amazon EC2 instances nothing short of a pleasure:
      Clients are now able to inject their SSH keys for the already existing machines The SSH key will be from now on auto-generated, and accessible in the client area, in case it was not provided by the user during the ordering proces The subnet into which the instance will be launched can be currently chosen in the product configuration Be sure to have a taste of other improvements this noteworthy release has been powered with!

      Learn more exciting details about Amazon EC2 For WHMCS v1.3.0!



      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 celse
      If more than one contact exists, when logged in as a contact, the name of the first contact is the one displayed on the header bar (next to logout link).  How can I resolve this issue?
      We're using version 7.10.2
    • By ModulesGarden
      1. WHMCS V8.0 Stable

      WHMCS V8.0 has reached the final, General Availability stage, meaning you can now enjoy a completely new gamut of advantages safely and without limits! Wondering what exactly this means for the modules you currently have installed in your system? Wonder no more!

      Our priority mission of scrutinizing all WHMCS products so as to enable their seamless operation in the 8.0 environment is almost complete! The modules that have undergone the inspection procedure most recently can be browsed below:
      cPanel Extended For WHMCS - v2.9.10 Domains Reseller For WHMCS - v2.1.2 EasyDCIM Colocation For WHMCS - v1.0.4 [FREE] EasyDCIM Dedicated Servers For WHMCS - v1.7.2 [FREE] GoDaddy SSL For WHMCS - v1.0.4 IBM Cloud Virtual Servers - v1.0.1 IBM Cloud Bare Metal Servers - v2.0.0 IP Manager For WHMCS - v2.5.8 OVH VPS & Dedicated Servers For WHMCS - v1.1.1 Product Cross-Selling For WHMCS - v1.1.3 Product Linker For WHMCS - v1.3.12 Rackspace Email Extended For WHMCS - v1.2.12
      Explore the Full Support List!


      2. Farewell Softlayer, Welcome IBM Cloud

      IBM continues to pop up on more and more people’s radars, facing a particularly sharp rise in interest rates across the globe since acquiring SoftLayer. Having best interest of our customers in mind at all times, it is only natural that we too make the most of the power-packed IBM Cloud solutions.

      While you may have heard of our IBM Cloud Virtual Servers For WHMCS before, with its capabilities to automate the provisioning and supervision over IBM Cloud servers inside your system, IBM Cloud Bare Metal Servers For WHMCS can be considered a brand new addition to our offer. Even though established on the familiar foundations of SoftLayer Servers For WHMCS, the module secures much greater automation within reselling and management of bare metal servers delivered by IBM Cloud.

      Our latest Blog post features a more revealing insight into the future of our Softlayer Servers For WHMCS, as well as further benefits of introducing IBM Cloud solutions into your reselling business.

      Read the full article!


      3. Ultimate Proxmox Reselling Gear 50% OFF

      If you provision Proxmox virtual servers, and seek new ways to boost the appeal of your offer as well as drum up the sales rates, the idea of building the network of resellers is now more worthy of consideration than ever!

      Our Products Reseller For WHMCS will empower you to manage your products and resellers with ultimate ease, straight in the confines of your WHMCS or any other suitable platform. More excitingly, should you now combine your Proxmox VPS For WHMCS module with this excellent reselling toolkit, you will save $100 - that's equal to a huge 50% discount!

      And in case you resell products or services of other types, you can treat your business to an exclusive promo code as well - more details in the "Promotions" section on our website!

      Are you game for the reselling revolution?



      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!
  • 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