Project

General

Profile

Feature #5009

add OS-USERID function as 4GL extension

Added by Greg Shah over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD

History

#1 Updated by Greg Shah over 3 years ago

  • Subject changed from add OS-USER function as 4GL extension to add OS-USERID function as 4GL extension

We have a customer that needs to access the OS user id/name. It seems a poor approach to force the customer to write OS-specific shell commands or native API calls.

In #2116 we implemented support for userid and setuserid in conjunction with the _user table. As part of that task, it was discussed that when _user was not in use, that the userid returns the OS user name. FWD does not seem to implement this behavior. But even if we did support it, it would not work in all cases because some customers do use _user.

In this task we will add a 4GL extension to report the OS user name as a character value. I believe we already have this in the ClientParameters instance of each session, so it should be pretty easy:

  • Add parser support for a new token, a new keyword and a new built-in "function" (that is really a global character variable OS-USERID).
  • Add conversion support in variable_references.rules for the conversion to SecurityOps.getOSUserId().
  • Add SecurityOps.getOSUserId() which will use ClientParameter.osUserName. The instance can be obtained by StandardServer.getClientParameters().
  • Add gap marking for the new function.

#2 Updated by Greg Shah over 3 years ago

I've implemented this feature in 3821c revision 11837.

Example code:

message "OS-USERID = '" + os-userid + "'; USERID = '" + USERID + "'".

If the current user's name is "greg" and there is no _user database login active, then this will result in the following message text:

OS-USERID = 'greg'; USERID = ''

#3 Updated by Greg Shah over 3 years ago

  • % Done changed from 0 to 100
  • Assignee set to Greg Shah
  • Status changed from New to Test

Documentation is available in OS-USERID.

#4 Updated by Greg Shah about 3 years ago

  • Status changed from Test to Closed

Also available in: Atom PDF