summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-15 23:03:26 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-15 23:03:26 -0400
commitbe82716b662b8b0b7f85c94209a264758f2b7f80 (patch)
tree794138f1898f5d411377facb1762eb8b1c1dbf9b /modules/base
parent4744996f9a68ef0de8bc87b3c22c0bde9a305847 (diff)
downloadgitea-be82716b662b8b0b7f85c94209a264758f2b7f80.tar.gz
gitea-be82716b662b8b0b7f85c94209a264758f2b7f80.zip
Clean old LDAP code
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/conf.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go
index 03e453e6d5..d4a004fab0 100644
--- a/modules/base/conf.go
+++ b/modules/base/conf.go
@@ -10,7 +10,6 @@ import (
"os/exec"
"path"
"path/filepath"
- "regexp"
"strings"
"github.com/Unknwon/com"
@@ -20,7 +19,6 @@ import (
"github.com/gogits/cache"
"github.com/gogits/session"
- "github.com/gogits/gogs/modules/auth/ldap"
"github.com/gogits/gogs/modules/log"
)
@@ -188,37 +186,6 @@ func newLogService() {
}
}
-func newLdapService() {
- Service.LdapAuth = Cfg.MustBool("security", "LDAP_AUTH", false)
- if !Service.LdapAuth {
- return
- }
-
- nbsrc := 0
- for _, v := range Cfg.GetSectionList() {
- if matched, _ := regexp.MatchString("(?i)^LDAPSOURCE.*", v); matched {
- ldapname := Cfg.MustValue(v, "name", v)
- ldaphost := Cfg.MustValue(v, "host")
- ldapport := Cfg.MustInt(v, "port", 389)
- ldapusessl := Cfg.MustBool(v, "usessl", false)
- ldapbasedn := Cfg.MustValue(v, "basedn", "dc=*,dc=*")
- ldapattribute := Cfg.MustValue(v, "attribute", "mail")
- ldapfilter := Cfg.MustValue(v, "filter", "(*)")
- ldapmsadsaformat := Cfg.MustValue(v, "MSADSAFORMAT", "%s")
- ldap.AddSource(ldapname, ldaphost, ldapport, ldapusessl, ldapbasedn, ldapattribute, ldapfilter, ldapmsadsaformat)
- nbsrc++
- log.Debug("%s added as LDAP source", ldapname)
- }
- }
- if nbsrc == 0 {
- log.Warn("No valide LDAP found, LDAP Authentication NOT enabled")
- Service.LdapAuth = false
- return
- }
-
- log.Info("LDAP Authentication Enabled")
-}
-
func newCacheService() {
CacheAdapter = Cfg.MustValue("cache", "ADAPTER", "memory")
if EnableRedis {
@@ -376,7 +343,6 @@ func NewConfigContext() {
func NewBaseServices() {
newService()
newLogService()
- newLdapService()
newCacheService()
newSessionService()
newMailService()