I am trying to get the userid of the user logged in to Webfocus, but what I am doing is always returning 'wfadmi'. (No, that's not my userid.) Is there a different way to do this?
-SET &USR = GETUSER(USERID);
-TYPE &USR
This message has been edited. Last edited by: <Kathryn Henning>,
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
October 09, 2013, 04:47 PM
Waz
Are you talking about your network login, MRE login, something else ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 09, 2013, 05:08 PM
Josh K
MRE login
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
October 09, 2013, 05:19 PM
njsden
What Waz is asking has great relevance as it all depends on your particular infrastructure and WebFOCUS components involved.
In my case for instance, we use LDAP authentication to Active Directory on both WebFOCUS Reporting Server and Client.
On the WF Client's Custom Settings (accessible via the WebFOCUS Administration Console > Configuration > Custom Settings), we have the following:
<SET>IBIMR_user(pass)
That allows us to use &IBIMR_user anywhere in our code to determine who is connected.
Being usually on the paranoid side, I prefer to test for the existence of that variable first, falling back on GETUSER() otherwise. This is what I use in the "common" portion of my procedures:
-* Determine connected user ID
-IF &IBIMR_user.EXISTS THEN GOTO :_IBIMR_user;
-SET &IBIMR_user = ' ';
-:_IBIMR_user
-SET &I_USER_ID = IF &IBIMR_user EQ '' OR ' ' OR '.' THEN GETUSER('A80') ELSE &IBIMR_user;
-SET &I_USER_ID = TRUNCATE(&I_USER_ID);
-TYPE Welcome &I_USER_ID !
That way, I can "trust" that &I_USER_ID (my own internal variable) has a valid content I can use for logging or any security-related purposes.