Reputation: 257
I'm trying to get the Hostname, Terminal of logged user in Oracle APEX. Normally when using database is easy. e.g.
SELECT SYS_CONTEXT('USERENV','TERMINAL') FROM DUAL;
I have APEX running through tomcat 9.0 on linux server. When I try it on APEX I get "unknown" value. When I try to get hostname
SELECT SYS_CONTEXT('USERENV','host') FROM DUAL;
I get the name of server that apex/ords/tomcat is running. I need to get the name of terminal of logged user.
Upvotes: 2
Views: 1587
Reputation: 1285
Have you tried:
begin
if( owa_util.get_cgi_env('X-Forwarded-For') is not null) then
htp.p('Client address is: ' || owa_util.get_cgi_env('X-Forwarded-For'));
else
htp.p('Remote address is: ' || owa_util.get_cgi_env('REMOTE_ADDR'));
end if;
end;
from https://community.oracle.com/thread/3994246?start=0&tstart=0
Upvotes: 3