Display 2fa status for all users on Admin's User account list. #2580

Closed
opened 2025-11-02 04:41:05 -06:00 by GiteaMirror · 11 comments
Owner

Originally created by @bugbounce on GitHub (Nov 27, 2018).

  • Gitea version (or commit ref): Not Relevant
  • Git version: Not relevant
  • Operating system: Not relevant
  • Database (use [x]): Not relevant
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

For Site administrators it would be helpful to see the 2fa status for all registered users.
...

screenshot 2018-11-27 at 13 31 38

Screenshots

Originally created by @bugbounce on GitHub (Nov 27, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): Not Relevant - Git version: Not relevant - Operating system: Not relevant - Database (use `[x]`): Not relevant - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ## Description For Site administrators it would be helpful to see the 2fa status for all registered users. ... <img width="1125" alt="screenshot 2018-11-27 at 13 31 38" src="https://user-images.githubusercontent.com/35751394/49067045-d156d380-f21a-11e8-8420-1cb0223445e3.png"> ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 04:41:05 -06:00
Author
Owner

@r-52 commented on GitHub (Nov 30, 2018):

If no one is working on this one, could I take a look the next days?

@r-52 commented on GitHub (Nov 30, 2018): If no one is working on this one, could I take a look the next days?
Author
Owner

@lafriks commented on GitHub (Nov 30, 2018):

noone is currently working on so you are free to look at this, thanks :)

@lafriks commented on GitHub (Nov 30, 2018): noone is currently working on so you are free to look at this, thanks :)
Author
Owner

@bugbounce commented on GitHub (Nov 30, 2018):

I did start looking at this. Although I haven't spent much time, but I see 3 broad options to get this done. Considering 2fa data is stored in a separate table, following approaches could be considered in order of increasing complexity -

  • Option 1 - Update the RenderUserSearch() and models.SearchUsers() functions along with dependencies and add relevant template. This will require change in return types of the mentioned functions. Might break a few things. Pros - No DB changes.
  • Option 2 - Add a parameter in the User struct and define the value and the end of the render flow for user list . However in my opinion, this approach will need the new parameter to be defined for all flows to maintain consistency.
  • Option3 - Add a new column in the User table. This will need all user flows to be rechecked and all two factor flows to have additional DB queries. and additional unit tests.

Please consider. I am happy to do this alone or in collaboration.

@bugbounce commented on GitHub (Nov 30, 2018): I did start looking at this. Although I haven't spent much time, but I see 3 broad options to get this done. Considering 2fa data is stored in a separate table, following approaches could be considered in order of increasing complexity - - Option 1 - Update the RenderUserSearch() and models.SearchUsers() functions along with dependencies and add relevant template. This will require change in return types of the mentioned functions. Might break a few things. Pros - No DB changes. - Option 2 - Add a parameter in the User struct and define the value and the end of the render flow for user list . However in my opinion, this approach will need the new parameter to be defined for all flows to maintain consistency. - Option3 - Add a new column in the User table. This will need all user flows to be rechecked and all two factor flows to have additional DB queries. and additional unit tests. Please consider. I am happy to do this alone or in collaboration.
Author
Owner

@fizzyade commented on GitHub (Jan 13, 2020):

This is an important feature for organisations, making sure that your team have 2fa.

Infact, I'd go as far as to say that there should be an option in team that will only allow access if 2fa is currently enabled on the users account.

@fizzyade commented on GitHub (Jan 13, 2020): This is an important feature for organisations, making sure that your team have 2fa. Infact, I'd go as far as to say that there should be an option in team that will only allow access if 2fa is currently enabled on the users account.
Author
Owner

@sapk commented on GitHub (Jan 14, 2020):

For insight, you can base yourself on https://github.com/go-gitea/gitea/pull/7621/files that display 2fa status of org members.

@sapk commented on GitHub (Jan 14, 2020): For insight, you can base yourself on https://github.com/go-gitea/gitea/pull/7621/files that display 2fa status of org members.
Author
Owner

@fizzyade commented on GitHub (Jan 14, 2020):

Am I correct in saying that this shows the 2fa status once a user has been added to the organisation? This I can see in my version.

What I need to be able to do, is see the 2fa status before I add the user to ensure that they've enabled 2fa.

@fizzyade commented on GitHub (Jan 14, 2020): Am I correct in saying that this shows the 2fa status once a user has been added to the organisation? This I can see in my version. What I need to be able to do, is see the 2fa status before I add the user to ensure that they've enabled 2fa.
Author
Owner

@sapk commented on GitHub (Jan 14, 2020):

@fizzyade yes that for user when they are in organisation.
I just mention this because tests, UI and some part of code could be re-used or already exist to help.

https://github.com/go-gitea/gitea/pull/7621/files#diff-50ac9f9eb4533caadad36718d8cbccd0R37
https://github.com/go-gitea/gitea/pull/7621/files#diff-99af862ff39d136ada33d1bc83487e44R66

@sapk commented on GitHub (Jan 14, 2020): @fizzyade yes that for user when they are in organisation. I just mention this because tests, UI and some part of code could be re-used or already exist to help. https://github.com/go-gitea/gitea/pull/7621/files#diff-50ac9f9eb4533caadad36718d8cbccd0R37 https://github.com/go-gitea/gitea/pull/7621/files#diff-99af862ff39d136ada33d1bc83487e44R66
Author
Owner

@sapk commented on GitHub (Jan 14, 2020):

To respond to @bugbounce, the existing solution is another option (yet similar to option 2) already existing.
There is a function to retrieve the 2fa status of a user list and return a map linking userid to 2fa status. This map can be linked to context and re-used for display.

@sapk commented on GitHub (Jan 14, 2020): To respond to @bugbounce, the existing solution is another option (yet similar to option 2) already existing. There is a function to retrieve the 2fa status of a user list and return a map linking userid to 2fa status. This map can be linked to context and re-used for display.
Author
Owner

@bugbounce commented on GitHub (Apr 17, 2020):

Is anybody working on this ? I think I can manage this in the coming week or so.

@bugbounce commented on GitHub (Apr 17, 2020): Is anybody working on this ? I think I can manage this in the coming week or so.
Author
Owner

@guillep2k commented on GitHub (Apr 18, 2020):

@bugbounce please feel free. 😄

@guillep2k commented on GitHub (Apr 18, 2020): @bugbounce please feel free. 😄
Author
Owner

@zeripath commented on GitHub (Sep 2, 2020):

Fixed by #12515

@zeripath commented on GitHub (Sep 2, 2020): Fixed by #12515
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2580