0

logging user access?

Is there a way with Ninox to log when users access the database? I'm interested in knowing who logs in and when. Ideally would also be nice to know when they close the database (i.e. how long they're in), what IP they connect from, maybe their location.

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I do something similar to track database record access.  It may work for you.  I have a hidden table called AccessLog consisting of 5 fields:  User Name, User Email, Table, Record Id, and DateAccessed.  This table has a 'Trigger on new record' with the script:

    'User Name' := userName();
    'User Email' := userEmail();
    DateAccessed := now()

    I then have a global function:

    function AccessLog(table : text,id : number) do
        let al := (create AccessLog);
        al.(Table := text(table));
        al.('Record Id' := id)
    end;

    And finally, on all my tables I have a main Tab element (on to which the fields sit) with a 'Trigger before view' script that calls the function:

    AccessLog("TableX", number(this.Id))

    Every time a record in the table called "TableX" (or whatever) is accessed a new entry is added to the AccessLog.

    Doesn't log IP address, but you can see when they last accessed any records which probably indicates when they "logged off".

    Like
Like Follow
  • 8 days agoLast active
  • 1Replies
  • 20Views
  • 2 Following