Ramin Ramesh Posted August 21, 2019 Share Posted August 21, 2019 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. ? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted August 22, 2019 Share Posted August 22, 2019 @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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 22, 2019 Share Posted August 22, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
zitu4life Posted August 22, 2019 Share Posted August 22, 2019 (edited) @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. regards Edited August 22, 2019 by zitu4life 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 22, 2019 Share Posted August 22, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
Ramin Ramesh Posted August 22, 2019 Author Share Posted August 22, 2019 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... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 22, 2019 Share Posted August 22, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted August 23, 2019 Share Posted August 23, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
zitu4life Posted August 23, 2019 Share Posted August 23, 2019 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 😃 1 Quote Link to comment Share on other sites More sharing options...
Ramin Ramesh Posted August 26, 2019 Author Share Posted August 26, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
Ramin Ramesh Posted August 26, 2019 Author Share Posted August 26, 2019 Quote 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 😃 That is ok @zitu4life . you are welcome thanks 0 Quote Link to comment Share on other sites More sharing options...
monicachortle13 Posted August 26, 2019 Share Posted August 26, 2019 Can someone help me? I want to use an email from another cpanel without migrating the whole cpanel. Is there any way to do it? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.