Page 1 of 1

Grabbing the users IP address

Posted: Thu Sep 04, 2014 3:12 pm
by cp4cartman
Is there a way that we can grab the IP address of the user? What we are wanting to do, is restrict access based on preset IP ranges. For example, ABC attempts to log in from home to a website, but he should only have access if he is logging in from work.
I know there is an iseries API that we can grab the info from, but with the passing of the user off to the CGI handling job, it changes the login info. Currently the initial signon job for each "atrium" based profile runs the PFGCONNCLI program.

Re: Grabbing the users IP address

Posted: Sun Sep 07, 2014 1:07 am
by Scott Klement
If the goal is to choose which IP addresses are allowed to access your system, and which are not, I would use Apache's 'allow' and 'deny' directives to specify who can/can't run your applications. This would be much simpler and more secure than trying to implement it in your program code.

Here's a link to the documentation for the Allow/Deny directives in the IBM Information Center:
http://www-01.ibm.com/support/knowledge ... tm?lang=en