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.
43 lines
1.1 KiB
43 lines
1.1 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"
|
||
|
"gopkg.in/macaron.v1"
|
||
11 years ago
|
)
|
||
|
|
||
8 years ago
|
type Authentication struct {
|
||
9 years ago
|
ID int64
|
||
|
Type int `binding:"Range(2,5)"`
|
||
|
Name string `binding:"Required;MaxSize(30)"`
|
||
|
Host string
|
||
|
Port int
|
||
|
BindDN string
|
||
|
BindPassword string
|
||
|
UserBase string
|
||
9 years ago
|
UserDN string
|
||
9 years ago
|
AttributeUsername string
|
||
|
AttributeName string
|
||
|
AttributeSurname string
|
||
|
AttributeMail string
|
||
9 years ago
|
AttributesInBind bool
|
||
9 years ago
|
Filter string
|
||
|
AdminFilter string
|
||
|
IsActive bool
|
||
|
SMTPAuth string
|
||
|
SMTPHost string
|
||
|
SMTPPort int
|
||
|
AllowedDomains string
|
||
9 years ago
|
SecurityProtocol int `binding:"Range(0,2)"`
|
||
9 years ago
|
TLS bool
|
||
|
SkipVerify bool
|
||
9 years ago
|
PAMServiceName string
|
||
11 years ago
|
}
|
||
|
|
||
8 years ago
|
func (f *Authentication) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||
10 years ago
|
return validate(errs, ctx.Data, f, ctx.Locale)
|
||
11 years ago
|
}
|