mirror of https://github.com/gogits/gogs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
11 years ago
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
8 years ago
|
package form
|
||
11 years ago
|
|
||
|
import (
|
||
9 years ago
|
"github.com/go-macaron/binding"
|
||
8 years ago
|
"gopkg.in/macaron.v1"
|
||
11 years ago
|
)
|
||
|
|
||
8 years ago
|
type AdminCrateUser struct {
|
||
9 years ago
|
LoginType string `binding:"Required"`
|
||
|
LoginName string
|
||
|
UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
|
||
|
Email string `binding:"Required;Email;MaxSize(254)"`
|
||
|
Password string `binding:"MaxSize(255)"`
|
||
|
SendNotify bool
|
||
9 years ago
|
}
|
||
|
|
||
8 years ago
|
func (f *AdminCrateUser) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||
9 years ago
|
return validate(errs, ctx.Data, f, ctx.Locale)
|
||
|
}
|
||
|
|
||
8 years ago
|
type AdminEditUser struct {
|
||
9 years ago
|
LoginType string `binding:"Required"`
|
||
|
LoginName string
|
||
|
FullName string `binding:"MaxSize(100)"`
|
||
|
Email string `binding:"Required;Email;MaxSize(254)"`
|
||
|
Password string `binding:"MaxSize(255)"`
|
||
|
Website string `binding:"MaxSize(50)"`
|
||
|
Location string `binding:"MaxSize(50)"`
|
||
9 years ago
|
MaxRepoCreation int
|
||
9 years ago
|
Active bool
|
||
|
Admin bool
|
||
|
AllowGitHook bool
|
||
|
AllowImportLocal bool
|
||
8 years ago
|
ProhibitLogin bool
|
||
11 years ago
|
}
|
||
|
|
||
8 years ago
|
func (f *AdminEditUser) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||
10 years ago
|
return validate(errs, ctx.Data, f, ctx.Locale)
|
||
11 years ago
|
}
|