Security protocols
This commit is contained in:
parent
7612b5ec40
commit
05fd9d3f09
3 changed files with 15 additions and 15 deletions
|
@ -54,9 +54,9 @@ var (
|
|||
{models.LoginNames[models.LoginPam], models.LoginPam},
|
||||
}
|
||||
securityProtocols = []dropdownItem{
|
||||
{models.SecurityProtocolNames[ldap.SECURITY_PROTOCOL_UNENCRYPTED], ldap.SECURITY_PROTOCOL_UNENCRYPTED},
|
||||
{models.SecurityProtocolNames[ldap.SECURITY_PROTOCOL_LDAPS], ldap.SECURITY_PROTOCOL_LDAPS},
|
||||
{models.SecurityProtocolNames[ldap.SECURITY_PROTOCOL_START_TLS], ldap.SECURITY_PROTOCOL_START_TLS},
|
||||
{models.SecurityProtocolNames[ldap.SecurityProtocolUnencrypted], ldap.SecurityProtocolUnencrypted},
|
||||
{models.SecurityProtocolNames[ldap.SecurityProtocolLdaps], ldap.SecurityProtocolLdaps},
|
||||
{models.SecurityProtocolNames[ldap.SecurityProtocolStartTls], ldap.SecurityProtocolStartTls},
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -67,7 +67,7 @@ func NewAuthSource(ctx *context.Context) {
|
|||
|
||||
ctx.Data["type"] = models.LoginLdap
|
||||
ctx.Data["CurrentTypeName"] = models.LoginNames[models.LoginLdap]
|
||||
ctx.Data["CurrentSecurityProtocol"] = models.SecurityProtocolNames[ldap.SECURITY_PROTOCOL_UNENCRYPTED]
|
||||
ctx.Data["CurrentSecurityProtocol"] = models.SecurityProtocolNames[ldap.SecurityProtocolUnencrypted]
|
||||
ctx.Data["smtp_auth"] = "PLAIN"
|
||||
ctx.Data["is_active"] = true
|
||||
ctx.Data["AuthSources"] = authSources
|
||||
|
@ -127,7 +127,7 @@ func NewAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) {
|
|||
switch models.LoginType(form.Type) {
|
||||
case models.LoginLdap, models.LoginDldap:
|
||||
config = parseLDAPConfig(form)
|
||||
hasTLS = ldap.SecurityProtocol(form.SecurityProtocol) > ldap.SECURITY_PROTOCOL_UNENCRYPTED
|
||||
hasTLS = ldap.SecurityProtocol(form.SecurityProtocol) > ldap.SecurityProtocolUnencrypted
|
||||
case models.LoginSmtp:
|
||||
config = parseSMTPConfig(form)
|
||||
hasTLS = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue