Can I link to auto-login WHM and go to "list accounts" page? (with search even better)

Ishware

Well-Known Member
Nov 7, 2003
211
6
168
Williamsburg, VA
cPanel Access Level
Root Administrator
Okay, so I have determined that on my local machine, which I trust completely, I have set up a bookmark as follows:

https://myserver:2087/login?user=someuser&pass=somepass

This will log me into WHM, which is brilliant and makes my life so much easier.

There's one little step, though, that would make life even better: Is there a way to pass in the arguments the destination page I want? For example, I want to auto-login and go to:

https://myserver:2087/cpsess8675309/scripts4/listaccts


Even BETTER would be to pass along search args like:

?search=something&searchtype=domain_and_user&acctp=30

Is there any way at all to construct a URL to get me to either of those steps? Pweeeease? :)

Alternatively, I'm just playing around with JSON to create accounts from an external script. Is there a way I can create the account via JSON, then construct a URL to log into that account's cPanel automatically? Especially if, again, I can direct to a certain page - I do a couple of standard things (set up [email protected] and [email protected], for example) that I know I can eventually automate, but it's common for me to use Softaculous to install Wordpress for the site, for example, so a link to click to go to the Wordpress install page in Softaculous as a link after creating a site would be amazing...

Meanwhile, my massive thanks to cPanel allowing that first URL to get me into WHM. It saves me so much headache every day... :)
 

robb3369

Well-Known Member
Mar 1, 2008
122
1
66
cPanel Access Level
Root Administrator
IMHO, I would NEVER pass a username/password in the URL... Always do a HTTPS post to get your password and other sensitive data inside the secure payload and NOT in the URL... If there are any proxies between you and the server, your root credentials would become known. I'd get a good password safe like Roboform instead...

As far as standard [email protected] or [email protected] accounts, are you looking for server wide settings? If so, there are alot of examples from Chirpy for forwarding all [email protected] and [email protected] email accounts to your server's root email forwarder.
http://forums.cpanel.net/f5/postmaster-abuse-fail-32703.html

And, as far as automating Softaculous, they actually have a WHMCS module that allows that at account creation. Also check their website for further information on that. The cPanel blog also has an example of doing it as well:
Frequently Asked Scripts: “How do I automate XYZ after creating an account?” | cPanel Blog
cPanel & WHM's SDK
 

mvirtue

Member
Sep 1, 2007
11
3
53
I have exactly the same need. Did you ever get an answer to this? I looked at Secure Remote Logins, and it MAY work, but I want to get to /scripts11/fetch_mail_queue and I can't find that anywhere in the documentation, or even searching in /usr/local/cpanel
 

Ishware

Well-Known Member
Nov 7, 2003
211
6
168
Williamsburg, VA
cPanel Access Level
Root Administrator
I had a PHP script that I was able to use for a while. It basically constructed the request, logged in, got the session code, and then constructed the URL that included the session code - so it would have worked for what you're wanting to do. But it stopped working, and I'm not sure why. And because I forgot about it, when I moved servers last time, I forgot to grab a copy (stupidly having the only copy on the server), so I've lost it.

So that being said, if anyone reading this has a working script, I'd love a copy to play with. :)

Also, I said "pweeeese" in 2014, and six years later, I'm horrified by that. lol