summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-05-11 14:13:49 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-05-11 14:13:49 +0800
commit26c0113ea0c69be52e9b02145bf811189505915a (patch)
treefa8dd0a52082ae919d7df0944f3417a507d9734a
parent55019bfbc5c2b7db7a1f861a90d97e6760433e4d (diff)
downloadgitea-26c0113ea0c69be52e9b02145bf811189505915a.tar.gz
gitea-26c0113ea0c69be52e9b02145bf811189505915a.zip
delete unused codes
-rw-r--r--models/ldap.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/models/ldap.go b/models/ldap.go
deleted file mode 100644
index 1da5b87540..0000000000
--- a/models/ldap.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright github.com/juju2013. All rights reserved.
-// Use of this source code is governed by a MIT-style
-// license that can be found in the LICENSE file.
-
-package models
-
-import (
- "strings"
-
- "github.com/gogits/gogs/modules/auth/ldap"
- "github.com/gogits/gogs/modules/log"
-)
-
-// Query if name/passwd can login against the LDAP direcotry pool
-// Create a local user if success
-// Return the same LoginUserPlain semantic
-func LoginUserLdap(name, passwd string) (*User, error) {
- mail, logged := ldap.LoginUser(name, passwd)
- if !logged {
- // user not in LDAP, do nothing
- return nil, ErrUserNotExist
- }
- // fake a local user creation
- user := User{
- LowerName: strings.ToLower(name),
- Name: strings.ToLower(name),
- LoginType: 389,
- IsActive: true,
- Passwd: passwd,
- Email: mail}
- _, err := RegisterUser(&user)
- if err != nil {
- log.Debug("LDAP local user %s found (%s) ", name, err)
- }
- // simulate local user login
- localUser, err2 := GetUserByName(user.Name)
- return localUser, err2
-}