Jump to content

Auto Login to Cpanel with Redirect (eg To SiteBuilder)


Shaun

Recommended Posts

So you want to log someone into cPanel and redirect the to say sitebuilder ?

 

I had this issue popup the other day and i tried everything from Ajax to cpanel support. And well the dude I tlked to there was "helpful".

 

So i managed to track down the dude that wrote the book on cPanel.

By using the unprotected directories where the logn themes are we can place a script that we can post to that will make an ajax call (not crossing domains) to log the person in, then we can reidrect them.

 

Show me the money!

Attached is a file, you need to drop the contents of this into you cPanel login theme directory. For most people this is the default:

/usr/local/cpanel/base/unprotected/cpanel

 

Now in you WHMCS (or other app) make a post to the cpanelLoginRedirect.php which will be at.

http(s)://domain.com:2082(3)/unprotected/cpanel/cpanelLoginRedirect.php

You need to post the following variables:

domain = domain name

port = 2082/3

username = username

pass = password

failurl = where to go if there is an error

goto = url eg /3rdparty/phpMyAdmin/ (Include the slash at start)

cpLoginRedirect.zip

Link to comment
Share on other sites

  • 3 months later...

Is there any way to do this with a newly created user/hosting account? For example, when somebody signs up for a hosting package - once their payment is confirmed, WHMCS auto-creates their new hosting account. Is there any way to take their username and password as variables, log them into their new account, and re-direct to a page (without having to hard code login info in cpanelLoginRedirect.php)?

 

Also, is this a secure method? Since /unprotected/cpanel/cpanelLoginRedirect.php is in an unprotected directory... Please let me know your thoughts.

 

Thank you in advance for your help!

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
how can i get currently logged in client id and their cpanel password?

 

Thanks mate

 

Hi Mate.

You will need to review the WHMCS wiki documentation.

And then using the session varibale that contains the user id search for the product for the cpanel account you wish to log them into using some sql.

 

S

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