MCPcopy Create free account
hub / github.com/gogs/gogs / NewUser

Function NewUser

internal/route/admin/users.go:39–55  ·  view source on GitHub ↗
(c *context.Context)

Source from the content-addressed store, hash-verified

37}
38
39func NewUser(c *context.Context) {
40 c.Data["Title"] = c.Tr("admin.users.new_account")
41 c.Data["PageIsAdmin"] = true
42 c.Data["PageIsAdminUsers"] = true
43
44 c.Data["login_type"] = "0-0"
45
46 sources, err := database.Handle.LoginSources().List(c.Req.Context(), database.ListLoginSourceOptions{})
47 if err != nil {
48 c.Error(err, "list login sources")
49 return
50 }
51 c.Data["Sources"] = sources
52
53 c.Data["CanSendEmail"] = conf.Email.Enabled
54 c.Success(tmplAdminUserNew)
55}
56
57func NewUserPost(c *context.Context, f form.AdminCrateUser) {
58 c.Data["Title"] = c.Tr("admin.users.new_account")

Callers

nothing calls this directly

Calls 5

TrMethod · 0.80
LoginSourcesMethod · 0.80
SuccessMethod · 0.80
ListMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected