Security Control (WEB PL/SQL) on OAS : IP Addr & CGI env. variables

From: Patrick Lo <cylo_at_vtc.edu.hk>
Date: Fri, 24 Mar 2000 12:44:01 +0800
Message-ID: <38DAF290.5A0B552_at_vtc.edu.hk>



Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit

Hi,

I want to log the client IP address when the users press a FORM button on a HTML but I found that I was unabled to log down the IP_ADDRESS. My coding is as follow :

     PROCEDURE GET_IP
     IS
         CLIENT_IP OWA_UTIL.IP_ADDRESS;
     BEGIN

         CLIENT_IP := OWA_SEC.GET_CLIENT_IP

         IF CLIENT_IP.COUNT = 0 THEN
            HTP.PRINT('NONE IP ADDR.');
         ELSE
            FOR i IN 1..CLIENT_IP.COUNT LOOP
                HTP.PRINT(TO_CHAR(CLIENT_IP(i)) || ' ');
            END LOOP
         END IF;

    END GET_IP; but I found that this code always printed 'NONE IP ADDR'. Should I set anything on the OAS (Administration Part) before I try to call the function of the package OWA_SEC?

Besides, after I failed to get the IP Address from the OWA_SEC.GET_CLIENT_IP, I turned to try another function OWA_UTIL.PRINT_CGI_ENV to see if I can retrieve the CLIENT IP ADDRESS from the CGI environment variables. However, I failed again. I got the following errors on the browser :

"Oracle Application Server

An Internal error occured in processing the request Please refer to the logs for more information"

Can anyone tell me how I can solve these problems and get the CGI environment variables & the client IP Address?

Thanks.

--
Patrick Lo


--------------5F9E7A204EC444A93CCC9926
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<tt>Hi,</tt><tt></tt>
<p><tt>I want to log the client IP address when the users press a FORM
button on a HTML but I found that I was unabled to log down the IP_ADDRESS. My coding is as follow :</tt><tt></tt>
<p><tt>&nbsp;&nbsp;&nbsp;&nbsp; PROCEDURE GET_IP</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp; IS</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLIENT_IP OWA_UTIL.IP_ADDRESS;</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp; BEGIN</tt><tt></tt>
<p><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLIENT_IP := OWA_SEC.GET_CLIENT_IP</tt><tt></tt>
<p><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF CLIENT_IP.COUNT
= 0 THEN</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HTP.PRINT('NONE IP ADDR.');</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
FOR i IN 1..CLIENT_IP.COUNT LOOP</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HTP.PRINT(TO_CHAR(CLIENT_IP(i)) || ' ');</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
END LOOP</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END IF;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; END GET_IP;</tt><tt></tt>
<p><tt>but I found that this code always printed 'NONE IP ADDR'. Should
I set anything on the OAS (Administration Part) before I try to call the function of the package OWA_SEC?</tt><tt></tt>
<p><tt>Besides, after I failed to get the IP Address from the OWA_SEC.GET_CLIENT_IP,
I turned to try another function OWA_UTIL.PRINT_CGI_ENV to see if I can retrieve the CLIENT IP ADDRESS from the CGI environment variables. However, I failed again. I got the following errors on the browser :</tt><tt></tt>
<p><tt>"Oracle Application Server</tt><tt></tt>
<p><tt>An Internal error occured in processing the request Please refer
to the logs for more information"</tt>
<br><tt></tt>&nbsp;<tt></tt>
<p><tt>Can anyone tell me how I can solve these problems and get the CGI
environment variables &amp; the client IP Address?</tt><tt></tt>
<p><tt>Thanks.</tt><tt></tt>
<p><tt>--</tt>
<br><tt>Patrick Lo</tt>
<br><tt></tt>&nbsp;</html>
--------------5F9E7A204EC444A93CCC9926--
Received on Fri Mar 24 2000 - 05:44:01 CET

Original text of this message