Files
gitea/templates/admin/user/view_details.tmpl
T
3bec08f998 feat: manage bot accounts from the admin UI, API and CLI (#38966)
Adds first-class bot accounts (`UserTypeBot`): local, password-less
users for automation that authenticate only with access tokens.

1. Admin UI: create bots, filter users by type, manage a bot's access
tokens, convert between user and bot
2. API: `POST /admin/users/{username}/convert-type`, and user objects
gain a GitHub-compatible `type` (`User`, `Organization`, `Bot`)
3. CLI: `gitea admin user change-type`, `--user-type` accepts `User` or
`Bot` case-insensitively
4. Converting keeps the password, 2FA, OAuth2 grants and access tokens,
and since sign-in rejects bots, converting back restores the account.
Only local, non-admin accounts can be converted, and conversions are
audited
5. Session, reverse proxy, SSPI, external source and password reset
sign-in reject non-individual users, so a bot never gets an interactive
session
6. Bots receive no notifications or emails

Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: joestump <joe@joestump.net>
Co-authored-by: Joe Stump <joe@stu.mp>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-09-18 12:43:36 +00:00

63 lines
2.1 KiB
Handlebars

<div class="flex-divided-list items-with-main">
<div class="item">
<div class="item-leading">
{{ctx.AvatarUtils.Avatar .User 48}}
</div>
<div class="item-main">
<div class="item-title">
{{template "shared/user/name" .User}}
{{if .User.IsAdmin}}
<span class="ui basic label">{{ctx.Locale.Tr "admin.users.admin"}}</span>
{{end}}
</div>
<div class="item-body">
<b>{{ctx.Locale.Tr "admin.users.auth_source"}}:</b>
{{Iif (eq .LoginSource.ID 0) (ctx.Locale.Tr "admin.users.local") .LoginSource.Name}}
</div>
<div class="item-body">
<b>{{ctx.Locale.Tr "admin.users.activated"}}:</b>
{{svg (Iif .User.IsActive "octicon-check" "octicon-x")}}
</div>
<div class="item-body">
<b>{{ctx.Locale.Tr "admin.users.prohibit_login"}}:</b>
{{svg (Iif .User.ProhibitLogin "octicon-check" "octicon-x")}}
</div>
<div class="item-body">
<b>{{ctx.Locale.Tr "admin.users.restricted"}}:</b>
{{svg (Iif .User.IsRestricted "octicon-check" "octicon-x")}}
</div>
<div class="item-body">
<b>{{ctx.Locale.Tr "settings.visibility"}}:</b>
{{if .User.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
{{if .User.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
{{if .User.Visibility.IsPrivate}}{{ctx.Locale.Tr "settings.visibility.private"}}{{end}}
</div>
<div class="item-body">
<b>{{ctx.Locale.Tr "admin.users.2fa"}}:</b>
{{svg (Iif .TwoFactorEnabled "octicon-check" "octicon-x")}}
</div>
{{if .User.Language}}
<div class="item-body">
<span class="flex-text-inline">
<b>{{ctx.Locale.Tr "settings.language"}}:</b>
{{range .AllLangs}}{{if eq $.User.Language .Lang}}{{.Name}}{{end}}{{end}}
</span>
</div>
{{end}}
{{if .User.Location}}
<div class="item-body">
<span class="flex-text-inline">{{svg "octicon-location"}}{{.User.Location}}</span>
</div>
{{end}}
{{if .User.Website}}
<div class="item-body">
<span class="flex-text-inline">
{{svg "octicon-link"}}
<a target="_blank" href="{{.User.Website}}">{{.User.Website}}</a>
</span>
</div>
{{end}}
</div>
</div>
</div>