From a36bb68957c9668cf3294dce0432b7bf2643344d Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Thu, 23 Nov 2017 17:23:20 +0100 Subject: [PATCH] Allow connecting to the shell mode with the registered username or email --- CHANGELOG.md | 1 + main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3011188..62536c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Add 'host update' command (fix [#2](https://github.com/moul/sshportal/issues/2)) * Add 'user update' command (fix [#3](https://github.com/moul/sshportal/issues/3)) * Add 'acl update' command (fix [#4](https://github.com/moul/sshportal/issues/4)) +* Allow connecting to the shell mode with the registered username or email ## v1.2.0 (2017-11-22) diff --git a/main.go b/main.go index b73a32c..26a52cd 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,7 @@ func server(c *cli.Context) error { } switch username := s.User(); { - case username == c.String("config-user"): + case username == currentUser.Name || username == currentUser.Email || username == c.String("config-user"): if !UserHasRole(currentUser, "admin") { fmt.Fprintf(s, "You are not an administrator, permission denied.\n") return