mirror of
https://github.com/moul/sshportal.git
synced 2025-03-10 14:26:43 +08:00
Allow connecting to the shell mode with the registered username or email
This commit is contained in:
parent
9cd9152a91
commit
a36bb68957
2 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
* Add 'host update' command (fix [#2](https://github.com/moul/sshportal/issues/2))
|
* 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 '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))
|
* 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)
|
## v1.2.0 (2017-11-22)
|
||||||
|
|
||||||
|
|
2
main.go
2
main.go
|
@ -119,7 +119,7 @@ func server(c *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch username := s.User(); {
|
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") {
|
if !UserHasRole(currentUser, "admin") {
|
||||||
fmt.Fprintf(s, "You are not an administrator, permission denied.\n")
|
fmt.Fprintf(s, "You are not an administrator, permission denied.\n")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue