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

Add course admin tool to manage OTP secrets. #2618

Merged
merged 2 commits into from
Nov 24, 2024

Conversation

somiaj
Copy link
Contributor

@somiaj somiaj commented Nov 9, 2024

Adds a page in the admin course that can be used to copy OTP secrets from one user to another or to reset OTP secrets. This allows copying an OTP secret from a single user in one course to a different user in the same or different course. Copying multiple secrets from users in a single course to one or more other courses, provided the user names are the same. Or to reset one or more OTP secrets for users in a single course.

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this looks good, and will be a useful tool for system administrators in some cases.

There is a situation that is perhaps not so good. Basically, when this new page loads it reads all users for all courses from the database and the user dropdowns then contain all of those users. If there are a large number of users and courses that is troubling. The database read is still rather quick, but the dropdown loading is not. I have a course with more than 20,000 users, and the page loads relatively quickly, but if I select that course, and open the users dropdown I see the CPU usage spike rather heavily as the browser loads the contents.

@somiaj
Copy link
Contributor Author

somiaj commented Nov 11, 2024

We could put some protection on that (or at least a warning), similar to the accounts page, only show some users (maybe just any user that isn't a student) and have a toggle they can hit so they include all users. In general having 20,000 students, this page would be a bit annoying to have to search for and find the few students you wanted to copy anyways.

@somiaj
Copy link
Contributor Author

somiaj commented Nov 12, 2024

I added a check to only include smaller courses (less than 200 users) by default, and a warning and a button to show all courses is shown if any courses are ignored/skipped.

@somiaj somiaj force-pushed the manage-otp-secrets branch 2 times, most recently from 99a91b0 to 572a593 Compare November 13, 2024 05:45
Adds a page in the admin course that can be used to copy OTP
secrets from one user to another or to reset OTP secrets. This
allows copying an OTP secret from a single user in one course to
a different user in the same or different course. Copying multiple
secrets from users in a single course to one or more other courses,
provided the user names are the same. Or to reset one or more OTP
secrets for users in a single course.
Large courses can cause a lot of CPU load when the javascript generates
the menus to select users of the course. Also large courses will be hard
to navigate with using the menus. By default courses with 200 or more
users will not be listed in the drop down menus.

If any course is not included, a warning will state which courses have
been ignored and a button to show all courses will appear. The ignored
courses are still listed in the list of destination courses when
copying multiple secrets.
@Alex-Jordan Alex-Jordan merged commit 0d15519 into openwebwork:develop Nov 24, 2024
2 checks passed
@somiaj somiaj deleted the manage-otp-secrets branch November 24, 2024 19:02
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.

3 participants