Focal Point
Calling Computer's IP Address

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9721057782

June 13, 2008, 08:16 AM
jelli4908
Calling Computer's IP Address
Does anyone know of a way to get the IP address of the computer that is calling a WebFOCUS report?

Thanks,
Josh


WebFOCUS 8.0.09
Windows, DB2 iSeries, ODBC
Output: Excel, HTML, PDF, AHTML
June 13, 2008, 08:40 AM
RichH
Hi Josh,
The way this "should" work (It's not working in my 765 environment) is:

To use the IP Address add the following to
custom settings under configuration in the Webfocus admin console:

RADDR = &REMOTE_ADDR (pass)

Then test using the following FOCEXEC:

TABLE FILE CAR
"THIS IS THE ADDRESS: &RADDR"
PRINT CAR NOPRINT
END

This message has been edited. Last edited by: RichH,


WebFOCUS 8202 Win 2012
Test - WebFOCUS 8203 on Win 2012
June 13, 2008, 09:49 AM
dhagen
This will work

RADDR=&REMOTE_ADDR
<set> RADDR(pass)


or just:

<set> REMOTE_ADDR(pass)  



"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
June 13, 2008, 09:50 AM
jelli4908
Thank you Rich!

I did not use the same command, but it gave me ideas. I used:

REMOTE_ADDR (pass)

This did what I expected it to do, but did not give me the results I want. Let me explain. I am developing some reports for a 'customer portal' that is using Microsoft SharePoint. I would like to get the IP of the SharePoint server if possible. I am wanting to only run the reports if the request is going through this server. I know this sounds crazy, but this is what the boss wants.

Thanks,
Josh


WebFOCUS 8.0.09
Windows, DB2 iSeries, ODBC
Output: Excel, HTML, PDF, AHTML
June 13, 2008, 03:32 PM
Francis Mariani
You may be able to determine the IP or server address via the "referrer" property of a URL. Take a look here or Google "html referrer":

http://www.netmechanic.com/news/vol4/javascript_no14.htm


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 14, 2008, 03:33 AM
Francis Mariani
Try
<set> HTTP_REFERER (pass)



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 16, 2008, 10:18 AM
Francis Mariani
This works as I expected it to.

When running a WebFOCUS request from the Microsoft CRM server, the DM variable looks like this:
&HTTP_REFERER = http://nbnotocrm1.nesbittburns.ca/sfa/conts/edit.aspx?i...ts/edit.aspx?id={87E

When running a WebFOCUS request from the WebFOCUS server, the DM variable looks like this:
&HTTP_REFERER = http://gfnotoeiprod/ibi_apps/WFServlet?IBIF_ex=crmsimu3...x=crmsimu3&DECD=

Now I can verify the origin of the request by doing something like this:
-SET &ECHO=ALL;

-IF NOT (&HTTP_REFERER LIKE '%nbnotocrm1.nesbittburns.ca%' OR &HTTP_REFERER LIKE '%gfnotoeiprod%') GOTO NO_ACCESS;

...

-EXIT


-NO_ACCESS 
-TYPE YOU DO NOT HAVE ACCESS TO THE WEBFOCUS SERVER



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server