Browse Source

Do not allow inactive users to access repositories using private keys (#3887)

tags/v1.5.0-dev
Lauris BH GitHub 7 years ago
parent
commit
a90a85e6c5
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      cmd/serv.go

+ 6
- 0
cmd/serv.go View File

@@ -230,6 +230,12 @@ func runServ(c *cli.Context) error {
fail("internal error", "Failed to get user by key ID(%d): %v", keyID, err) 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) mode, err := models.AccessLevel(user.ID, repo)
if err != nil { if err != nil {
fail("Internal error", "Failed to check access: %v", err) fail("Internal error", "Failed to check access: %v", err)


Loading…
Cancel
Save