#1938 #1374 disable password change for non-local users

This commit is contained in:
Unknwon
2015-12-10 19:02:57 -05:00
parent ddcc8d998c
commit 3d5d61778a
11 changed files with 63 additions and 51 deletions

View File

@ -118,6 +118,11 @@ func (u *User) AfterSet(colName string, _ xorm.Cell) {
}
}
// returns true if user login type is LOGIN_PLAIN.
func (u *User) IsLocal() bool {
return u.LoginType <= LOGIN_PLAIN
}
// HasForkedRepo checks if user has already forked a repository with given ID.
func (u *User) HasForkedRepo(repoID int64) bool {
_, has := HasForkedRepo(u.Id, repoID)