Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added user list page at _users #411

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added user list page at _users #411

wants to merge 2 commits into from

Conversation

duairc
Copy link
Contributor

@duairc duairc commented Apr 2, 2014

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 the User data type: uCreated and uLastSeen. In order for this to be backwards-compatible with existing installs of gitit, I added a hand-written Read instance for User, which can parse the old User type as well as the new one.

@jgm
Copy link
Owner

jgm commented Apr 12, 2014

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...

@duairc
Copy link
Contributor Author

duairc commented Apr 12, 2014

The information about login times is persistent; that stuff is in the first commit. What I do is call adjustUser every time a user logs in, which from what I can see, does in rewrite the users file every time it's called. It doesn't do this when a change is made, it does it whenever a user logs in (which is probably just as bad).

@jgm
Copy link
Owner

jgm commented Apr 14, 2014

Well, my instinct was to avoid touching the login file that frequently,
but on reflection, I'm not sure what would be so bad about it.

+++ Shane [Apr 12 14 12:35 ]:

The information about login times is persistent; that stuff is in the
first commit. What I do is call adjustUser every time a user logs in,
which from what I can see, does in rewrite the users file every time
it's called. It doesn't do this when a change is made, it does it
whenever a user logs in (which is probably just as bad).


Reply to this email directly or [1]view it on GitHub.
[3044__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMjk1MDU1NSwi
ZGF0YSI6eyJpZCI6MjkxNDgwNzB9fQ==--b8e838672f36e09016fac2522caae004ab5b3
afb.gif]

References

  1. Added user list page at _users #411 (comment)

@duairc
Copy link
Contributor Author

duairc commented Apr 14, 2014

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants