mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
add loglines for account registration, login, and unregistration
This commit is contained in:
parent
f40c363170
commit
6d690b0e36
@ -593,6 +593,11 @@ func (am *AccountManager) Verify(client *Client, account string, code string) er
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nick := "[server admin]"
|
||||||
|
if client != nil {
|
||||||
|
nick = client.Nick()
|
||||||
|
}
|
||||||
|
am.server.logger.Info("accounts", "client", nick, "registered account", casefoldedAccount)
|
||||||
raw.Verified = true
|
raw.Verified = true
|
||||||
clientAccount, err := am.deserializeRawAccount(raw)
|
clientAccount, err := am.deserializeRawAccount(raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -201,21 +201,23 @@ func sendSuccessfulRegResponse(client *Client, rb *ResponseBuffer, forNS bool) {
|
|||||||
|
|
||||||
// sendSuccessfulSaslAuth means that a SASL auth attempt completed successfully, and is used to dispatch messages.
|
// sendSuccessfulSaslAuth means that a SASL auth attempt completed successfully, and is used to dispatch messages.
|
||||||
func sendSuccessfulSaslAuth(client *Client, rb *ResponseBuffer, forNS bool) {
|
func sendSuccessfulSaslAuth(client *Client, rb *ResponseBuffer, forNS bool) {
|
||||||
account := client.AccountName()
|
details := client.Details()
|
||||||
|
|
||||||
if forNS {
|
if forNS {
|
||||||
rb.Notice(fmt.Sprintf(client.t("You're now logged in as %s"), client.AccountName()))
|
rb.Notice(fmt.Sprintf(client.t("You're now logged in as %s"), details.accountName))
|
||||||
} else {
|
} else {
|
||||||
rb.Add(nil, client.server.name, RPL_LOGGEDIN, client.nick, client.nickMaskString, account, fmt.Sprintf(client.t("You are now logged in as %s"), account))
|
rb.Add(nil, client.server.name, RPL_LOGGEDIN, details.nick, details.nickMask, details.accountName, fmt.Sprintf(client.t("You are now logged in as %s"), details.accountName))
|
||||||
rb.Add(nil, client.server.name, RPL_SASLSUCCESS, client.nick, client.t("Authentication successful"))
|
rb.Add(nil, client.server.name, RPL_SASLSUCCESS, details.nick, client.t("Authentication successful"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// dispatch account-notify
|
// dispatch account-notify
|
||||||
for friend := range client.Friends(caps.AccountNotify) {
|
for friend := range client.Friends(caps.AccountNotify) {
|
||||||
friend.Send(nil, client.nickMaskString, "ACCOUNT", account)
|
friend.Send(nil, details.nickMask, "ACCOUNT", details.accountName)
|
||||||
}
|
}
|
||||||
|
|
||||||
client.server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] logged into account $c[grey][$r%s$c[grey]]"), client.nickMaskString, account))
|
client.server.snomasks.Send(sno.LocalAccounts, fmt.Sprintf(ircfmt.Unescape("Client $c[grey][$r%s$c[grey]] logged into account $c[grey][$r%s$c[grey]]"), details.nickMask, details.accountName))
|
||||||
|
|
||||||
|
client.server.logger.Info("accounts", "client", details.nick, "logged into account", details.accountName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ACC VERIFY <accountname> <auth_code>
|
// ACC VERIFY <accountname> <auth_code>
|
||||||
|
@ -463,6 +463,7 @@ func nsUnregisterHandler(server *Server, client *Client, command string, params
|
|||||||
nsNotice(rb, client.t("Error while unregistering account"))
|
nsNotice(rb, client.t("Error while unregistering account"))
|
||||||
} else {
|
} else {
|
||||||
nsNotice(rb, fmt.Sprintf(client.t("Successfully unregistered account %s"), cfname))
|
nsNotice(rb, fmt.Sprintf(client.t("Successfully unregistered account %s"), cfname))
|
||||||
|
server.logger.Info("accounts", "client", client.Nick(), "unregistered account", cfname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +372,8 @@ logging:
|
|||||||
# channels channel creation and operations
|
# channels channel creation and operations
|
||||||
# commands command calling and operations
|
# commands command calling and operations
|
||||||
# opers oper actions, authentication, etc
|
# opers oper actions, authentication, etc
|
||||||
# password password hashing and comparing
|
# services actions related to NickServ, ChanServ, etc.
|
||||||
|
# internal unexpected runtime behavior, including potential bugs
|
||||||
# userinput raw lines sent by users
|
# userinput raw lines sent by users
|
||||||
# useroutput raw lines sent to users
|
# useroutput raw lines sent to users
|
||||||
type: "* -userinput -useroutput"
|
type: "* -userinput -useroutput"
|
||||||
|
Loading…
Reference in New Issue
Block a user