add GetReposFiles

This commit is contained in:
Lunny Xiao 2014-03-11 18:10:19 +08:00
parent b5cc4078a9
commit 23400dd0a2
2 changed files with 87 additions and 28 deletions

View file

@ -13,8 +13,8 @@ import (
"time"
"github.com/dchest/scrypt"
"github.com/gogits/gogs/modules/base"
git "github.com/libgit2/git2go"
)
var UserPasswdSalt string
@ -98,6 +98,14 @@ func IsEmailUsed(email string) (bool, error) {
return orm.Get(&User{Email: email})
}
func (user *User) NewGitSig() *git.Signature {
return &git.Signature{
Name: user.Name,
Email: user.Email,
When: time.Now(),
}
}
// RegisterUser creates record of a new user.
func RegisterUser(user *User) (err error) {
isExist, err := IsUserExist(user.Name)