]> source.dussan.org Git - gitea.git/commitdiff
Clean old LDAP code
authorUnknown <joe2010xtmf@163.com>
Fri, 16 May 2014 03:03:26 +0000 (23:03 -0400)
committerUnknown <joe2010xtmf@163.com>
Fri, 16 May 2014 03:03:26 +0000 (23:03 -0400)
README.md
README_ZH.md
gogs.go
models/login.go
modules/base/conf.go

index e50af3526ff41633b6fe48d066cb08f3aa833cdb..650946db4db9a2088a08e0d9fc41610056a00397 100644 (file)
--- a/README.md
+++ b/README.md
@@ -32,15 +32,16 @@ More importantly, Gogs only needs one binary to setup your own project hosting o
 ## Features
 
 - Activity timeline
-- SSH/HTTP(S) protocol support.
-- Register/delete/rename account.
-- Create/migrate/mirror/delete/watch/rename/transfer public/private repository.
-- Repository viewer/release/issue tracker/webhooks.
-- Add/remove repository collaborators.
-- Gravatar and cache support.
-- Mail service(register, issue).
-- Administration panel.
-- Supports MySQL, PostgreSQL and SQLite3.
+- SSH/HTTP(S) protocol support
+- SMTP authentication support
+- Register/delete/rename account
+- Create/migrate/mirror/delete/watch/rename/transfer public/private repository
+- Repository viewer/release/issue tracker/webhooks
+- Add/remove repository collaborators
+- Gravatar and cache support
+- Mail service(register, issue)
+- Administration panel
+- Supports MySQL, PostgreSQL and SQLite3
 - Social account login(GitHub, Google, QQ, Weibo)
 
 ## System Requirements
index 928d43f78af8d20e9d25c9271be5948ff3653d4d..18fa0acf3189bca962edb34889563aca89e162d0 100644 (file)
@@ -23,7 +23,8 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
 ## 功能特性
 
 - 活动时间线
-- SSH/HTTP(S) 协议支持
+- 支持 SSH/HTTP(S) 协议
+- 支持 SMTP 用户认证
 - 注册/删除/重命名用户
 - 创建/迁移/镜像/删除/关注/重命名/转移 公开/私有 仓库
 - 仓库 浏览器/发布/缺陷管理/Web 钩子
diff --git a/gogs.go b/gogs.go
index 341d82b68cfa1e0ca096c5c2f7c3a4c995dac8a2..cb0989392924c8d5a0a839fa88c7de979792f76d 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/base"
 )
 
-const APP_VER = "0.3.4.0514 Alpha"
+const APP_VER = "0.3.4.0515 Alpha"
 
 func init() {
        base.AppVer = APP_VER
index 005a1f5b766eaf59960d99deb9fdcde7641bcc49..ed5a8425a8ec36fd79aacbc0ca7975f33a05813e 100644 (file)
@@ -312,7 +312,7 @@ func SmtpAuth(host string, port int, a smtp.Auth, useTls bool) error {
                                return err
                        }
                } else {
-                       return errors.New("SMTP server unsupported TLS")
+                       return errors.New("SMTP server unsupports TLS")
                }
        }
 
index 03e453e6d5b4a9ef15d5c2d3ced7ca9e1d20a3f2..d4a004fab00515b204f43deb99d86a982d55daf3 100644 (file)
@@ -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()