Ticket #3619 (closed enhancement: fixed)

Opened 2 years ago

Last modified 8 months ago

notebook -- record date & time each user logs in

Reported by: TimothyClemans Owned by: TimothyClemans
Priority: major Milestone: sage-4.3
Component: notebook Keywords:
Cc: Author(s): William Stein
Report Upstream: N/A Reviewer(s): Tim Dumol
Merged in: Work issues:

Description


Attachments

sage-3619.patch Download (4.5 KB) - added by TimothyClemans 2 years ago.
Depends on #3776
sagenb-3619.patch Download (5.0 KB) - added by was 10 months ago.
new patch against sagenb that simply adds calls to log.msg in a few places, which will properly log user login attempts using the standard twisted loging facility

Change History

  Changed 2 years ago by TimothyClemans

  • owner changed from boothby to TimothyClemans
  • status changed from new to assigned

  Changed 2 years ago by TimothyClemans

  • summary changed from notebook -- record date & time each user logs in to [with patch, needs review] notebook -- record date & time each user logs in

I couldn't seem to figure out how to get AdminToplevel? to be the toplevel for admins.

follow-up: ↓ 4   Changed 2 years ago by ncalexan

I don't understand what the final comment, about AdminToplevel?, is about.

I worry that we will hang on to thousands of login times with this, which could be memory/disk intensive. Could we agree on the last fifty login times, or the first time ever and then the next 100 or something similar?

Also, there is no way to view this information. Why are we keeping it?

in reply to: ↑ 3   Changed 2 years ago by TimothyClemans

Replying to ncalexan:

I don't understand what the final comment, about AdminToplevel?, is about.

Somehow the user account type for the user admin was getting changed to 'user'. This is no longer a problem because a patch was merged which has account_type returning 'admin' for user admin no matter what.

I worry that we will hang on to thousands of login times with this, which could be memory/disk intensive. Could we agree on the last fifty login times, or the first time ever and then the next 100 or something similar?

We could, but I am very interested in being able to look up all login times for a given user.

Also, there is no way to view this information. Why are we keeping it?

There will be. I just didn't do it because at the time I couldn't figure out the AdminToplevel? problem.

I'll get back to this ticket after thinking more about it. Thanks for reviewing.

  Changed 2 years ago by TimothyClemans

  • summary changed from [with patch, needs review] notebook -- record date & time each user logs in to [with patch, needs work] notebook -- record date & time each user logs in

  Changed 2 years ago by TimothyClemans

  • summary changed from [with patch, needs work] notebook -- record date & time each user logs in to [with patch, needs review] notebook -- record date & time each user logs in

How I test this:

(1) I login and then go to sage.math.washington.edu:8999/users # Table of users with two links next to each of them if login recording is on.

(2) I click on "Access" in third column to see login times. The page should be blank if no login times have been recorded.

Login recording is turned off by default. In order to turn it on I do:

*** WARNING: Notebook must not be running! ***

sage: nb = load('.sage/sage_notebook/nb.sobj', compress=False)
sage: nb.conf()['record_logins'] = True
sage: nb.save(filename='/home/tclemans/.sage/sage_notebook/nb.sobj')

Changed 2 years ago by TimothyClemans

Depends on #3776

  Changed 2 years ago by TimothyClemans

  • summary changed from [with patch, needs review] notebook -- record date & time each user logs in to [with patch, needs work] notebook -- record date & time each user logs in

Changed 10 months ago by was

new patch against sagenb that simply adds calls to log.msg in a few places, which will properly log user login attempts using the standard twisted loging facility

  Changed 10 months ago by was

  • status changed from needs_work to needs_review
  • summary changed from [with patch, needs work] notebook -- record date & time each user logs in to [with patch, needs review] notebook -- record date & time each user logs in

I've attached a new patch against sagenb that simply adds calls to log.msg in a few places, which will properly log user login attempts using the standard twisted loging facility. I also deleted some cruft from guard.py that wasn't used.

  Changed 9 months ago by timdumol

  • status changed from needs_review to positive_review
  • reviewer set to Tim Dumol
  • upstream set to N/A
  • author set to William Stein

Applied and the patch works perfectly. I wonder though whether a configuration setting should be added?

  Changed 9 months ago by was

Applied and the patch works perfectly. I wonder though whether a configuration setting should be added?

Yes, definitely. However, I don't think that has to be done in this patch. Little steps are best.

  Changed 9 months ago by was

  • status changed from positive_review to closed
  • resolution set to fixed

  Changed 8 months ago by mvngu

  • summary changed from [with patch, needs review] notebook -- record date & time each user logs in to notebook -- record date & time each user logs in
Note: See TracTickets for help on using tickets.