mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-14 01:35:55 +09:00
Merge branch 'develop' of https://github.com/SergioBenitez/gogs into develop
# Conflicts: # modules/bindata/bindata.go
This commit is contained in:
commit
cbd6276200
10 files changed
+211
-146
No files matched your search
@@ -817,6 +817,7 @@ auths.port = Port
|
||||
auths.bind_dn = Bind DN
|
||||
auths.bind_password = Bind Password
|
||||
auths.user_base = User Search Base
|
||||
auths.user_dn = User DN
|
||||
auths.attribute_name = First name attribute
|
||||
auths.attribute_surname = Surname attribute
|
||||
auths.attribute_mail = E-mail attribute
|
||||
|
||||
+59
-63
@@ -27,6 +27,7 @@ const (
|
||||
NOTYPE LoginType = iota
|
||||
PLAIN
|
||||
LDAP
|
||||
DLDAP
|
||||
SMTP
|
||||
PAM
|
||||
)
|
||||
@@ -38,9 +39,10 @@ var (
|
||||
)
|
||||
|
||||
var LoginTypes = map[LoginType]string{
|
||||
LDAP: "LDAP",
|
||||
SMTP: "SMTP",
|
||||
PAM: "PAM",
|
||||
LDAP: "LDAP (via BindDN)",
|
||||
DLDAP: "LDAP (simple auth)",
|
||||
SMTP: "SMTP",
|
||||
PAM: "PAM",
|
||||
}
|
||||
|
||||
// Ensure structs implemented interface.
|
||||
@@ -106,6 +108,8 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) {
|
||||
case "type":
|
||||
switch LoginType((*val).(int64)) {
|
||||
case LDAP:
|
||||
fallthrough
|
||||
case DLDAP:
|
||||
source.Cfg = new(LDAPConfig)
|
||||
case SMTP:
|
||||
source.Cfg = new(SMTPConfig)
|
||||
@@ -171,84 +175,74 @@ func DelLoginSource(source *LoginSource) error {
|
||||
|
||||
// UserSignIn validates user name and password.
|
||||
func UserSignIn(uname, passwd string) (*User, error) {
|
||||
u := new(User)
|
||||
var u *User
|
||||
if strings.Contains(uname, "@") {
|
||||
u = &User{Email: uname}
|
||||
} else {
|
||||
u = &User{LowerName: strings.ToLower(uname)}
|
||||
}
|
||||
|
||||
has, err := x.Get(u)
|
||||
userExists, err := x.Get(u)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if u.LoginType == NOTYPE && has {
|
||||
u.LoginType = PLAIN
|
||||
}
|
||||
|
||||
// For plain login, user must exist to reach this line.
|
||||
// Now verify password.
|
||||
if u.LoginType == PLAIN {
|
||||
if !u.ValidatePassword(passwd) {
|
||||
return nil, ErrUserNotExist{u.Id, u.Name}
|
||||
}
|
||||
return u, nil
|
||||
}
|
||||
|
||||
if !has {
|
||||
var sources []LoginSource
|
||||
if err = x.UseBool().Find(&sources,
|
||||
&LoginSource{IsActived: true, AllowAutoRegister: true}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, source := range sources {
|
||||
if source.Type == LDAP {
|
||||
u, err := LoginUserLdapSource(nil, uname, passwd,
|
||||
source.ID, source.Cfg.(*LDAPConfig), true)
|
||||
if err == nil {
|
||||
return u, nil
|
||||
}
|
||||
log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err)
|
||||
} else if source.Type == SMTP {
|
||||
u, err := LoginUserSMTPSource(nil, uname, passwd,
|
||||
source.ID, source.Cfg.(*SMTPConfig), true)
|
||||
if err == nil {
|
||||
return u, nil
|
||||
}
|
||||
log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err)
|
||||
} else if source.Type == PAM {
|
||||
u, err := LoginUserPAMSource(nil, uname, passwd,
|
||||
source.ID, source.Cfg.(*PAMConfig), true)
|
||||
if err == nil {
|
||||
return u, nil
|
||||
}
|
||||
log.Warn("Fail to login(%s) by PAM(%s): %v", uname, source.Name, err)
|
||||
if userExists {
|
||||
switch u.LoginType {
|
||||
case NOTYPE:
|
||||
fallthrough
|
||||
case PLAIN:
|
||||
if u.ValidatePassword(passwd) {
|
||||
return u, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, ErrUserNotExist{u.Id, u.Name}
|
||||
return nil, ErrUserNotExist{u.Id, u.Name}
|
||||
default:
|
||||
var source LoginSource
|
||||
hasSource, err := x.Id(u.LoginSource).Get(&source)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !hasSource {
|
||||
return nil, ErrLoginSourceNotExist
|
||||
}
|
||||
|
||||
return ExternalUserLogin(u, u.LoginName, passwd, &source, false)
|
||||
}
|
||||
}
|
||||
|
||||
var source LoginSource
|
||||
hasSource, err := x.Id(u.LoginSource).Get(&source)
|
||||
if err != nil {
|
||||
var sources []LoginSource
|
||||
if err = x.UseBool().Find(&sources, &LoginSource{IsActived: true, AllowAutoRegister: true}); err != nil {
|
||||
return nil, err
|
||||
} else if !hasSource {
|
||||
return nil, ErrLoginSourceNotExist
|
||||
} else if !source.IsActived {
|
||||
}
|
||||
|
||||
for _, source := range sources {
|
||||
u, err := ExternalUserLogin(nil, uname, passwd, &source, true)
|
||||
if err == nil {
|
||||
return u, nil
|
||||
}
|
||||
|
||||
log.Warn("Failed to login '%s' via '%s': %v", uname, source.Name, err)
|
||||
}
|
||||
|
||||
return nil, ErrUserNotExist{u.Id, u.Name}
|
||||
}
|
||||
|
||||
func ExternalUserLogin(u *User, name, passwd string, source *LoginSource, autoRegister bool) (*User, error) {
|
||||
if !source.IsActived {
|
||||
return nil, ErrLoginSourceNotActived
|
||||
}
|
||||
|
||||
switch u.LoginType {
|
||||
switch source.Type {
|
||||
case LDAP:
|
||||
return LoginUserLdapSource(u, u.LoginName, passwd, source.ID, source.Cfg.(*LDAPConfig), false)
|
||||
fallthrough
|
||||
case DLDAP:
|
||||
return LoginUserLdapSource(u, name, passwd, source, autoRegister)
|
||||
case SMTP:
|
||||
return LoginUserSMTPSource(u, u.LoginName, passwd, source.ID, source.Cfg.(*SMTPConfig), false)
|
||||
return LoginUserSMTPSource(u, name, passwd, source.ID, source.Cfg.(*SMTPConfig), autoRegister)
|
||||
case PAM:
|
||||
return LoginUserPAMSource(u, u.LoginName, passwd, source.ID, source.Cfg.(*PAMConfig), false)
|
||||
return LoginUserPAMSource(u, name, passwd, source.ID, source.Cfg.(*PAMConfig), autoRegister)
|
||||
}
|
||||
|
||||
return nil, ErrUnsupportedLoginType
|
||||
}
|
||||
|
||||
@@ -256,8 +250,10 @@ func UserSignIn(uname, passwd string) (*User, error) {
|
||||
// Create a local user if success
|
||||
// Return the same LoginUserPlain semantic
|
||||
// FIXME: https://github.com/gogits/gogs/issues/672
|
||||
func LoginUserLdapSource(u *User, name, passwd string, sourceId int64, cfg *LDAPConfig, autoRegister bool) (*User, error) {
|
||||
fn, sn, mail, admin, logged := cfg.Ldapsource.SearchEntry(name, passwd)
|
||||
func LoginUserLdapSource(u *User, name, passwd string, source *LoginSource, autoRegister bool) (*User, error) {
|
||||
cfg := source.Cfg.(*LDAPConfig)
|
||||
directBind := (source.Type == DLDAP)
|
||||
fn, sn, mail, admin, logged := cfg.Ldapsource.SearchEntry(name, passwd, directBind)
|
||||
if !logged {
|
||||
// User not in LDAP, do nothing
|
||||
return nil, ErrUserNotExist{0, name}
|
||||
@@ -276,8 +272,8 @@ func LoginUserLdapSource(u *User, name, passwd string, sourceId int64, cfg *LDAP
|
||||
LowerName: strings.ToLower(name),
|
||||
Name: name,
|
||||
FullName: fn + " " + sn,
|
||||
LoginType: LDAP,
|
||||
LoginSource: sourceId,
|
||||
LoginType: source.Type,
|
||||
LoginSource: source.ID,
|
||||
LoginName: name,
|
||||
Passwd: passwd,
|
||||
Email: mail,
|
||||
|
||||
@@ -19,6 +19,7 @@ type AuthenticationForm struct {
|
||||
BindDN string `form:"bind_dn"`
|
||||
BindPassword string
|
||||
UserBase string
|
||||
UserDN string `form:"user_dn"`
|
||||
AttributeName string
|
||||
AttributeSurname string
|
||||
AttributeMail string
|
||||
|
||||
+77
-40
@@ -4,61 +4,98 @@ Gogs LDAP Authentication Module
|
||||
## About
|
||||
|
||||
This authentication module attempts to authorize and authenticate a user
|
||||
against an LDAP server. Like most LDAP authentication systems, this module does
|
||||
this in two steps. First, it queries the LDAP server using a Bind DN and
|
||||
searches for the user that is attempting to sign in. If the user is found, the
|
||||
module attempts to bind to the server using the user's supplied credentials. If
|
||||
this succeeds, the user has been authenticated, and his account information is
|
||||
retrieved and passed to the Gogs login infrastructure.
|
||||
against an LDAP server. It provides two methods of authentication: LDAP via
|
||||
BindDN, and LDAP simple authentication.
|
||||
|
||||
LDAP via BindDN functions like most LDAP authentication systems. First, it
|
||||
queries the LDAP server using a Bind DN and searches for the user that is
|
||||
attempting to sign in. If the user is found, the module attempts to bind to the
|
||||
server using the user's supplied credentials. If this succeeds, the user has
|
||||
been authenticated, and his account information is retrieved and passed to the
|
||||
Gogs login infrastructure.
|
||||
|
||||
LDAP simple authentication does not utilize a Bind DN. Instead, it binds
|
||||
directly with the LDAP server using the user's supplied credentials. If the bind
|
||||
succeeds and no filter rules out the user, the user is authenticated.
|
||||
|
||||
LDAP via BindDN is recommended for most users. By using a Bind DN, the server
|
||||
can perform authorization by restricting which entries the Bind DN account can
|
||||
read. Further, using a Bind DN with reduced permissions can reduce security risk
|
||||
in the face of application bugs.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this module, add an LDAP authentication source via the Authentications
|
||||
section in the admin panel. The fields should be set as follows:
|
||||
section in the admin panel. Both the LDAP via BindDN and the simple auth LDAP
|
||||
share the following fields:
|
||||
|
||||
* Authorization Name **(required)**
|
||||
* A name to assign to the new method of authorization.
|
||||
* A name to assign to the new method of authorization.
|
||||
|
||||
* Host **(required)**
|
||||
* The address where the LDAP server can be reached.
|
||||
* Example: mydomain.com
|
||||
* The address where the LDAP server can be reached.
|
||||
* Example: mydomain.com
|
||||
|
||||
* Port **(required)**
|
||||
* The port to use when connecting to the server.
|
||||
* Example: 636
|
||||
* The port to use when connecting to the server.
|
||||
* Example: 636
|
||||
|
||||
* Enable TLS Encryption (optional)
|
||||
* Whether to use TLS when connecting to the LDAP server.
|
||||
* Whether to use TLS when connecting to the LDAP server.
|
||||
|
||||
* Bind DN (optional)
|
||||
* The DN to bind to the LDAP server with when searching for the user.
|
||||
This may be left blank to perform an anonymous search.
|
||||
* Example: cn=Search,dc=mydomain,dc=com
|
||||
|
||||
* Bind Password (optional)
|
||||
* The password for the Bind DN specified above, if any.
|
||||
|
||||
* User Search Base **(required)**
|
||||
* The LDAP base at which user accounts will be searched for.
|
||||
* Example: ou=Users,dc=mydomain,dc=com
|
||||
|
||||
* User Filter **(required)**
|
||||
* An LDAP filter declaring how to find the user record that is attempting
|
||||
to authenticate. The '%s' matching parameter will be substituted with
|
||||
the user's username.
|
||||
* Example: (&(objectClass=posixAccount)(uid=%s))
|
||||
* Admin Filter (optional)
|
||||
* An LDAP filter specifying if a user should be given administrator
|
||||
privileges. If a user accounts passes the filter, the user will be
|
||||
privileged as an administrator.
|
||||
* Example: (objectClass=adminAccount)
|
||||
|
||||
* First name attribute (optional)
|
||||
* The attribute of the user's LDAP record containing the user's first
|
||||
name. This will be used to populate their account information.
|
||||
* Example: givenName
|
||||
* The attribute of the user's LDAP record containing the user's first name.
|
||||
This will be used to populate their account information.
|
||||
* Example: givenName
|
||||
|
||||
* Surname name attribute (optional)
|
||||
* The attribute of the user's LDAP record containing the user's surname
|
||||
This will be used to populate their account information.
|
||||
* Example: sn
|
||||
* Surname attribute (optional)
|
||||
* The attribute of the user's LDAP record containing the user's surname This
|
||||
will be used to populate their account information.
|
||||
* Example: sn
|
||||
|
||||
* E-mail attribute **(required)**
|
||||
* The attribute of the user's LDAP record containing the user's email
|
||||
address. This will be used to populate their account information.
|
||||
* Example: mail
|
||||
* The attribute of the user's LDAP record containing the user's email
|
||||
address. This will be used to populate their account information.
|
||||
* Example: mail
|
||||
|
||||
**LDAP via BindDN** adds the following fields:
|
||||
|
||||
* Bind DN (optional)
|
||||
* The DN to bind to the LDAP server with when searching for the user. This
|
||||
may be left blank to perform an anonymous search.
|
||||
* Example: cn=Search,dc=mydomain,dc=com
|
||||
|
||||
* Bind Password (optional)
|
||||
* The password for the Bind DN specified above, if any. _Note: The password
|
||||
is stored in plaintext at the server. As such, ensure that your Bind DN
|
||||
has as few privileges as possible._
|
||||
|
||||
* User Search Base **(required)**
|
||||
* The LDAP base at which user accounts will be searched for.
|
||||
* Example: ou=Users,dc=mydomain,dc=com
|
||||
|
||||
* User Filter **(required)**
|
||||
* An LDAP filter declaring how to find the user record that is attempting to
|
||||
authenticate. The '%s' matching parameter will be substituted with the
|
||||
user's username.
|
||||
* Example: (&(objectClass=posixAccount)(uid=%s))
|
||||
|
||||
**LDAP using simple auth** adds the following fields:
|
||||
|
||||
* User DN **(required)**
|
||||
* A template to use as the user's DN. The `%s` matching parameter will be
|
||||
substituted with the user's username.
|
||||
* Example: cn=%s,ou=Users,dc=mydomain,dc=com
|
||||
* Example: uid=%s,ou=Users,dc=mydomain,dc=com
|
||||
|
||||
* User Filter **(required)**
|
||||
* An LDAP filter declaring when a user should be allowed to log in. The `%s`
|
||||
matching parameter will be substituted with the user's username.
|
||||
* Example: (&(objectClass=posixAccount)(cn=%s))
|
||||
* Example: (&(objectClass=posixAccount)(uid=%s))
|
||||
@@ -22,6 +22,7 @@ type Ldapsource struct {
|
||||
BindDN string // DN to bind with
|
||||
BindPassword string // Bind DN password
|
||||
UserBase string // Base search path for users
|
||||
UserDN string // Template for the DN of the user for simple auth
|
||||
AttributeName string // First name attribute
|
||||
AttributeSurname string // Surname attribute
|
||||
AttributeMail string // E-mail attribute
|
||||
@@ -78,10 +79,19 @@ func (ls Ldapsource) FindUserDN(name string) (string, bool) {
|
||||
}
|
||||
|
||||
// searchEntry : search an LDAP source if an entry (name, passwd) is valid and in the specific filter
|
||||
func (ls Ldapsource) SearchEntry(name, passwd string) (string, string, string, bool, bool) {
|
||||
userDN, found := ls.FindUserDN(name)
|
||||
if !found {
|
||||
return "", "", "", false, false
|
||||
func (ls Ldapsource) SearchEntry(name, passwd string, directBind bool) (string, string, string, bool, bool) {
|
||||
var userDN string
|
||||
if directBind {
|
||||
log.Trace("LDAP will bind directly via UserDN template: %s", ls.UserDN)
|
||||
userDN = fmt.Sprintf(ls.UserDN, name)
|
||||
} else {
|
||||
log.Trace("LDAP will use BindDN.")
|
||||
|
||||
var found bool
|
||||
userDN, found = ls.FindUserDN(name)
|
||||
if !found {
|
||||
return "", "", "", false, false
|
||||
}
|
||||
}
|
||||
|
||||
l, err := ldapDial(ls)
|
||||
@@ -112,7 +122,12 @@ func (ls Ldapsource) SearchEntry(name, passwd string) (string, string, string, b
|
||||
log.Error(4, "LDAP Search failed unexpectedly! (%v)", err)
|
||||
return "", "", "", false, false
|
||||
} else if len(sr.Entries) < 1 {
|
||||
log.Error(4, "LDAP Search failed unexpectedly! (0 entries)")
|
||||
if directBind {
|
||||
log.Error(4, "User filter inhibited user login.")
|
||||
} else {
|
||||
log.Error(4, "LDAP Search failed unexpectedly! (0 entries)")
|
||||
}
|
||||
|
||||
return "", "", "", false, false
|
||||
}
|
||||
|
||||
|
||||
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x09\xff\xdd\x1d\x21\x97\xa3\xbb\xff\x7b\x89\x0e\xdb\xbd\xb2\xd4\xbe\xcc\xb1\x2c\x8d\xa5\x9e\xd9\x59\x87\xa3\x9a\x55\xa4\xaa\x38\xae\x22\xab\x49\x96\x65\xcd\x89\x13\xb1\xaf\xb1\xaf\xb7\x4f\xb2\xc0\x0f\x40\xde\xc8\x92\xed\x9e\x13\xbb\x5f\x24\x56\x26\xf2\x86\x44\x22\x01\x24\x12\x59\xec\x76\xf3\xb2\xea\x97\xf9\x93\xfc\x38\xdf\x15\x75\xb3\xa9\xfa\x3e\xef\xab\xcd\xf5\xc3\x75\xdb\x0f\x55\x99\xbf\xa8\x07\xfa\xdd\x7d\xac\x97\x55\x96\xad\xdb\x6d\x45\xa0\x2f\xe9\x5f\x56\x16\xfd\x7a\xd1\x16\x5d\x49\x09\xa7\xf6\x9d\x55\x9f\x76\x9b\xb6\x63\xa0\x5f\xe4\x2b\x5b\x57\x9b\x1d\x97\xa1\x7f\x59\x5f\xaf\x9a\x79\xdd\xd0\xcf\x4b\xfa\xca\x5f\x35\x59\xdf\x2e\xeb\x62\x33\x0f\x32\x90\x60\xf9\x3f\xe5\x3f\x34\x65\x7e\x39\x54\xbb\xfc\x71\xbf\x2d\x36\x9b\xa7\x45\x8f\x22\x43\x95\x17\xcb\x65\xbb\x6f\x86\xc7\x8f\x24\x43\x2a\x6f\xf7\x83\xd5\x7e\xbe\x1f\x24\x6d\xbf\xb3\xa4\x5f\x77\x59\x57\xad\x6a\x1a\x58\x47\x49\x6f\xf5\x33\xbb\xa9\x16\x7d\x3d\x70\xa7\xff\x2a\x5f\xd9\xc7\xaa\xeb\xeb\x96\xfb\xf3\x17\xf9\xca\x76\xc5\x8a\x01\x2e\xe8\x5f\x36\x54\xdb\xdd\xa6\x40\x81\x2b\xfd\xcc\x36\x45\xb3\xda\x0b\xcc\x6b\xfd\xcc\x96\x5d\x45\x59\xf3\xa6\xba\xa1\xd4\x13\xfc\xc8\xe9\xc7\x6c\x36\xcb\xf6\x84\xd3\xf9\xae\x6b\xaf\xeb\x4d\x35\x2f\x9a\x72\xbe\x15\xac\xfd\x4a\xe9\xb9\xa6\xe7\x94\x9e\x73\x3a\x86\x51\x95\x84\xa0\x79\xd1\xeb\x58\x68\x6a\x08\x5f\x45\x9f\xa1\xaa\xa6\xd8\x5a\x69\xfe\xcc\xaa\x6d\x51\x6f\x78\x12\x1e\xf2\x07\x75\xbe\xef\x6f\x5a\x4c\xd5\x85\x7e\x12\x22\xe6\xc3\xed\xae\x02\x1e\x1e\x5e\xd1\x57\xb6\x2c\x76\xc3\x72\x5d\x70\x5f\xe5\x2b\x23\xa0\x5d\x4b\x08\x69\xbb\x5b\xc0\xd9\x8f\xac\xed\x56\x45\x53\xff\xa3\x18\x04\x49\xe7\xc1\xcf\x6c\x5b\x77\x5d\xcb\xf8\x3d\xc3\x47\x46\x23\x9e\x73\x3d\x94\xf2\x86\x30\x11\xd4\xc2\x39\xdb\x7a\xd5\x09\x2a\x39\xf3\x0c\xbf\xb8\x16\xce\xbb\x6e\xbb\x0f\x9a\xf1\x9c\x3f\x93\xa2\xd4\x09\xcd\x8d\xdb\x2f\x1a\x42\xbe\xe6\x9e\xe1\x47\x04\xd0\x67\x45\xb9\x25\x54\xee\x8a\xa6\x62\x1c\x1d\xf3\x2f\xc2\x0b\xfd\xca\x94\xa6\xe6\x7d\x35\x0c\x75\xb3\x62\x64\x1f\x4b\x52\x7e\xa9\x49\x59\x90\xe7\xd2\x6e\xdb\xbd\x9b\x4e\x4a\xff\x1b\xfd\xcc\x2f\xe4\xa7\xe4\x05\x85\x90\xe9\x4a\xf2\x48\xfa\xf9\x75\x55\x95\x32\x96\x3e\x7f\x4e\xdf\xd9\x6e\xbf\xd9\x10\xd6\x7e\xdf\x57\xfd\xc0\x85\x2e\xe8\x37\x8d\x5f\x7e\x67\x75\xdf\xd3\x07\x25\xbf\xc2\x47\x46\x53\xd7\x2c\x31\x98\x13\x7c\x64\xd9\xbb\xbe\x2a\xba\xe5\xfa\x7d\x26\xff\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2d\xdb\x92\x7f\x9c\xd0\x3f\xaa\xba\x6e\xfa\x81\x56\xdc\xfb\x4c\x3f\x18\x4c\xbe\x64\x02\x86\x7a\x00\x16\x34\x11\xcb\xb7\xe7\x19\xcc\x9f\xd7\x5d\x3f\x3c\x1c\x6a\x22\xd6\xb7\xfb\x26\xe3\xf1\xd1\x6a\x9b\x97\x0b\x63\x42\x2f\x5a\x42\x11\x92\x3b\x1a\xdf\xd9\xed\xe5\x9f\x5f\x1f\xe5\x17\xc4\x89\x56\x5d\x45\xdf\x39\xd5\x41\xff\xa8\xcc\x8f\xb3\x8c\x4a\x59\x4b\xa7\xc5\x50\x2c\x8a\xbe\xf2\x68\xe5\x4c\xa1\x6e\x97\x07\x1a\x67\xae\x06\x0e\xd6\x0f\xd1\x78\xa7\x56\x08\xd5\xa1\xeb\xca\xd5\xf1\x86\x17\x17\xa5\x33\x53\x43\xe1\x8b\x4d\xc5\xe9\x54\x55\xfe\xea\xcd\x9b\xf3\xd3\x67\x79\xd5\xac\xea\xa6\xca\x6f\xea\x61\x9d\xef\x87\xeb\xff\x3a\x5f\x55\x4d\xd5\x11\x8f\x5b\xd6\x39\xad\xa9\x8e\x28\x21\x27\xc2\x96\xc1\xcd\xb2\xbe\xdf\xd0\xda\x07\x7a\x2f\x2f\x5f\xe7\x67\x8c\xe2\x5d\x31\xac\xd1\x91\x61\x9d\xf5\xbf\x6f\x18\x45\xae\xc1\xab\x75\x95\x83\xca\x00\xd4\x5e\x1b\x3e\xf2\x52\xfb\x38\xcb\xaa\xae\x9b\x13\x5b\x1a\x6e\xe7\x5a\x58\xeb\x4b\x21\xa5\x0a\x22\x9d\xa6\x1d\xf2\x45\x95\xa3\xcc\x2c\xcb\xac\xc3\x86\xdd\xe3\xdd\x6e\x53\x2f\x65\xad\xbf\x90\x3c\x8f\x68\xde\x41\x14\x4b\x21\x1c\x10\x65\x79\x01\xba\x88\x3d\xf3\x7a\xc8\x23\x06\x82\xf2\xeb\x8a\x18\xe0\x7a\xbf\x12\xb6\xb7\x69\xf7\xe5\x37\xa0\x54\xeb\xbd\x27\xd4\xfc\x6d\x4b\x1d\x06\x76\x1c\x80\x6f\xe2\x98\x28\x8e\x37\xad\xae\xda\xb6\xc4\x57\x1c\xb1\xd7\x44\x50\x37\x35\x65\xd2\x48\xfb\xe2\x23\xad\xb7\xa1\xcd\x87\x75\xdd\xe7\x25\x11\xdb\x92\x2b\xa6\xa5\xb1\xa7\xed\x42\xc8\x82\x08\x54\x48\xc3\xd2\xe2\x39\x00\xd4\x76\x4f\xd4\xb4\xa6\xca\x78\x33\xe2\x9d\x93\xaa\x9c\xea\x27\x86\x44\xf5\x80\xbe\x89\x72\x5b\xe2\xca\xcc\x37\x4f\xf1\xa1\xbf\xc3\xfa\xa9\x57\xc5\xf5\x35\xf5\xaa\x27\xaa\x78\x99\x2f\x37\x2d\x91\xd4\xaf\x6f\x5f\xf7\x4c\x30\xeb\xf9\xae\xed\xb0\xcd\x51\xd6\x05\x7d\xba\xb4\x00\xd1\x0c\xd1\xec\xb7\x0b\xfa\x75\xb3\xae\x89\x03\x00\xed\x5c\x82\x77\x73\x4a\xa5\x26\xf6\x3d\x4d\xe1\x51\x4e\x24\x4c\x23\x20\x94\x81\x00\x78\x0c\x65\xdd\x17\x0b\x9a\x7b\x06\xbf\xa6\x6d\x6b\xdf\x11\x59\xad\x87\x61\x67\x2d\xbf\xbc\xba\xba\x90\xa6\x5d\xea\x5d\x6d\x17\x01\x65\x60\x0e\x36\xbc\xf1\x36\x79\xdb\xcc\x40\x24\xfb\x6e\x93\xd0\x0f\x8d\xd5\x72\x0e\xe0\x85\xbb\xf0\x88\xff\x5c\x7a\xf4\x00\xcf\x3d\x49\x27\x37\xa0\x26\xc2\x71\x85\x0d\x90\x88\xba\xdd\x71\xbd\x01\x55\x9f\x6b\x82\x27\x65\x6c\x9a\x2e\x5f\xb6\x4e\xca\x85\xec\x13\xb0\xff\x2d\x0d\x58\xd9\xc8\xe5\x19\xa1\x01\xbc\x04\xa9\xd7\x5d\xbb\xa5\xd4\xe7\xf4\xcf\x27\xf8\xee\x9f\x71\x7d\x80\x29\xca\x92\xf8\x5b\x7f\x94\xbf\x7d\x7e\x92\xff\xa7\x1f\x7f\xf8\x61\x96\xbf\x1a\x78\x25\x32\x71\xfe\x9d\x89\x8a\x3e\x65\x0f\x77\xa0\xcLine truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x09\xff\xdd\x1d\x21\x97\xa3\xbb\xff\x7b\x89\x0e\xdb\xbd\xb2\xd4\xbe\xcc\xb1\x2c\x8d\xa5\x9e\xd9\x59\x87\xa3\x9a\x55\xa4\xaa\x38\xae\x22\xab\x49\x96\x65\xcd\x89\x13\xb1\xaf\xb1\xaf\xb7\x4f\xb2\xc0\x0f\x40\xde\xc8\x92\xed\x9e\x13\xbb\x5f\x24\x56\x26\xf2\x86\x44\x22\x01\x24\x12\x59\xec\x76\xf3\xb2\xea\x97\xf9\x93\xfc\x38\xdf\x15\x75\xb3\xa9\xfa\x3e\xef\xab\xcd\xf5\xc3\x75\xdb\x0f\x55\x99\xbf\xa8\x07\xfa\xdd\x7d\xac\x97\x55\x96\xad\xdb\x6d\x45\xa0\x2f\xe9\x5f\x56\x16\xfd\x7a\xd1\x16\x5d\x49\x09\xa7\xf6\x9d\x55\x9f\x76\x9b\xb6\x63\xa0\x5f\xe4\x2b\x5b\x57\x9b\x1d\x97\xa1\x7f\x59\x5f\xaf\x9a\x79\xdd\xd0\xcf\x4b\xfa\xca\x5f\x35\x59\xdf\x2e\xeb\x62\x33\x0f\x32\x90\x60\xf9\x3f\xe5\x3f\x34\x65\x7e\x39\x54\xbb\xfc\x71\xbf\x2d\x36\x9b\xa7\x45\x8f\x22\x43\x95\x17\xcb\x65\xbb\x6f\x86\xc7\x8f\x24\x43\x2a\x6f\xf7\x83\xd5\x7e\xbe\x1f\x24\x6d\xbf\xb3\xa4\x5f\x77\x59\x57\xad\x6a\x1a\x58\x47\x49\x6f\xf5\x33\xbb\xa9\x16\x7d\x3d\x70\xa7\xff\x2a\x5f\xd9\xc7\xaa\xeb\xeb\x96\xfb\xf3\x17\xf9\xca\x76\xc5\x8a\x01\x2e\xe8\x5f\x36\x54\xdb\xdd\xa6\x40\x81\x2b\xfd\xcc\x36\x45\xb3\xda\x0b\xcc\x6b\xfd\xcc\x96\x5d\x45\x59\xf3\xa6\xba\xa1\xd4\x13\xfc\xc8\xe9\xc7\x6c\x36\xcb\xf6\x84\xd3\xf9\xae\x6b\xaf\xeb\x4d\x35\x2f\x9a\x72\xbe\x15\xac\xfd\x4a\xe9\xb9\xa6\xe7\x94\x9e\x73\x3a\x86\x51\x95\x84\xa0\x79\xd1\xeb\x58\x68\x6a\x08\x5f\x45\x9f\xa1\xaa\xa6\xd8\x5a\x69\xfe\xcc\xaa\x6d\x51\x6f\x78\x12\x1e\xf2\x07\x75\xbe\xef\x6f\x5a\x4c\xd5\x85\x7e\x12\x22\xe6\xc3\xed\xae\x02\x1e\x1e\x5e\xd1\x57\xb6\x2c\x76\xc3\x72\x5d\x70\x5f\xe5\x2b\x23\xa0\x5d\x4b\x08\x69\xbb\x5b\xc0\xd9\x8f\xac\xed\x56\x45\x53\xff\xa3\x18\x04\x49\xe7\xc1\xcf\x6c\x5b\x77\x5d\xcb\xf8\x3d\xc3\x47\x46\x23\x9e\x73\x3d\x94\xf2\x86\x30\x11\xd4\xc2\x39\xdb\x7a\xd5\x09\x2a\x39\xf3\x0c\xbf\xb8\x16\xce\xbb\x6e\xbb\x0f\x9a\xf1\x9c\x3f\x93\xa2\xd4\x09\xcd\x8d\xdb\x2f\x1a\x42\xbe\xe6\x9e\xe1\x47\x04\xd0\x67\x45\xb9\x25\x54\xee\x8a\xa6\x62\x1c\x1d\xf3\x2f\xc2\x0b\xfd\xca\x94\xa6\xe6\x7d\x35\x0c\x75\xb3\x62\x64\x1f\x4b\x52\x7e\xa9\x49\x59\x90\xe7\xd2\x6e\xdb\xbd\x9b\x4e\x4a\xff\x1b\xfd\xcc\x2f\xe4\xa7\xe4\x05\x85\x90\xe9\x4a\xf2\x48\xfa\xf9\x75\x55\x95\x32\x96\x3e\x7f\x4e\xdf\xd9\x6e\xbf\xd9\x10\xd6\x7e\xdf\x57\xfd\xc0\x85\x2e\xe8\x37\x8d\x5f\x7e\x67\x75\xdf\xd3\x07\x25\xbf\xc2\x47\x46\x53\xd7\x2c\x31\x98\x13\x7c\x64\xd9\xbb\xbe\x2a\xba\xe5\xfa\x7d\x26\xff\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2d\xdb\x92\x7f\x9c\xd0\x3f\xaa\xba\x6e\xfa\x81\x56\xdc\xfb\x4c\x3f\x18\x4c\xbe\x64\x02\x86\x7a\x00\x16\x34\x11\xcb\xb7\xe7\x19\xcc\x9f\xd7\x5d\x3f\x3c\x1c\x6a\x22\xd6\xb7\xfb\x26\xe3\xf1\xd1\x6a\x9b\x97\x0b\x63\x42\x2f\x5a\x42\x11\x92\x3b\x1a\xdf\xd9\xed\xe5\x9f\x5f\x1f\xe5\x17\xc4\x89\x56\x5d\x45\xdf\x39\xd5\x41\xff\xa8\xcc\x8f\xb3\x8c\x4a\x59\x4b\xa7\xc5\x50\x2c\x8a\xbe\xf2\x68\xe5\x4c\xa1\x6e\x97\x07\x1a\x67\xae\x06\x0e\xd6\x0f\xd1\x78\xa7\x56\x08\xd5\xa1\xeb\xca\xd5\xf1\x86\x17\x17\xa5\x33\x53\x43\xe1\x8b\x4d\xc5\xe9\x54\x55\xfe\xea\xcd\x9b\xf3\xd3\x67\x79\xd5\xac\xea\xa6\xca\x6f\xea\x61\x9d\xef\x87\xeb\xff\x3a\x5f\x55\x4d\xd5\x11\x8f\x5b\xd6\x39\xad\xa9\x8e\x28\x21\x27\xc2\x96\xc1\xcd\xb2\xbe\xdf\xd0\xda\x07\x7a\x2f\x2f\x5f\xe7\x67\x8c\xe2\x5d\x31\xac\xd1\x91\x61\x9d\xf5\xbf\x6f\x18\x45\xae\xc1\xab\x75\x95\x83\xca\x00\xd4\x5e\x1b\x3e\xf2\x52\xfb\x38\xcb\xaa\xae\x9b\x13\x5b\x1a\x6e\xe7\x5a\x58\xeb\x4b\x21\xa5\x0a\x22\x9d\xa6\x1d\xf2\x45\x95\xa3\xcc\x2c\xcb\xac\xc3\x86\xdd\xe3\xdd\x6e\x53\x2f\x65\xad\xbf\x90\x3c\x8f\x68\xde\x41\x14\x4b\x21\x1c\x10\x65\x79\x01\xba\x88\x3d\xf3\x7a\xc8\x23\x06\x82\xf2\xeb\x8a\x18\xe0\x7a\xbf\x12\xb6\xb7\x69\xf7\xe5\x37\xa0\x54\xeb\xbd\x27\xd4\xfc\x6d\x4b\x1d\x06\x76\x1c\x80\x6f\xe2\x98\x28\x8e\x37\xad\xae\xda\xb6\xc4\x57\x1c\xb1\xd7\x44\x50\x37\x35\x65\xd2\x48\xfb\xe2\x23\xad\xb7\xa1\xcd\x87\x75\xdd\xe7\x25\x11\xdb\x92\x2b\xa6\xa5\xb1\xa7\xed\x42\xc8\x82\x08\x54\x48\xc3\xd2\xe2\x39\x00\xd4\x76\x4f\xd4\xb4\xa6\xca\x78\x33\xe2\x9d\x93\xaa\x9c\xea\x27\x86\x44\xf5\x80\xbe\x89\x72\x5b\xe2\xca\xcc\x37\x4f\xf1\xa1\xbf\xc3\xfa\xa9\x57\xc5\xf5\x35\xf5\xaa\x27\xaa\x78\x99\x2f\x37\x2d\x91\xd4\xaf\x6f\x5f\xf7\x4c\x30\xeb\xf9\xae\xed\xb0\xcd\x51\xd6\x05\x7d\xba\xb4\x00\xd1\x0c\xd1\xec\xb7\x0b\xfa\x75\xb3\xae\x89\x03\x00\xed\x5c\x82\x77\x73\x4a\xa5\x26\xf6\x3d\x4d\xe1\x51\x4e\x24\x4c\x23\x20\x94\x81\x00\x78\x0c\x65\xdd\x17\x0b\x9a\x7b\x06\xbf\xa6\x6d\x6b\xdf\x11\x59\xad\x87\x61\x67\x2d\xbf\xbc\xba\xba\x90\xa6\x5d\xea\x5d\x6d\x17\x01\x65\x60\x0e\x36\xbc\xf1\x36\x79\xdb\xcc\x40\x24\xfb\x6e\x93\xd0\x0f\x8d\xd5\x72\x0e\xe0\x85\xbb\xf0\x88\xff\x5c\x7a\xf4\x00\xcf\x3d\x49\x27\x37\xa0\x26\xc2\x71\x85\x0d\x90\x88\xba\xdd\x71\xbd\x01\x55\x9f\x6b\x82\x27\x65\x6c\x9a\x2e\x5f\xb6\x4e\xca\x85\xec\x13\xb0\xff\x2d\x0d\x58\xd9\xc8\xe5\x19\xa1\x01\xbc\x04\xa9\xd7\x5d\xbb\xa5\xd4\xe7\xf4\xcf\x27\xf8\xee\x9f\x71\x7d\x80\x29\xca\x92\xf8\x5b\x7f\x94\xbf\x7d\x7e\x92\xff\xa7\x1f\x7f\xf8\x61\x96\xbf\x1a\x78\x25\x32\x71\xfe\x9d\x89\x8a\x3e\x65\x0f\x77\xa0\xcLine truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42439, mode: os.FileMode(420), modTime: time.Unix(1441898772, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42463, mode: os.FileMode(420), modTime: time.Unix(1441911299, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
+14
-18
@@ -57,10 +57,10 @@ var Gogs = {};
|
||||
});
|
||||
$.fn.extend({
|
||||
toggleHide: function () {
|
||||
$(this).addClass("hidden");
|
||||
$(this).each(function(n, v) { $(v).addClass("hidden"); });
|
||||
},
|
||||
toggleShow: function () {
|
||||
$(this).removeClass("hidden");
|
||||
$(this).each(function(n, v) { $(v).removeClass("hidden"); });
|
||||
},
|
||||
toggleAjax: function (successCallback, errorCallback) {
|
||||
var url = $(this).data("ajax");
|
||||
@@ -775,24 +775,20 @@ function initAdmin() {
|
||||
$form.attr('action', $form.data('delete-url'));
|
||||
});
|
||||
|
||||
// Create authorization.
|
||||
// Create authorization. Keep list in sync with models/login.go.
|
||||
var all_auths = ['none', 'plain', 'ldap', 'dldap', 'smtp', 'pam'];
|
||||
$('#auth-type').on("change", function () {
|
||||
var v = $(this).val();
|
||||
if (v == 2) {
|
||||
$('.ldap').toggleShow();
|
||||
$('.smtp').toggleHide();
|
||||
$('.pam').toggleHide();
|
||||
}
|
||||
if (v == 3) {
|
||||
$('.smtp').toggleShow();
|
||||
$('.ldap').toggleHide();
|
||||
$('.pam').toggleHide();
|
||||
}
|
||||
if (v == 4) {
|
||||
$('.pam').toggleShow();
|
||||
$('.smtp').toggleHide();
|
||||
$('.ldap').toggleHide();
|
||||
}
|
||||
if (v >= all_auths.length) return;
|
||||
|
||||
// Hide all through their class names.
|
||||
$.each(all_auths, function(i, type) {
|
||||
$('.' + type).toggleHide();
|
||||
});
|
||||
|
||||
// Show the selected one.
|
||||
var selected = all_auths[v];
|
||||
$('.' + selected).toggleShow();
|
||||
});
|
||||
|
||||
// Delete authorization.
|
||||
|
||||
@@ -61,6 +61,8 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
var u core.Conversion
|
||||
switch models.LoginType(form.Type) {
|
||||
case models.LDAP:
|
||||
fallthrough
|
||||
case models.DLDAP:
|
||||
u = &models.LDAPConfig{
|
||||
Ldapsource: ldap.Ldapsource{
|
||||
Name: form.Name,
|
||||
@@ -68,13 +70,14 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
Port: form.Port,
|
||||
UseSSL: form.UseSSL,
|
||||
BindDN: form.BindDN,
|
||||
UserDN: form.UserDN,
|
||||
BindPassword: form.BindPassword,
|
||||
UserBase: form.UserBase,
|
||||
Filter: form.Filter,
|
||||
AdminFilter: form.AdminFilter,
|
||||
AttributeName: form.AttributeName,
|
||||
AttributeSurname: form.AttributeSurname,
|
||||
AttributeMail: form.AttributeMail,
|
||||
Filter: form.Filter,
|
||||
AdminFilter: form.AdminFilter,
|
||||
Enabled: true,
|
||||
},
|
||||
}
|
||||
@@ -149,6 +152,8 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
var config core.Conversion
|
||||
switch models.LoginType(form.Type) {
|
||||
case models.LDAP:
|
||||
fallthrough
|
||||
case models.DLDAP:
|
||||
config = &models.LDAPConfig{
|
||||
Ldapsource: ldap.Ldapsource{
|
||||
Name: form.Name,
|
||||
@@ -156,6 +161,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
Port: form.Port,
|
||||
UseSSL: form.UseSSL,
|
||||
BindDN: form.BindDN,
|
||||
UserDN: form.UserDN,
|
||||
BindPassword: form.BindPassword,
|
||||
UserBase: form.UserBase,
|
||||
AttributeName: form.AttributeName,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_AuthName}}ipt-error{{end}}" id="name" name="name" value="{{.Source.Name}}" required />
|
||||
</div>
|
||||
|
||||
{{if eq $type 2}}
|
||||
{{if eq $type 2 3}}
|
||||
<div class="field">
|
||||
<label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.Source.LDAP.Host}}" required />
|
||||
@@ -43,6 +43,7 @@
|
||||
<label for="use_ssl">{{.i18n.Tr "admin.auths.enable_tls"}}</label>
|
||||
<input name="use_ssl" type="checkbox" {{if .Source.LDAP.UseSSL}}checked{{end}}>
|
||||
</div>
|
||||
{{if eq $type 2}}
|
||||
<div class="field">
|
||||
<label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_BindDN}}ipt-error{{end}}" id="bind_dn" name="bind_dn" value="{{.Source.LDAP.BindDN}}" />
|
||||
@@ -55,6 +56,13 @@
|
||||
<label class="req" for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_UserBase}}ipt-error{{end}}" id="user_base" name="user_base" value="{{.Source.LDAP.UserBase}}" />
|
||||
</div>
|
||||
{{end}}
|
||||
{{if eq $type 3}}
|
||||
<div class="field">
|
||||
<label class="req" for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_UserDN}}ipt-error{{end}}" id="user_dn" name="user_dn" value="{{.Source.LDAP.UserDN}}" />
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field">
|
||||
<label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.Source.LDAP.Filter}}" />
|
||||
@@ -76,7 +84,8 @@
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attribute_mail" name="attribute_mail" value="{{.Source.LDAP.AttributeMail}}" />
|
||||
</div>
|
||||
|
||||
{{else if eq $type 3}}
|
||||
|
||||
{{else if eq $type 4}}
|
||||
<div class="field">
|
||||
<label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
|
||||
<select name="smtp_auth">
|
||||
@@ -96,7 +105,7 @@
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtp_port" name="smtp_port" value="{{.Source.SMTP.Port}}" />
|
||||
</div>
|
||||
|
||||
{{else if eq $type 4}}
|
||||
{{else if eq $type 5}}
|
||||
<div class="field">
|
||||
<label class="req" for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_PAMServiceName}}ipt-error{{end}}" id="pam_service_name" name="pam_service_name" value="{{.Source.PAM.ServiceName}}" />
|
||||
@@ -104,7 +113,7 @@
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
{{if eq $type 3}}
|
||||
{{if eq $type 4}}
|
||||
<label></label>
|
||||
<input name="tls" type="checkbox" {{if .Source.SMTP.TLS}}checked{{end}}>
|
||||
<strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
|
||||
|
||||
@@ -26,48 +26,52 @@
|
||||
<label class="req" for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_AuthName}}ipt-error{{end}}" id="name" name="name" value="{{.name}}" required />
|
||||
</div>
|
||||
<div class="ldap">
|
||||
<div class="field">
|
||||
<div class="dldap ldap">
|
||||
<div class="dldap ldap field">
|
||||
<label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.host}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap ldap field">
|
||||
<label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.port}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap ldap field">
|
||||
<label for="use_ssl">{{.i18n.Tr "admin.auths.enable_tls"}}</label>
|
||||
<input name="use_ssl" type="checkbox" {{if .use_ssl}}checked{{end}}>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ldap field">
|
||||
<label class="req" for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_BindDN}}ipt-error{{end}}" id="bind_dn" name="bind_dn" value="{{.bind_dn}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ldap field">
|
||||
<label class="req" for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_BindPassword}}ipt-error{{end}}" id="bind_password" name="bind_password" type="password" value="{{.bind_password}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ldap field">
|
||||
<label class="req" for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_UserBase}}ipt-error{{end}}" id="user_base" name="user_base" value="{{.user_base}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap field hidden">
|
||||
<label class="req" for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_UserDN}}ipt-error{{end}}" id="user_dn" name="user_dn" value="{{.user_dn}}" />
|
||||
</div>
|
||||
<div class="dldap ldap field">
|
||||
<label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.filter}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap ldap field">
|
||||
<label for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_AdminFilter}}ipt-error{{end}}" id="admin_filter" name="admin_filter" value="{{.admin_filter}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap ldap field">
|
||||
<label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_AttributeName}}ipt-error{{end}}" id="attribute_name" name="attribute_name" value="{{.attribute_name}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap ldap field">
|
||||
<label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_AttributeSurname}}ipt-error{{end}}" id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="dldap ldap field">
|
||||
<label class="req" for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_AttributeMail}}ipt-error{{end}}" id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user