mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-13 07:37:17 +03:00
Disallow op with no fingerprint.
This commit is contained in:
parent
12be9c1d1f
commit
6f46645540
@ -347,8 +347,12 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
|||||||
c.SysMsg("No such name: %s", parts[1])
|
c.SysMsg("No such name: %s", parts[1])
|
||||||
} else {
|
} else {
|
||||||
fingerprint := client.Fingerprint()
|
fingerprint := client.Fingerprint()
|
||||||
client.SysMsg("Made op by %s.", c.ColoredName())
|
if fingerprint == "" {
|
||||||
c.Server.Op(fingerprint)
|
c.SysMsg("Cannot op user without fingerprint.")
|
||||||
|
} else {
|
||||||
|
client.SysMsg("Made op by %s.", c.ColoredName())
|
||||||
|
c.Server.Op(fingerprint)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "/kick":
|
case "/kick":
|
||||||
|
@ -363,6 +363,10 @@ func (s *Server) Uptime() string {
|
|||||||
|
|
||||||
// IsOp checks if the given client is Op
|
// IsOp checks if the given client is Op
|
||||||
func (s *Server) IsOp(client *Client) bool {
|
func (s *Server) IsOp(client *Client) bool {
|
||||||
|
fingerprint := client.Fingerprint()
|
||||||
|
if fingerprint == "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
_, r := s.admins[client.Fingerprint()]
|
_, r := s.admins[client.Fingerprint()]
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user