Jump to content

edit cpanel and mail links


Recommended Posts

hello

when my customers log in to their profile in whmcs, and choose their service, there is some login options at the left bar in Actions part.

  • cpanel
  • mail
  • cancel

when users click on cpanel at first it shows my hosting website's link (https://portal.sdnhost.com/clientarea.php?action=productdetails&id=1&dosinglesignon=1

but after clicking it gets redirected to servers name https://mi3-lr6.supercp.com:2083.

how can I force it to open in main hosting link (sdnhost.com:2083) 

 

and the mail link is completely wrong and it shows fake name ( https://a2hosting:2096/)

how can I fix it to be able to open my hosting mail adddress? (sdnhost.com/webmail)

 

any help please. ?

 

whmcs  actions.JPG

Link to comment
Share on other sites

@Ramin Ramesh 

The Login to cPanel link is based upon the "url" value returned by this cPanel API command: https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+create_user_session The WebMail link uses the server hostname if available, and if not the IP address. What do you currently have loaded under the Hostname for your server?

Link to comment
Share on other sites

On 21/08/2019 at 11:39, Ramin Ramesh said:

how can I force it to open in main hosting link (sdnhost.com:2083) 

you can change the links with a hook...

... but you will lose single sign on for the cPanel login and the user will have to enter their username & password.

however, the hooks might be irrelevant to your situation, because if you go to sdnhost.com:2083, then you get redirected to supercp.com - so it's not a WHMCS setting doing this and therefore it maybe worth having a word with A2Hosting to see what they say about the redirection.

Link to comment
Share on other sites

@Ramin Ramesh Please take a look that your problem could be a problem of other on this community, please kind take in consideration that what @brian! points you to goo to hosting provider to ask them make a lot of sense, so, please post later what A2H reply, so you will be helping others to easily fix this issue in future.

I am temped to say problem could be in your hosting provider...in the past i take adventure to learning something related to un-managed VPS full WHM and when setup WHMCS every thing works fine because full administrator can do anything...but it was only for learning in test environment, after that I test managed VPS and them those links you post in this thread to not work, so conclusion hosting provider could has some configuration to avoid it.

Please do not forget to post your results when you fixed this issue.

PS: considering in this community you will not sold out hosting for other users, kindly take in consideration to not post url links for you production server directly, use print or fake link without url if its not strictly necessary to post it, in my point of view it could be possible security break 😉, you still have a chance to edit then using report post and ask moderator to edit, explain reason for doing so.

image.thumb.png.8782687e93f98d83f72da5417e60c4d0.png

regards

Edited by zitu4life
Link to comment
Share on other sites

2 hours ago, zitu4life said:

PS: considering in this community you will not sold out hosting for other users, kindly take in consideration to not post url links for you production server directly, use print or fake link without url if its not strictly necessary to post it, in my point of view it could be possible security break 😉

I wouldn't agree with that - when someone has a problem, the more information they can post, the better (within reason!) - obviously, they should try to avoid posting paths to admin folders, security settings or passwords etc... but the fact he posted his domain, allowed me to check the redirection - if he hadn't posted that, I wouldn't have been able to tell what occurred and could only offer incomplete advice.

in any event, I like it when users post their domains, as it saves me having to find who they are and if they have legit licenses or not - though I can usually find those details anyway if I choose to.

a user posting their URL when asking for help is not a security concern, nor is it advertising either.

anyway, checking the redirection again, it's looks like sdnhost.com:2083 gets redirected to supercp.com, but https://sdnhost.com:2083 doesn't get redirected to another site - so the hook might be a viable option after all if the URL needs to include https (if it doesn't already)... webmail no longer seems to be redirecting either.

Link to comment
Share on other sites

for cpanel login that is ok i will discuss with hosting provider. 

but for webmail redirection to my domain what should I do?

Quote

 

and the mail link is completely wrong and it shows fake name ( https://a2hosting:2096/)

how can I fix it to be able to open my hosting mail adddress? (sdnhost.com/webmail)

 

if anyone explain step by step... 

 

 

Link to comment
Share on other sites

10 minutes ago, Ramin Ramesh said:

but for webmail redirection to my domain what should I do?

if you need to change it, use the first hook I posted...

<?php

use WHMCS\View\Menu\Item as MenuItem;

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

$service = Menu::context('service');    
$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 Webmail')
                           ->setUri('https://sdnhost.com/webmail');
   }

});
15 minutes ago, Ramin Ramesh said:

if anyone explain step by step... 

create a .php file in /includes/hooks, give it a relevant filename and paste the above code into it - that should then hardcode all webmail links to go to https://sdnhost.com/webmail - effectively, they'll redirect users to https://sdnhost.com:2096, but that's the correct address and port for webmail, so you could use that URL in the hook if you prefer.

 

Link to comment
Share on other sites

 
 
 
 
 
 
4
14 hours ago, zitu4life said:

PS: considering in this community you will not sold out hosting for other users, kindly take in consideration to not post url links for you production server directly, use print or fake link without url if its not strictly necessary to post it, in my point of view it could be possible security break 😉, you still have a chance to edit then using report post and ask moderator to edit, explain reason for doing so.

@zitu4life This is incorrect, providing the URLs assists all community users, including WHMCS staff to better assist a user, there is no guideline preventing them from posting in-context links which in this case these are. In accordance with our community guidelines WHMCS.Community Staff & Moderators use their sole discretion as to what is deemed unacceptable behavior in the community and may remove content at any time.

Link to comment
Share on other sites

16 hours ago, WHMCS ChrisD said:

@zitu4life This is incorrect, providing the URLs assists all community users, including WHMCS staff to better assist a user, there is no guideline preventing them from posting in-context links which in this case these are. In accordance with our community guidelines WHMCS.Community Staff & Moderators use their sole discretion as to what is deemed unacceptable behavior in the community and may remove content at any time.

Well, looks I was thinking on the wrong direction.  Sorry @Ramin Ramesh for getting it confusing... Thanks @brian! and @WHMCS ChrisD for all clarification regarding posting content! Everyday we learn something new here 😃 

Link to comment
Share on other sites

Quote

create a .php file in /includes/hooks, give it a relevant filename and paste the above code into it - that should then hardcode all webmail links to go to https://sdnhost.com/webmail - effectively, they'll redirect users to https://sdnhost.com:2096, but that's the correct address and port for webmail, so you could use that URL in the hook if you prefer.

I am so thankful @Brian it is working well now. 

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