mirror of
https://github.com/go-gitea/gitea
synced 2024-11-19 00:24:31 +00:00
Merge branch 'dev' of github.com:gogits/gogs into dev
This commit is contained in:
commit
70398ed01a
@ -1,32 +1,29 @@
|
|||||||
package ldap
|
package ldap
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"fmt"
|
// "fmt"
|
||||||
"testing"
|
// "testing"
|
||||||
)
|
// )
|
||||||
|
|
||||||
var ldapServer = "ldap.itd.umich.edu"
|
// var ldapServer = "ldap.itd.umich.edu"
|
||||||
var ldapPort = uint16(389)
|
// var ldapPort = 389
|
||||||
var baseDN = "dc=umich,dc=edu"
|
// var baseDN = "dc=umich,dc=edu"
|
||||||
var filter = []string{
|
// var filter = []string{
|
||||||
"(cn=cis-fac)",
|
// "(cn=cis-fac)",
|
||||||
"(&(objectclass=rfc822mailgroup)(cn=*Computer*))",
|
// "(&(objectclass=rfc822mailgroup)(cn=*Computer*))",
|
||||||
"(&(objectclass=rfc822mailgroup)(cn=*Mathematics*))"}
|
// "(&(objectclass=rfc822mailgroup)(cn=*Mathematics*))"}
|
||||||
var attributes = []string{
|
// var attributes = []string{
|
||||||
"cn",
|
// "cn",
|
||||||
"description"}
|
// "description"}
|
||||||
var msadsaformat = ""
|
// var msadsaformat = ""
|
||||||
|
|
||||||
func TestLDAP(t *testing.T) {
|
// func TestLDAP(t *testing.T) {
|
||||||
AddSource("test", ldapServer, ldapPort,
|
// AddSource("test", ldapServer, ldapPort, baseDN, attributes, filter, msadsaformat)
|
||||||
basedn, attributes, filter,
|
// user, err := LoginUserLdap("xiaolunwen", "")
|
||||||
msadsaformat)
|
// if err != nil {
|
||||||
user, err := LoginUserLdap("xiaolunwen", "")
|
// t.Error(err)
|
||||||
if err != nil {
|
// return
|
||||||
t.Error(err)
|
// }
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println(user)
|
// fmt.Println(user)
|
||||||
|
// }
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user