diff --git a/models/release.go b/models/release.go index 1df627202..1fee56105 100644 --- a/models/release.go +++ b/models/release.go @@ -58,7 +58,7 @@ func CreateRelease(repoPath string, rel *Release, gitRepo *git.Repository) error return ErrReleaseAlreadyExist } - if !git.IsTagExist(repoPath, rel.TagName) { + if !gitRepo.IsTagExist(rel.TagName) { _, stderr, err := com.ExecCmdDir(repoPath, "git", "tag", rel.TagName, "-m", rel.Title) if err != nil { return err diff --git a/models/user.go b/models/user.go index b2b16f113..397094920 100644 --- a/models/user.go +++ b/models/user.go @@ -44,6 +44,7 @@ type User struct { Passwd string `xorm:"not null"` LoginType int LoginSource int64 `xorm:"not null default 0"` + LoginName string Type int NumFollowers int NumFollowings int diff --git a/modules/auth/ldap/ldap_test.go b/modules/auth/ldap/ldap_test.go new file mode 100644 index 000000000..809657378 --- /dev/null +++ b/modules/auth/ldap/ldap_test.go @@ -0,0 +1,32 @@ +package ldap + +import ( + "fmt" + "testing" +) + +var ldapServer = "ldap.itd.umich.edu" +var ldapPort = uint16(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 = "" + +func TestLDAP(t *testing.T) { + AddSource("test", ldapServer, ldapPort, + basedn, attributes, filter, + msadsaformat) + user, err := LoginUserLdap("xiaolunwen", "") + if err != nil { + t.Error(err) + return + } + + fmt.Println(user) + +} diff --git a/templates/admin/users/edit.tmpl b/templates/admin/users/edit.tmpl index 1fb29234e..499585676 100644 --- a/templates/admin/users/edit.tmpl +++ b/templates/admin/users/edit.tmpl @@ -26,6 +26,13 @@ +