PDA

View Full Version : login via POST without form



mycon
07-10-2006, 06:51 AM
hi all.

are anyone knows how to login through CMD_LOGIN from other script, without form. (method POST), for example with curl.

ty.

DirectAdmin Support
07-10-2006, 01:05 PM
Hello,

DA also support standard http basic authentication if you pass it. It's how the API works. So for curl, you'd use "--basic --user user:pass"

John

mycon
07-12-2006, 03:18 AM
what we do wrong?


code:

url="http://ip:2222";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERPWD, "login:pass");
curl_exec($ch);
curl_close($ch);


panel opens, but without images and with wrong links.

kke
07-12-2006, 08:31 AM
Originally posted by mycon
what we do wrong?
panel opens, but without images and with wrong links.

Did you set da to use secure port?
If yes, url="https://ip:2222";
may work.

mycon
07-13-2006, 12:36 AM
the problem is not in this. does anybody have any other ideas?


.... so.....

fernandoc83
12-09-2009, 10:22 AM
I'm having the same problem, I want create a panel to give some people access to DA only pressing a button, I try with CURL but It not working fine, I can see the HTML code but not the images and links.

Someone have a another solucion with curl or other way?

Thanks

Fernando

floyd
12-10-2009, 03:16 PM
If they are clicking a button then you can have a form with the variables that need to be POST'ed.

fernandoc83
12-11-2009, 03:09 PM
Yes, but I want hide all my admin password and centralize it all in only one panel made by me.
I want have a central panel with buttons or links to my DA control panel from my servers, and when the user press this link will be redirected to the DA panel and the admin username and password must be completed automatically.

I can put this values in a Hidden tag and do a POST but its very simple to discover.
I try with Curl and I can connect to the panel and see the html code ( not images and links ) but the session it made by curl and I cant redirect it to the user browser to continue logged into the panel.

Maybe someone solve this in a another way because I think in many possibilities I dont know how to continue.

Thanks all for any help and very sorry for my english!

Fernando