Jump to content

CPanel & Plesk login button in My Services.


Deniweb

Recommended Posts

Hello,
I followed these directions from katamaze to insert a column with the icon directed to the plesk or cpanel panel on my service list. (look attach image).
Unfortunately, a part of the code for how to insert icons and links to panels is missing. See below, I also reported this to katamaze but got no answer.
Can you help me solve?
Thank you

1802194667_Screenshot-24_04_202120_02_46.thumb.jpg.0b51ae10a820e6429836a00339d8a2b3.jpg
Managing multiple accounts can be frustrating for customers. The following hook makes things easier by allowing you to access any control panel directly from the My Services section. Here is a preview.

The hook works with any control panel (cPanel, Plesk, DirectAdmin, Centova Cast, Cloudmin ...) provided that the servers and products / services have been correctly integrated. Before getting the code, keep in mind that the hook requires some changes to a template file.

Open templates / {YOUR_TEMPLATE} /clientareaproducts.tpl and add the new Manage column in thead as follows.

{$ LANG.orderproduct} {$ LANG.clientareaaddonpricing} {$ LANG.clientareahostingnextduedate} {$ LANG.clientareastatus} {$ LANG.manage}
Your thead may be slightly different (e.g. in the first column you may have the SSL certificate checker) so apply the change accordingly. Then move to the tbody and add the cell right inside the {foreach} loop.

{if $ kt_autologin [$ service.id]}

****missing code ****

{/ if}
We recommend replacing the Click to Login text with a $ LANG variable for multi-language support. Now we just have to turn off the sorting for the newly added column. At the top of the file you find the following string.

{include file = "$ template / includes / tablelist.tpl" tableName = "ServicesList" noSortColumns = "4" filterColumn = "3"}
Focus on noSortColumns = "4". 4 means that the fifth column cannot be sorted (the column count starts from zero). Edit it accordingly. For example, if in your template in the first column you have the SSL certificate checker, you will write noSortColumns = "0, 5".

whmcs-login-to-plesk-cpanel-from-service-list.png

Link to comment
Share on other sites

22 hours ago, Deniweb said:

Can you help me solve?

use the English version of the blog post... 😎

https://katamaze.com/blog/32/whmcs-action-hooks-example#cpanel-plesk-login-button-in-my-services

Quote

The hook works with any panel (cPanel, Plesk, DirectAdmin, Centova Cast...) provided that servers and products/services have been integrated correctly. Before you get the code, keep in mind that this action hook requires some changes to a template file.

Open templates/{YOUR_TEMPLATE}/clientareaproducts.tpl and add the new Manage column in thead like follows.


<thead>
    <tr>
        <th>{$LANG.orderproduct}</th>
        <th>{$LANG.clientareaaddonpricing}</th>
        <th>{$LANG.clientareahostingnextduedate}</th>
        <th>{$LANG.clientareastatus}</th>
        <th>{$LANG.manage}</th>
        <th class="responsive-edit-button" style="display: none;"></th>
    </tr>
</thead>

Your thead could be slightly different (eg. your first column could be the SSL icon check) so change things accordingly. Next move to tbody and add the cell right inside {foreach} loop.


<td class="text-center">
	{if $kt_autologin[$service.id]}
	<div class="btn-group btn-group-sm plesk-login" style="width:60px;">
		<a href="clientarea.php?action=productdetails&id={$service.id}&autologin=1" target="_blank" class="btn btn-primary btn-xs" alt="Click to Login" title="Click to Login" style="padding: 2px 5px;"><img src="templates/{$template}/img/katamaze_autologin/{$kt_autologin[$service.id]->type}.png" style="height:22px; max-width:39px"> <i class="fa fa-sign-in fa-fw" aria-hidden="true"></i></a>
	</div>
	{/if}
</td>

We suggest you to replace Click to Login with $LANG variable for multi-language support. Now we need to disable sorting for the newly added column. On top of the file you'll find the following statement.


{include file="$template/includes/tablelist.tpl" tableName="ServicesList" noSortColumns="4" filterColumn="3"}

Focus on noSortColumns="4". 4 means that the 5th column will be not sortable (column count start from zero). Change it accordingly. For example if your template uses the SSL check as 1st column, use noSortColumns="0, 5".

Link to comment
Share on other sites

20 hours ago, Deniweb said:

Where do I find the button icons for plesk.png and cpanel.png?

I assume Kian made them himself - it wouldn't be that difficult to find the logos online.... perhaps PM Kian and ask him for the icons if you don't want to make them yourself.

Link to comment
Share on other sites

  • 2 months later...
Hello,
Thanks to your indications, the added buttons worked until a few days ago, then suddenly from the Cpanel buttons (see attachment) I no longer access the relative cpanel but sends me to the whmcs home page. From the Plesk buttons instead I normally access the various Plesk.
What happened ? It may have been some update or I have changed something without realizing it. ??
Thank you.

ScreenShot_20210713112351.jpeg

Link to comment
Share on other sites

  • 2 weeks later...

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