log web access
This commit is contained in:
@@ -122,13 +122,14 @@ func (s *OpenVpnMgt) Stats() map[string]map[int]*vpnSession {
|
||||
return s.clients
|
||||
}
|
||||
|
||||
func (s *OpenVpnMgt) Kill(session string, id int) error {
|
||||
func (s *OpenVpnMgt) Kill(session string, id int, killer string) error {
|
||||
if _, ok := s.clients[session]; !ok {
|
||||
return errors.New("unknown session")
|
||||
}
|
||||
if _, ok := s.clients[session][id]; !ok {
|
||||
return errors.New("unknown session id")
|
||||
}
|
||||
log.Printf("user %s's session killed from the web by %s\n", s.clients[session][id].Login, killer)
|
||||
err, _ := s.sendCommand([]string{fmt.Sprintf("client-kill %d", id)}, session)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user