Colin:

@WHO actually does work (I'm pretty sure).  In the listing program I modify
the account value to "-none-" for phantoms and "UO/Web" for UniObjects.  

Bill

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Colin Alfke
Sent: Friday, September 26, 2008 2:08 PM
To: [email protected]
Subject: RE: [U2] no. of users program

Interesting - it looks like @WHO doesn't work for the Phantom user - is it a
created from a telnet or udcs user - does it matter?

You can try @PATH - it seems to work for phantoms. It shows the users
current full directory path - not just the "account." Of course, @ACCOUNT
shows the initial account that was used at login.

Hth
Colin Alfke
Calgary, Canada

> -----Original Message-----
> From: Bill Haskett
> 
> Wasn't one of the critical aspects of the original request to figure
> out how
> many users were logged into which account?
> 
> I don't know if UV has a simple function to find out who's logged into
> where?  UniData doesn't have this capability (that I know of).  As a
> result
> I had to create a new "LOGINS" file and inject some code into the LOGIN
> and
> UOLOGIN processes.  This code does something like:
> 
> *
> ** Open logins file and create logins record
> OPEN '', 'LOGINS' TO LOGINS.FV THEN
>    READU LoginRec FROM LOGINS.FV, PORT.NO ELSE LoginRec = NULL$
>    LoginRec<1>= @UDTNO
>    LoginRec<2>= @LOGNAME
>    LoginRec<3>= @WHO
>    GOSUB GET.IP.ADDRESS
>    LoginRec<4>= IPAddress
>    LoginRec<5>= DATE()
>    LoginRec<6>= TIME()
>    LoginRec<7>= @USER.TYPE                   ; ** UD version
>    WRITE LoginRec ON LOGINS.FV, PORT.NO
> END ELSE
>    CHAIN \LOFF\
> END
> 
> In UniData the @USER.TYPE doesn't work correctly all the time, but I'm
> not
> using this field at the moment.  To get the IP address, one has to do
> something like:
> 
> *
> ***************
> GET.IP.ADDRESS:
> ***************
> *
> IPAddress = "unknown"
> IF ISNT THEN
>    IPAddress = SYSTEM(512)
>  END ELSE
>    UArray = LISTUSER()
>    xHigh  = DCOUNT(UArray, @AM)
>    FOR X = 1 TO xHigh
>       ULine = UArray<X>
>       UPort = ULine<1,1>
>       IF UPort = PORT.NO THEN
>          IPAddress = ULine<1,7>
>          EXIT
>       END
>    NEXT X
> END
> RETURN
> 
> Now, one can use this new "LOGINS" file to determine who is logged into
> where.  This isn't foolproof though, which is why I believe it should
> be an
> internal function of the dbms
> 
> Using the LOGOUT paragraph one can clean-up these LOGINS as one logs
> off.
> I'm not sure a UniObjects connection uses the LOGOUT paragraph (since
> it
> doesn't use the LOGIN paragraph) but it may.  Once the above is created
> you
> have to create a listing, to be able to look at what's happening.  Our
> listing looks like:
> 
> Advantos Logins Report                                   08:41:19 Sep
> 26
> 2008
> Port UsrNo.. User........... Acct/Path... IP Address..... In Time. In
> Date...
> 
>    1    2516 WPHASKETT       -none-       phantom         10:33:32
> 09/01/2008
> 01 phantom(s) logged in.
> 
>    2    4060 WPHASKETT       DEV          192.168.1.101   08:05:46
> 09/26/2008
> *  3     524 WPHASKETT       DEV          192.168.1.101   08:41:16
> 09/26/2008
> 02 user(s) of 99 authorized logged into this account.
> 
> 
> All of this because UD doesn't have a reasonable way to tell me what
> account
> each user is logged into.
> 
> HTH,
> 
> Bill
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to