func EditUser(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("admin.users.edit_account") ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminUsers"] = true uid := com.StrTo(ctx.Params(":userid")).MustInt64() if uid == 0 { ctx.Handle(404, "EditUser", nil) return } u, err := models.GetUserByID(uid) if err != nil { ctx.Handle(500, "GetUserByID", err) return } ctx.Data["User"] = u auths, err := models.GetAuths() if err != nil { ctx.Handle(500, "GetAuths", err) return } ctx.Data["LoginSources"] = auths ctx.HTML(200, USER_EDIT) }
func NewUser(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("admin.users.new_account") ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminUsers"] = true auths, err := models.GetAuths() if err != nil { ctx.Handle(500, "GetAuths", err) return } ctx.Data["LoginSources"] = auths ctx.HTML(200, USER_NEW) }
func Authentications(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("admin.authentication") ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminAuthentications"] = true var err error ctx.Data["Sources"], err = models.GetAuths() if err != nil { ctx.Handle(500, "GetAuths", err) return } ctx.HTML(200, AUTHS) }