mirror of
https://github.com/go-gitea/gitea
synced 2024-11-17 15:31:06 +01:00
add login name for auth type
This commit is contained in:
parent
43ffacd05b
commit
4d6de6c7b9
5 changed files with 48 additions and 1 deletions
|
@ -58,7 +58,7 @@ func CreateRelease(repoPath string, rel *Release, gitRepo *git.Repository) error
|
||||||
return ErrReleaseAlreadyExist
|
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)
|
_, stderr, err := com.ExecCmdDir(repoPath, "git", "tag", rel.TagName, "-m", rel.Title)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -44,6 +44,7 @@ type User struct {
|
||||||
Passwd string `xorm:"not null"`
|
Passwd string `xorm:"not null"`
|
||||||
LoginType int
|
LoginType int
|
||||||
LoginSource int64 `xorm:"not null default 0"`
|
LoginSource int64 `xorm:"not null default 0"`
|
||||||
|
LoginName string
|
||||||
Type int
|
Type int
|
||||||
NumFollowers int
|
NumFollowers int
|
||||||
NumFollowings int
|
NumFollowings int
|
||||||
|
|
32
modules/auth/ldap/ldap_test.go
Normal file
32
modules/auth/ldap/ldap_test.go
Normal file
|
@ -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)
|
||||||
|
|
||||||
|
}
|
|
@ -26,6 +26,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label">Auth Login Name: </label>
|
||||||
|
<div class="col-md-7">
|
||||||
|
<input name="loginname" class="form-control" placeholder="Type auth login's username" value="{{.loginname}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label">Username: </label>
|
<label class="col-md-3 control-label">Username: </label>
|
||||||
<label class="control-label">{{.User.Name}}</label>
|
<label class="control-label">{{.User.Name}}</label>
|
||||||
|
|
|
@ -24,6 +24,13 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label">Auth Login Name: </label>
|
||||||
|
<div class="col-md-7">
|
||||||
|
<input name="loginname" class="form-control" placeholder="Type auth login's username" value="{{.loginname}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
|
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
|
||||||
<label class="col-md-3 control-label">Username: </label>
|
<label class="col-md-3 control-label">Username: </label>
|
||||||
|
|
Loading…
Reference in a new issue