diff options
author | Unknwon <u@gogs.io> | 2015-12-10 19:02:57 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-10 19:02:57 -0500 |
commit | 3d5d61778ac8fab981720b5f8b7fe75e2fb58434 (patch) | |
tree | d22e52c2cc8ad9fb948322252a594225cf1b71b2 /models/user.go | |
parent | ddcc8d998c93d6e252319a82b116dbe553a919ad (diff) | |
download | gitea-3d5d61778ac8fab981720b5f8b7fe75e2fb58434.tar.gz gitea-3d5d61778ac8fab981720b5f8b7fe75e2fb58434.zip |
#1938 #1374 disable password change for non-local users
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go index 8993d7de3c..cb9846f9fd 100644 --- a/models/user.go +++ b/models/user.go @@ -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) |