mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-06 19:43:25 +08:00
新增用户活动日志
This commit is contained in:
@@ -69,6 +69,7 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||
cSess.SetMtu(cstpMtu)
|
||||
cSess.MasterSecret = masterSecret
|
||||
cSess.RemoteAddr = r.RemoteAddr
|
||||
cSess.UserAgent = strings.ToLower(r.UserAgent())
|
||||
cSess.LocalIp = net.ParseIP(localIp)
|
||||
cstpKeepalive := base.Cfg.CstpKeepalive
|
||||
cstpDpd := base.Cfg.CstpDpd
|
||||
@@ -194,6 +195,13 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||
base.Error(err)
|
||||
return
|
||||
}
|
||||
dbdata.UserActLogIns.Add(dbdata.UserActLog{
|
||||
Username: sess.Username,
|
||||
GroupName: sess.Group,
|
||||
IpAddr: cSess.IpAddr.String(),
|
||||
RemoteAddr: cSess.RemoteAddr,
|
||||
Status: dbdata.UserConnected,
|
||||
}, cSess.UserAgent)
|
||||
|
||||
go LinkCstp(conn, bufRW, cSess)
|
||||
}
|
||||
|
Reference in New Issue
Block a user