mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-11 13:11:03 +00:00
Better logging for user activation and termination
This commit is contained in:
parent
aff53484eb
commit
5984fde09f
@ -80,6 +80,9 @@ func (panel *userPanel) GetUser(UID []byte) (*ActiveUser, error) {
|
|||||||
|
|
||||||
copy(user.arrUID[:], UID)
|
copy(user.arrUID[:], UID)
|
||||||
panel.activeUsers[user.arrUID] = user
|
panel.activeUsers[user.arrUID] = user
|
||||||
|
log.WithFields(log.Fields{
|
||||||
|
"UID": base64.StdEncoding.EncodeToString(UID),
|
||||||
|
}).Info("New active user")
|
||||||
return user, nil
|
return user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +91,7 @@ func (panel *userPanel) TerminateActiveUser(user *ActiveUser, reason string) {
|
|||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"UID": base64.StdEncoding.EncodeToString(user.arrUID[:]),
|
"UID": base64.StdEncoding.EncodeToString(user.arrUID[:]),
|
||||||
"reason": reason,
|
"reason": reason,
|
||||||
}).Info("forcefully terminating user")
|
}).Info("Terminating active user")
|
||||||
panel.updateUsageQueueForOne(user)
|
panel.updateUsageQueueForOne(user)
|
||||||
user.closeAllSessions(reason)
|
user.closeAllSessions(reason)
|
||||||
panel.activeUsersM.Lock()
|
panel.activeUsersM.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user