mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
golint fixed for modules/auth
This commit is contained in:
@@ -60,7 +60,7 @@ func NewUser(ctx *context.Context) {
|
||||
}
|
||||
|
||||
// NewUserPost response for adding a new user
|
||||
func NewUserPost(ctx *context.Context, form auth.AdminCrateUserForm) {
|
||||
func NewUserPost(ctx *context.Context, form auth.AdminCreateUserForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users.new_account")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
|
@@ -177,8 +177,8 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
|
||||
ctxUser := ctx.User
|
||||
// Not equal means context user is an organization,
|
||||
// or is another user/organization if current user is admin.
|
||||
if form.Uid != ctxUser.ID {
|
||||
org, err := models.GetUserByID(form.Uid)
|
||||
if form.UID != ctxUser.ID {
|
||||
org, err := models.GetUserByID(form.UID)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(422, "", err)
|
||||
|
@@ -89,7 +89,7 @@ func Install(ctx *context.Context) {
|
||||
form.Domain = setting.Domain
|
||||
form.SSHPort = setting.SSH.Port
|
||||
form.HTTPPort = setting.HTTPPort
|
||||
form.AppUrl = setting.AppURL
|
||||
form.AppURL = setting.AppURL
|
||||
form.LogRootPath = setting.LogRootPath
|
||||
|
||||
// E-mail service settings
|
||||
@@ -217,8 +217,8 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
|
||||
return
|
||||
}
|
||||
|
||||
if form.AppUrl[len(form.AppUrl)-1] != '/' {
|
||||
form.AppUrl += "/"
|
||||
if form.AppURL[len(form.AppURL)-1] != '/' {
|
||||
form.AppURL += "/"
|
||||
}
|
||||
|
||||
// Save settings.
|
||||
@@ -242,7 +242,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
|
||||
cfg.Section("").Key("RUN_USER").SetValue(form.RunUser)
|
||||
cfg.Section("server").Key("DOMAIN").SetValue(form.Domain)
|
||||
cfg.Section("server").Key("HTTP_PORT").SetValue(form.HTTPPort)
|
||||
cfg.Section("server").Key("ROOT_URL").SetValue(form.AppUrl)
|
||||
cfg.Section("server").Key("ROOT_URL").SetValue(form.AppURL)
|
||||
|
||||
if form.SSHPort == 0 {
|
||||
cfg.Section("server").Key("DISABLE_SSH").SetValue("true")
|
||||
@@ -328,5 +328,5 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
|
||||
|
||||
log.Info("First-time run install finished!")
|
||||
ctx.Flash.Success(ctx.Tr("install.install_success"))
|
||||
ctx.Redirect(form.AppUrl + "user/login")
|
||||
ctx.Redirect(form.AppURL + "user/login")
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ func ForkPost(ctx *context.Context, form auth.CreateRepoForm) {
|
||||
return
|
||||
}
|
||||
|
||||
ctxUser := checkContextUser(ctx, form.Uid)
|
||||
ctxUser := checkContextUser(ctx, form.UID)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
|
||||
ctx.Data["Licenses"] = models.Licenses
|
||||
ctx.Data["Readmes"] = models.Readmes
|
||||
|
||||
ctxUser := checkContextUser(ctx, form.Uid)
|
||||
ctxUser := checkContextUser(ctx, form.UID)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
@@ -167,7 +167,7 @@ func Migrate(ctx *context.Context) {
|
||||
func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("new_migrate")
|
||||
|
||||
ctxUser := checkContextUser(ctx, form.Uid)
|
||||
ctxUser := checkContextUser(ctx, form.UID)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user