2014-05-11 12:56:04 +09:00
|
|
|
package ldap
|
|
|
|
|
2014-05-11 20:50:05 +09:00
|
|
|
// import (
|
|
|
|
// "fmt"
|
|
|
|
// "testing"
|
|
|
|
// )
|
2014-05-11 12:56:04 +09:00
|
|
|
|
2014-05-11 20:50:05 +09:00
|
|
|
// var ldapServer = "ldap.itd.umich.edu"
|
|
|
|
// var ldapPort = 389
|
|
|
|
// var baseDN = "dc=umich,dc=edu"
|
|
|
|
// var filter = []string{
|
|
|
|
// "(cn=cis-fac)",
|
|
|
|
// "(&(objectclass=rfc822mailgroup)(cn=*Computer*))",
|
|
|
|
// "(&(objectclass=rfc822mailgroup)(cn=*Mathematics*))"}
|
|
|
|
// var attributes = []string{
|
|
|
|
// "cn",
|
|
|
|
// "description"}
|
|
|
|
// var msadsaformat = ""
|
2014-05-11 12:56:04 +09:00
|
|
|
|
2014-05-11 20:50:05 +09:00
|
|
|
// func TestLDAP(t *testing.T) {
|
|
|
|
// AddSource("test", ldapServer, ldapPort, baseDN, attributes, filter, msadsaformat)
|
|
|
|
// user, err := LoginUserLdap("xiaolunwen", "")
|
|
|
|
// if err != nil {
|
|
|
|
// t.Error(err)
|
|
|
|
// return
|
|
|
|
// }
|
2014-05-11 12:56:04 +09:00
|
|
|
|
2014-05-11 20:50:05 +09:00
|
|
|
// fmt.Println(user)
|
|
|
|
// }
|