Focal Point
[Solved] Current User who is executing the Report

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

June 06, 2014, 07:28 PM
Santhosh
[Solved] Current User who is executing the Report
All,

Whenever a procedure(FEX) is invoked, a record needs to be inserted into a database table with the User Name(the user who is requesting the report) and the Report Name.

Is there any pre defined variable or function which will return the User Name.

Thanks,
Santhosh

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


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 06, 2014, 09:13 PM
Santhosh
I found that with GETUSER we will be able to retrieve the current user.

But when I tried using it in the report all the time it displays as edmadmin.

I would want it to display the current user running the report.

Thanks,
Santhosh


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 07, 2014, 09:22 AM
Alex
This will get your user id only if you are requiring your users to sign in. If you are executing reports with a defaulted id then you will get only the defaulted id every time.


WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
June 07, 2014, 01:17 PM
J.L. Hinds
Try this

UNAME/A15='&IBIMR_user';

I use this in a number of procedures to create user specific rules and filters. Should work for what you're trying to do.


WebFOCUS 7.6
Windows, All Outputs
June 09, 2014, 02:42 PM
susannah
IFF you're requiring your users to sign in, and
IFF you're using MRE, and
IFF you've told your config.sys to pass the IBIMR_user variable.
lot of IFFs.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 09, 2014, 02:47 PM
RSquared
Susannah,

That is a lot of IFFs, whatever they may be.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
June 09, 2014, 04:01 PM
Santhosh
quote:
Originally posted by Alex:
This will get your user id only if you are requiring your users to sign in. If you are executing reports with a defaulted id then you will get only the defaulted id every time.


Hi Alex,

Yes, the users need to sign in to access the reports. But still we are getting the edmadmin in the report.

For testing purpose, I ran few reports under different users and in the Workspace log it shows the appropriate user names for each requests.

Thanks,
Santhosh


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 09, 2014, 04:03 PM
Santhosh
quote:
Originally posted by J.L. Hinds:
Try this

UNAME/A15='&IBIMR_user';



Hi Hinds,

I tried using this in my report and it is prompting me the value for IBIMR_User variable.

Thanks,
Santhosh


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 09, 2014, 04:05 PM
Santhosh
quote:
Originally posted by susannah:
IFF you're requiring your users to sign in, and
IFF you're using MRE, and
IFF you've told your config.sys to pass the IBIMR_user variable.
lot of IFFs.


Yes, we require our users to sign in.
I tested few reports from MRE.
Could you help me on where I can find the config.sys file.

Or would you share some inputs If we do not wish to place our reports under MRE but still the user requires to sign in.

Thanks,
Santhosh


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 09, 2014, 04:51 PM
jfr99
Hi Santhosh,

Try this and see what you get for CNCT_UID:

-*
-SET &USERID = GETUSER('A8');
-SET &UC_USERID = UPCASE(8, GETUSER('A8'), 'A8');
-*
-SET &CNCT_UID = CNCTUSR('A8');
-*
-TYPE USERID -------- &USERID
-TYPE UC_USERID ----- &UC_USERID
-TYPE ------------------------
-TYPE CNCT_UID ------ &CNCT_UID

~Jim


WebFocus 8.201M, Windows, App Studio
June 09, 2014, 04:59 PM
Francis Mariani
It's not the config.sys file.

Go to Administration > Administration Console.

Open Configuration. Click on Custom Settings.

Add this to the Custom Settings:

# Pass the MRE User ID
<SET>IBIMR_user(pass)


Click the Save button.

You should now have the IBIMR_user variable as a system variable.

There are many more parameters that can be setup here, including "HTTP Header Variables Available for Script Processing"...


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 09, 2014, 05:40 PM
Santhosh
quote:
Originally posted by jfr99:
Hi Santhosh,

Try this and see what you get for CNCT_UID:

-*
-SET &USERID = GETUSER('A8');
-SET &UC_USERID = UPCASE(8, GETUSER('A8'), 'A8');
-*
-SET &CNCT_UID = CNCTUSR('A8');
-*
-TYPE USERID -------- &USERID
-TYPE UC_USERID ----- &UC_USERID
-TYPE ------------------------
-TYPE CNCT_UID ------ &CNCT_UID

~Jim


Hi Jim,

I am getting the connected user name as the value for CNCT_UID!!!

Thanks a lot..

Santhosh


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 09, 2014, 05:42 PM
Santhosh
quote:
Originally posted by Francis Mariani:
It's not the config.sys file.

Go to Administration > Administration Console.

Open Configuration. Click on Custom Settings.

Add this to the Custom Settings:

# Pass the MRE User ID
<SET>IBIMR_user(pass)


Click the Save button.

You should now have the IBIMR_user variable as a system variable.

There are many more parameters that can be setup here, including "HTTP Header Variables Available for Script Processing"...


Hi Francis,

I followed you steps and as you said, I got IBIMR_user as a system variable and the connected user name as the value for it.

Thanks a lot... Smiler

Thanks,
Santhosh


WebFOCUS 8.0.03
Unix
HTML, Excel and PDF
June 09, 2014, 11:27 PM
Francis Mariani
The file that contains the "Custom Settings" is Drive:\ibi\WebFOCUS77\client\wfc\etc\site.wfs.

There's a lot you can do, including the settings below. These are for v7.7.05. I'd read the Admin Console Help > WebFOCUS Online Help > WebFOCUS Administration Console > Configuration Settings.

<set> IBIC_user = &IBIC_user (pass)
<set> IBIWF_language = &IBIWF_language (pass)
<set> IBIWF_LANGPERM = &IBIWF_LANGPERM (pass)

<set> IBIC_server = &IBIC_server (pass)
<set> IBI_REPORT_SERVER = &IBI_REPORT_SERVER (pass)

<set> IBIMR_user = &IBIMR_user (pass)
<set> IBIMR_domain = &IBIMR_domain (pass)
<set> MR_BASE_DIR = &MR_BASE_DIR (pass)
<set> IBIMR_folder = &IBIMR_folder (pass)
<set> IBIMR_fex = &IBIMR_fex (pass)
<set> IBIMR_defer = &IBIMR_defer (pass)


And this stuff, documented by me elsewhere:

# --- HTTP Header Variables ----------------------------------------------------
# --- Documentation: http://documentation.informati...02/wf77sec/index.htm
# --- WebFOCUS Security and Administration > Manipulating WebFOCUS Variables > HTTP Header Variables Available for Script Processing

# Specifies the authentication scheme (basic or digest) if an authorization header is supplied
<SET> AUTH_TYPE = &AUTH_TYPE (pass)

# Stores the number of bytes of data sent. For POST requests only
<SET> CONTENT_LENGTH = &CONTENT_LENGTH (pass)

# Designates the MIME type of attached data
<SET> CONTENT_TYPE = &CONTENT_TYPE (pass)

# Specifies the actual address of the host directory
<SET> DOCUMENT_ROOT = &DOCUMENT_ROOT (pass)

# Specifies the media (MIME) type the WebFOCUS Client prefers to accept, separated by commas
<SET> HTTP_ACCEPT = &HTTP_ACCEPT (pass)

# Restricts the content-codings that are acceptable in the response
<SET> HTTP_ACCEPT_ENCODING = &HTTP_ACCEPT_ENCODING (pass)

# Indicates which languages are preferred
<SET> HTTP_ACCEPT_LANGUAGE = &HTTP_ACCEPT_LANGUAGE (pass)

# Identifies the browser (or other client) making the request. It can be used to return content to different browsers
<SET> HTTP_USER_AGENT = &HTTP_USER_AGENT (pass)

# Indicates the URL of the referring Web page
<SET> HTTP_REFERER = &HTTP_REFERER (pass)

# Supplies any path information attached to the URL after the server address but before the query string
<SET> PATH_INFO = &PATH_INFO (pass)

# Value of PATH_INFO with any virtual path name expanded into a directory specification
<SET> PATH_TRANSLATED = &PATH_TRANSLATED (pass)

# Information that follows the question mark (?) in the URL
<SET> QUERY_STRING = &QUERY_STRING (pass)

# IP address of the client that made the request
<SET> REMOTE_ADDR = &REMOTE_ADDR (pass)

# Fully-qualified Domain name of the client that made the request
<SET> REMOTE_HOST = &REMOTE_HOST (pass)

# ????? – This is not documented
<SET> REMOTE_USER = &REMOTE_USER (pass)

# HTTP request method
<SET> REQUEST_METHOD = &REQUEST_METHOD (pass)

# Name of the script program being run
<SET> SCRIPT_NAME = &SCRIPT_NAME (pass)

# Server's host name or IP address
<SET> SERVER_NAME = &SERVER_NAME (pass)

# TCP/IP port on which the request was received
<SET> SERVER_PORT = &SERVER_PORT (pass)

# Name and version of the information retrieval protocol that relates to a request
<SET> SERVER_PROTOCOL = &SERVER_PROTOCOL (pass)

# Name and version of the Web server
<SET> SERVER_SOFTWARE = &SERVER_SOFTWARE (pass)

#The default URL protocol (http or https)
<SET> URL_PROTOCOL = &URL_PROTOCOL (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 10, 2014, 07:23 AM
MAdams1
Hi Francis,

Have you had any issues in WF 8 with the IBIMR_user? We can't seem to get it to recognize it. We set &USR in our reports = &IBIMR_user so when it's run in MRE we get the user info. Works great in WF7 but when we moved to WF8 it errors.
Thanks
Michelle


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
June 10, 2014, 10:50 AM
Francis Mariani
Michelle,

I tried with
<SET>IBIMR_user(pass)
and it worked for me.

I tried with variants of the setting and one of these made the client crash.
<SET> IBIMR_user=&IBIMR_user (pass)
or
IBIMR_user=&IBIMR_user
<SET> IBIMR_user= (pass)

I think it's quite pathetic that a coding error can cause the client to crash.


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