Jump to content

Custom Hostnsname URL cPanel


lims

Recommended Posts

i want for custom this function is work,  version 7.7.1

ssimg.PNG.f378bd91dc0da060af049464154038e0.PNG

all login user client area sidebar and admin link button go to root Hostname... not go to hostsname  in configservers

and how to make custom hostname  will work ?

any idea... ?

regards

Link to comment
Share on other sites

6 minutes ago, brian! said:

in terms of the client sidebar, if you want to change the URL of the cPanel/Webmail links...

I suspect the admin area would require another hook too as there isn't a template to work with on the products page in the client's summary. 

thank so much @brian! this hook work for client area

 

Link to comment
Share on other sites

  • WHMCS Staff

Hi @lims,

The reason this currently works in the way it does is because WHMCS sends a request via the cPanel API to the "create_user_session" endpoint.

At current, the "url" which is returned defaults to the server hostname. This is what is used to redirect the user to cPanel

Here's an example of what we receive back from cPanel:

{
  "data": {
    "cp_security_token": "/cpsess1234567890",
    "expires":1401993893,
    "session": "username:GHehYZ1GCxzmDATMmT1xT4rN0tiPGMWnKErPJdU3t6AGBx2LjQ3qB6Xih5naUh_4:create_user_session,
    5dc619831bac4aa2e014e062d762645e8447949eaef14fc53a8ce2b1e0e2592a",
    "url":
"https://example.com:2083/cpsess1234567890/login/?
    goto_uri=frontend%2fx3%2fstats%2fawstats_landing.html&locale=fr&session=username:%3aGHehYZ1GCxzmDATMmT1xT4rN0tiPGMWnKErPJdU3t6AGBx2LjQ3qB6Xih5naUh_4%3acreate_user_session%2c5dc619831bac4aa2e014e062d762645e8447949eaef14fc53a8ce2b1e0e2592a",
    "locale":"fr",    
    "service": "cpaneld"
  },
  "metadata": {
    "version": 1,
    "reason": "Created session",
    "result": 1,
    "command": "create_user_session"
  }
}

As you can see, the "url" element is absolute. We simply redirect to this link.

I do note in the cPanel documentation that it is now possible to set a "preferred_domain" variable when contacting this endpoint, making it possible to redirect to a users own domain.

Therefore I would encourage you to please submit a request to our feature requests tracker where other users can contribute to and vote on your idea. Ideas with the most votes and activity do get reviewed by our team.

http://requests.whmcs.com

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