Conversation
|
What if you stop the gitit instance and start it up again? Is the information about login times persistent? This would presumably require writing to the users database file. I am not wild about the idea of rewriting that file every time anyone makes a change... |
|
The information about login times is persistent; that stuff is in the first commit. What I do is call |
|
Well, my instinct was to avoid touching the login file that frequently, +++ Shane [Apr 12 14 12:35 ]:
|
|
I can understand that instinct. I'm not sure about the specifics, but my worry would be if two users log in at exactly the same time and that somehow some sort of race condition occurs? But seeing as updateGititState uses atomicModifyIORef that should be fine, unless there are two separate gitit instances running at the same time which use the same gitit-users file, but I don't think this a use case we need to worry about supporting. |
To go along with this change, I also added a hand-written Read instance for User, so that old gitit-users files before this change can still be read.
This displays a table of all the users of the site, including the times they last logged in. By default, the table does not show user's email addresses. I added a config option that enables this which is off by default. When displaying email addresses, it uses pandoc's reference obfuscation.
This displays a table of all the users of the site, including the times they last logged in.
By default, the table does not show user's email addresses. I added a config option that enables this which is off by default. When displaying email addresses, it uses pandoc's reference obfuscation.
I also added two fields, both
UTCTime, to theUserdata type:uCreatedanduLastSeen. In order for this to be backwards-compatible with existing installs of gitit, I added a hand-writtenReadinstance forUser, which can parse the oldUsertype as well as the new one.