![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
... .L has really elegant code to figure out which of the last two words of WHO / user exit U50BB is your userid -- they swap when r83.setup is in effect. Your userid is the item id to look at in tcl-stack. |
ort1, port2
conv('a%2','u50bb')
#4
| |||
| |||
|
|
"Frank Winans" wrote: ... .L has really elegant code to figure out which of the last two words of WHO / user exit U50BB is your userid -- they swap when r83.setup is in effect. Your userid is the item id to look at in tcl-stack. It's not "elegant code". There are many ways to identify your user, account, port, etc. Run the following code. Someone should be logged into port2 for the last couple lines to show any data: user1 = @user user2 = @who user3 = oconv('u','u50bb') account1 = @account account2 = @logname account3 = oconv('a','u50bb') port1 = @pib port2 = oconv('p','u50bb') crt "user ":user1, user2, user3 crt "acct ":account1, account2, account3 crt "port " ort1, port2original.who = system(29) execute "who (c" capturing out execute "who" capturing who1 crt "'who' in r83 mode (":system(29):") = ":who1 execute "who (a" capturing out execute "who" capturing who2 crt "'who' in D3 mode (":system(29):") = ":who2 * see if we need to reset who verb to R83 mode if original.who = 1 then execute "who (c" capturing out crt "user,acct on port 2 is ": crt oconv('u%2','u50bb'):"," conv('a%2','u50bb') |
#5
| |||
| |||
|
|
equivalent of \ field(oconv('u%2','u50bb'),"*",1) \ |
#6
| |||
| |||
|
|
port1 = @pib port2 = oconv('p','u50bb') |
#7
| |||
| |||
|
|
for completeness, don't forget about the "charge-to" side-effect... which suffixes both an asterisk and text to each user id. eg. "charge-to client1" will cause a user logged into "user" to be seen as "user*client1" vs "user" in each of your code examples. ie. if you truly want the "pure" user name, you must always perform the equivalent of \field(oconv('u%2','u50bb'),"*",1)\ although seldom used these days "charge-to" feature (which also ties into the logon accounting option ('a'-option) on tracking user statistics)... will cause unwanted side-effects to many-a-application logic not allowing for it. Another 'gotcha' is, the tcl-stacks item id that bears your history of |
#8
| |||
| |||
|
|
Another 'gotcha' is, the tcl-stacks item id that bears your history of recent commands is kept in item id same as your user id normally, but an "i" on a9 of your users item makes the item id be your port number instead. I've never seen a client use this "i", but was once unamused to find charge-to in use during a new client conversion to d3. |
#9
| |||
| |||
|
|
for completeness, don't forget about the "charge-to" side-effect... which suffixes both an asterisk and text to each user id. eg. "charge-to client1" will cause a user logged into "user" to be seen as "user*client1" vs "user" in each of your code examples. ie. if you truly want the "pure" user name, you must always perform the equivalent of \field(oconv('u%2','u50bb'),"*",1)\ although seldom used these days "charge-to" feature (which also ties into the logon accounting option ('a'-option) on tracking user statistics)... will cause unwanted side-effects to many-a-application logic not allowing for it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |