regulate some model attribute names. (#1303)

LGTM
This commit is contained in:
kun wang 2017-01-11 04:31:20 -06:00 committed by yhua123
parent a6a4a1fc18
commit 84509fbb3e
2 changed files with 10 additions and 10 deletions

View File

@ -18,11 +18,11 @@ package models
// LdapConf holds information about repository that accessed most // LdapConf holds information about repository that accessed most
type LdapConf struct { type LdapConf struct {
LdapURL string `json:"ldap_url"` LdapURL string `json:"ldap_url"`
LdapSearchDn string `json:"ldap_searchdn"` LdapSearchDn string `json:"ldap_search_dn"`
LdapSearchPwd string `json:"ldap_search_pwd"` LdapSearchPassword string `json:"ldap_search_password"`
LdapBaseDn string `json:"ldap_basedn"` LdapBaseDn string `json:"ldap_base_dn"`
LdapFilter string `json:"ldap_filter"` LdapFilter string `json:"ldap_filter"`
LdapUID string `json:"ldap_uid"` LdapUID string `json:"ldap_uid"`
LdapScope int `json:"ldap_scope"` LdapScope int `json:"ldap_scope"`
LdapConnectTimeout int `json:"ldap_connect_timeout"` LdapConnectionTimeout int `json:"ldap_connection_timeout"`
} }

View File

@ -80,8 +80,8 @@ func validateLdapReq(ldapConfs models.LdapConf) error {
} }
log.Debug("ldapURL:", ldapURL) log.Debug("ldapURL:", ldapURL)
ldapConnectTimeout := ldapConfs.LdapConnectTimeout ldapConnectionTimeout := ldapConfs.LdapConnectionTimeout
log.Debug("ldapConnectTimeout:", ldapConnectTimeout) log.Debug("ldapConnectionTimeout:", ldapConnectionTimeout)
return nil return nil
@ -128,8 +128,8 @@ func connectTest(ldapConfs models.LdapConf) error {
} }
// Sets a Dial Timeout for LDAP // Sets a Dial Timeout for LDAP
connectTimeout := ldapConfs.LdapConnectTimeout connectionTimeout := ldapConfs.LdapConnectionTimeout
goldap.DefaultTimeout = time.Duration(connectTimeout) * time.Second goldap.DefaultTimeout = time.Duration(connectionTimeout) * time.Second
switch protocol { switch protocol {
case "ldap": case "ldap":
@ -146,8 +146,8 @@ func connectTest(ldapConfs models.LdapConf) error {
ldapSearchDn := ldapConfs.LdapSearchDn ldapSearchDn := ldapConfs.LdapSearchDn
if ldapSearchDn != "" { if ldapSearchDn != "" {
log.Debug("Search DN: ", ldapSearchDn) log.Debug("Search DN: ", ldapSearchDn)
ldapSearchPwd := ldapConfs.LdapSearchPwd ldapSearchPassword := ldapConfs.LdapSearchPassword
err = ldap.Bind(ldapSearchDn, ldapSearchPwd) err = ldap.Bind(ldapSearchDn, ldapSearchPassword)
if err != nil { if err != nil {
log.Debug("Bind search dn error", err) log.Debug("Bind search dn error", err)
return err return err