summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-05-02 16:22:56 +0300
committerGitHub <noreply@github.com>2018-05-02 16:22:56 +0300
commitb66d6b34492cb92701d472d9ba7ad796f3a9d7d8 (patch)
tree34ff594deeef118d0fd12069a44b6812db9a5f4c /cmd
parent94954299828e612bf69058925243e4ca804451be (diff)
downloadgitea-b66d6b34492cb92701d472d9ba7ad796f3a9d7d8.tar.gz
gitea-b66d6b34492cb92701d472d9ba7ad796f3a9d7d8.zip
Do not allow inactive users to access repositories using private keys (#3887)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/serv.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/serv.go b/cmd/serv.go
index 0326656f2a..5d567e6d64 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -230,6 +230,12 @@ func runServ(c *cli.Context) error {
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err)
}
+ if !user.IsActive || user.ProhibitLogin {
+ fail("Your account is not active or has been disabled by Administrator",
+ "User %s is disabled and have no access to repository %s",
+ user.Name, repoPath)
+ }
+
mode, err := models.AccessLevel(user.ID, repo)
if err != nil {
fail("Internal error", "Failed to check access: %v", err)