User's IP address [message #347539] |
Fri, 12 September 2008 01:06 |
andi_raj
Messages: 55 Registered: February 2008
|
Member |
|
|
We have developed a software using apex. We are able to store the user's name and timestamp when he logsin in a table. Is it possible to store the user's PC IP address or computer name so that it will be possible to know from which PC the user has logged in. Thanks in advance.
|
|
|
|
Re: User's IP address [message #348509 is a reply to message #348457] |
Wed, 17 September 2008 01:18 |
andi_raj
Messages: 55 Registered: February 2008
|
Member |
|
|
Thank you for the reply.
I am only getting 127.0.0.1 which is the local host address.
is it necessary to give grant for running this sql? I want the machine IP address and not local host.
|
|
|
|
Re: User's IP address [message #350806 is a reply to message #347539] |
Fri, 26 September 2008 07:55 |
zraz
Messages: 20 Registered: September 2008 Location: Poland
|
Junior Member |
|
|
Hello,
how can I use this code in APEX in the first page:
DECLARE
i NUMBER := 2;
v_ip varchar2(25):='127.0.0.0';
BEGIN
IF OWA.num_cgi_vars IS NOT NULL
THEN
v_ip := OWA_UTIL.get_cgi_env ('REMOTE_ADDR');
ELSE
v_ip := SYS_CONTEXT ('USERENV', 'IP_ADDRESS');
END IF;
END;
I added this as ITEMS / DISPLAY ONLY but i doesn't show any IP address.
|
|
|
|
Re: User's IP address [message #351382 is a reply to message #350835] |
Tue, 30 September 2008 10:14 |
zraz
Messages: 20 Registered: September 2008 Location: Poland
|
Junior Member |
|
|
Hi,
thank you for good response, it works.
I want to get also an username of Windows.
It is possible ?
|
|
|
Re: User's IP address [message #351405 is a reply to message #347539] |
Tue, 30 September 2008 12:46 |
zraz
Messages: 20 Registered: September 2008 Location: Poland
|
Junior Member |
|
|
andi_raj wrote on Fri, 12 September 2008 08:06 | We have developed a software using apex. We are able to store the user's name and timestamp when he logsin in a table. Is it possible to store the user's PC IP address or computer name so that it will be possible to know from which PC the user has logged in. Thanks in advance.
|
How did you get user's name from PC ?. Can you write an sample code ?.
Thanks in advance
|
|
|
|
Re: User's IP address [message #352158 is a reply to message #352130] |
Mon, 06 October 2008 06:29 |
zraz
Messages: 20 Registered: September 2008 Location: Poland
|
Junior Member |
|
|
Hello,
when i uset it in SQL*Plus as:
select sys_context('USERENV', 'OS_USER') from dual;
it works but as PL/SQL:
declare
usern varchar2(29);
begin
select sys_context('USERENV', 'OS_USER') into usern from dual;
dbms_output.put_line('User_win: '||usern);
end;
/
it returns username that login to SQL*Plus.
What is the problem ?.
[Updated on: Mon, 06 October 2008 06:29] Report message to a moderator
|
|
|