Shaun Posted February 5, 2009 Share Posted February 5, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
Shath Posted February 5, 2009 Share Posted February 5, 2009 Wow ,great job man! fantastic! 0 Quote Link to comment Share on other sites More sharing options...
mike2352 Posted May 9, 2009 Share Posted May 9, 2009 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! 0 Quote Link to comment Share on other sites More sharing options...
conwayjd Posted November 28, 2009 Share Posted November 28, 2009 I'm on a shared server. Is it possible to implement this solution from the home directory? 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted December 3, 2009 Author Share Posted December 3, 2009 Sorry it can't be completed with a shared hositng server 0 Quote Link to comment Share on other sites More sharing options...
Entrio Posted January 17, 2010 Share Posted January 17, 2010 how can i get currently logged in client id and their cpanel password? Thanks mate 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted January 18, 2010 Author Share Posted January 18, 2010 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 0 Quote Link to comment Share on other sites More sharing options...
Entrio Posted January 18, 2010 Share Posted January 18, 2010 i i just kind did questions first then search alter, i figured out how to grab the user id etc, just need t get the pass and username for cpanel, but that should bea easy. Thanks again 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.