elite_prodigy Posted April 11, 2009 Share Posted April 11, 2009 Okay, first a touch of a back-story: Our DNS crashed recently because it's overladden with 96,000+ zones. We are only using around 45,000, maybe a little less. Which means that accounts have not been properly terminated over time and DNS zones have piled up. So, I got the lovely task of sorting through the zones and figuring out which ones are still being used by an account, and which ones need deleting. It took me about a day to finally stumble upon a way to get every single domain WHM is managing without having to parse through BIND zone files, which would have been awful. So, now I have the method, but it requires me to authenticate first. So, if any of you have ever used cPanel or WHM (not exactly the greatest, but they are a convenience) then you know that when you try navigate to WHM you get a box that pops up and asks for your user name and password. This login box is generated by the header() function which send an "Authentication Required" message to the browser or whatever it does. So, how do I build an HTTP(S) query with the authentication headers built in. I feel like I should know this, but I don't. I'm not necessarily asking about how to authenticate to cPanel or WHM themselves, but how to build an HTTP(S) query that includes the headers and their values that I need to send. I'm at a loss at the moment and could really use everyone's help here, you guys and gals are awesome here. Infinite thanks in advance! Link to comment https://forums.phpfreaks.com/topic/153610-sending-headers-to-authenticate/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 11, 2009 Share Posted April 11, 2009 I never try that but it seem that cUrl support both http authentification and HTTPS ssl support : http://www.jellyandcustard.com/2006/01/02/php-curl-http-put-ssl-and-basic-authentication/ http://www.php.net/manual/en/ref.curl.php And it will be able to do what you want without knowing exactly the http header needed for that...hope is that what you are looking for. Link to comment https://forums.phpfreaks.com/topic/153610-sending-headers-to-authenticate/#findComment-807173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.