2 Replies Latest reply on Apr 7, 2014 9:28 AM by Mike_Mitchell

    How can I return info on Remote Access users

    beaconny

      I know that you can use get(UserCount) to know if there are users logged on remotely.

       

      My questions are:

       

      1) Is there a way to know (and thus record) when a user signs on using Remote Access. Would like to provide different menus for Remote Users and the Host User.

       

      2) Is there a way to keep a list of the remote users that are logged on?

       

      All help appreciated.

        • 1. Re: How can I return info on Remote Access users
          taylorsharpe

          There is no built in function that does this.  Maybe you could get the IP and see if the IPs are local or not.  You can tell if someone is using a Cellular network with the Get(NetworkType), but that really doesn't help this question.  Maybe a plugin could help.  There are a lot of functions on the Monkey Bread Software plugin that might help like maybe at http://www.mbsplugins.eu/component_Socket.shtml or something out of the CURL library at http://www.mbsplugins.eu/component_Socket.shtml 

          • 2. Re: How can I return info on Remote Access users
            Mike_Mitchell

            You can do something like this by creating a Sessions table. When a user logs in, you script creating a record in this table with that person's account name, timestamp of entry, and perhaps other information (like source machine info or privilege set). When he logs out, you record an exit timestamp. You can create a list of all "logged on" users by finding all Session records that don't have exit timestamps.

             

            However, this method is far from foolproof. It's vulnerable to network disconnects, crashes, three-finger-fixes, and other instances where the user can be disconnected without running the appropriate logout script. In such a case, the user shows up as "logged in" when he's really not. It's better to use FileMaker Server and run a batch job that exports the data from the server console on some frequency, which you can then import to a FileMaker table. However, based on the way your question is written, it sounds like you're doing peer-to-peer sharing. Hence, this option's not open to you (if I'm reading you correctly).

             

            You can somewhat compensate for the "stranded" session problem by setting some sort of refresh timestamp in your Sessions table, where every time the user takes an action, you update the timestamp. Then, you can run a script periodically (through, say, an OnTimer window) that looks for any session that's older than some predetermined idle time and closes it. If the user really isn't disconnected, you can have your update script open him a new session.

             

            Bit of a kludge, but it (mostly) works.

             

            HTH

             

            Mike