Search
Other IP Login questions
Forum

Should IPLogin work when using curl?

Helen Chappell's Avatar Helen Chappell
I'm using curl in a bash script on AWS EC2 server and want to use IPLogin. Should this work? I'm using the public ip of the ec2 server.
Thanks,
Helen
Peter van Westen's Avatar Peter van Westen ADMIN
I think so.
Make a little php script that outputs te ip address. And see what you get when using curl to query that url (php script).
Please post a rating at the Joomla! Extensions Directory
Helen Chappell's Avatar Helen Chappell
Thank you for the super fast response.

I did that and the IP address I'm using seems to be correct. I get it using the following snippet:
if(!empty($_SERVER['HTTP_CLIENT_IP'])){
        //ip from share internet
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
        //ip pass from proxy
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }else{
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    return $ip;

It works from my browser on local machine (with IP changed accordingly). But no dice when I try to run a page requiring login from the Linux box.

Not a showstopper but if you have any ideas they would be appreciated.

Thanks,
Helen
Peter van Westen's Avatar Peter van Westen ADMIN
You might want to 'follow redirects' and try some other curl options.
And maybe use wget instead of curl.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription