return err
}
-// TransferRepoAction adds new action for transfering repository.
+// TransferRepoAction adds new action for transferring repository.
func TransferRepoAction(u, newUser *User, repo *Repository) (err error) {
action := &Action{
ActUserId: u.Id,
SMTP: "SMTP",
}
-// Ensure structs implmented interface.
+// Ensure structs implemented interface.
var (
_ core.Conversion = &LDAPConfig{}
_ core.Conversion = &SMTPConfig{}
}
}
-// Query if name/passwd can login against the LDAP direcotry pool
+// Query if name/passwd can login against the LDAP directory pool
// Create a local user if success
// Return the same LoginUserPlain semantic
// FIXME: https://github.com/gogits/gogs/issues/672
return ErrUnsupportedLoginType
}
-// Query if name/passwd can login against the LDAP direcotry pool
+// Query if name/passwd can login against the LDAP directory pool
// Create a local user if success
// Return the same LoginUserPlain semantic
func LoginUserSMTPSource(u *User, name, passwd string, sourceId int64, cfg *SMTPConfig, autoRegister bool) (*User, error) {
return fmt.Errorf("models.init(fail to connect to database): %v", err)
}
- // WARNNING: for serv command, MUST remove the output to os.stdout,
+ // WARNING: for serv command, MUST remove the output to os.stdout,
// so use log file to instead print to stdout.
logPath := path.Join(setting.LogRootPath, "xorm.log")
os.MkdirAll(path.Dir(logPath), os.ModePerm)
return err
}
-// GetOauthByUserId returns list of oauthes that are releated to given user.
+// GetOauthByUserId returns list of oauthes that are related to given user.
func GetOauthByUserId(uid int64) ([]*Oauth2, error) {
socials := make([]*Oauth2, 0, 5)
err := x.Find(&socials, Oauth2{Uid: uid})
return has
}
-// IsPublicMembership returns ture if given user public his/her membership.
+// IsPublicMembership returns true if given user public his/her membership.
func IsPublicMembership(orgId, uid int64) bool {
has, _ := x.Where("uid=?", uid).And("org_id=?", orgId).And("is_public=?", true).Get(new(OrgUser))
return has
return us, err
}
-// GetUserTeams returns all teams that user belongs to in given origanization.
+// GetUserTeams returns all teams that user belongs to in given organization.
func GetUserTeams(orgId, uid int64) ([]*Team, error) {
tus := make([]*TeamUser, 0, 5)
if err := x.Where("uid=?", uid).And("org_id=?", orgId).Find(&tus); err != nil {
return err
}
-// DeleteRepository deletes a repository for a user or orgnaztion.
+// DeleteRepository deletes a repository for a user or organization.
func DeleteRepository(uid, repoId int64, userName string) error {
repo := &Repository{Id: repoId, OwnerId: uid}
has, err := x.Get(repo)
// \__/\ / (____ /__| \___ >___| /
// \/ \/ \/ \/
-// Watch is connection request for receiving repository notifycation.
+// Watch is connection request for receiving repository notification.
type Watch struct {
Id int64
UserId int64 `xorm:"UNIQUE(watch)"`
}
// UploadAvatar saves custom avatar for user.
-// FIXME: splite uploads to different subdirs in case we have massive users.
+// FIXME: split uploads to different subdirs in case we have massive users.
func (u *User) UploadAvatar(data []byte) error {
u.UseCustomAvatar = true
return ids
}
-// UserCommit represtns a commit with validation of user.
+// UserCommit represents a commit with validation of user.
type UserCommit struct {
User *User
*git.Commit
return us, err
}
-// Follow is connection request for receiving user notifycation.
+// Follow is connection request for receiving user notification.
type Follow struct {
Id int64
UserId int64 `xorm:"unique(follow)"`
return err
}
-// HasPushEvent returns true if hook enbaled push event.
+// HasPushEvent returns true if hook enabled push event.
func (w *Webhook) HasPushEvent() bool {
if w.PushOnly {
return true
return nil, false
}
- // Check if enabled auto-registeration.
+ // Check if enabled auto-registration.
if setting.Service.EnableReverseProxyAutoRegister {
u := &models.User{
Name: webAuthUser,
Port int // port number
UseSSL bool // Use SSL
BaseDN string // Base DN
- Attributes string // Attribut to search
+ Attributes string // Attribute to search
Filter string // Query filter to validate entry
MsAdSAFormat string // in the case of MS AD Simple Authen, the format to use (see: http://msdn.microsoft.com/en-us/library/cc223499.aspx)
Enabled bool // if this source is disabled
Authensource = append(Authensource, ldaphost)
}
-//LoginUser : try to login an user to LDAP sources, return requested (attribut,true) if ok, ("",false) other wise
+//LoginUser : try to login an user to LDAP sources, return requested (attribute,true) if ok, ("",false) other wise
//First match wins
//Returns first attribute if exists
func LoginUser(name, passwd string) (a string, r bool) {
}
// hash email to md5 string
-// keep this func in order to make this package indenpent
+// keep this func in order to make this package independent
func HashEmail(email string) string {
// https://en.gravatar.com/site/implement/hash/
email = strings.TrimSpace(email)
"github.com/gogits/gogs/modules/asn1-ber"
)
-// debbuging type
+// debugging type
// - has a Printf method to write the debug output
type debugging bool
return l
}
-// SetLogger sets new logger instanse with given logger adapter and config.
+// SetLogger sets new logger instance with given logger adapter and config.
func (l *Logger) SetLogger(adapter string, config string) error {
l.lock.Lock()
defer l.lock.Unlock()
)
// A Decoder is a function that decodes a character set, one character at a time.
-// It works much like utf8.DecodeRune, but has an aditional status return value.
+// It works much like utf8.DecodeRune, but has an additional status return value.
type Decoder func(p []byte) (c rune, size int, status Status)
// An Encoder is a function that encodes a character set, one character at a time.
}
}
-// GitHookService checks if repsitory Git hooks service has been enabled.
+// GitHookService checks if repository Git hooks service has been enabled.
func GitHookService() macaron.Handler {
return func(ctx *Context) {
if !ctx.User.AllowGitHook && !ctx.User.IsAdmin {
log.Fatal(4, "Expect user(%s) but current user is: %s", RunUser, curUser)
}
- // Determine and create root git reposiroty path.
+ // Determine and create root git repository path.
homeDir, err := com.HomeDir()
if err != nil {
log.Fatal(4, "Fail to get home directory: %v", err)
}
aid := com.StrTo(ctx.Query("assigneeid")).MustInt64()
- // Not check for invalid assignne id and give responsibility to owners.
+ // Not check for invalid assignee id and give responsibility to owners.
issue.AssigneeId = aid
if err = models.UpdateIssueUserPairByAssignee(aid, issue.Id); err != nil {
ctx.Handle(500, "UpdateIssueUserPairByAssignee: %v", err)