Przeglądaj źródła

accountreg: Fix crash

tags/v0.7.2
Daniel Oaks 7 lat temu
rodzic
commit
ff3a864aa3
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6
    0
      irc/accountreg.go

+ 6
- 0
irc/accountreg.go Wyświetl plik

@@ -84,6 +84,12 @@ func removeFailedRegCreateData(store *buntdb.DB, account string) {
84 84
 
85 85
 // regCreateHandler parses the REG CREATE command.
86 86
 func regCreateHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
87
+	// make sure reg is enabled
88
+	if !server.accountRegistration.Enabled {
89
+		client.Send(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", "Account registration is disabled")
90
+		return false
91
+	}
92
+
87 93
 	// get and sanitise account name
88 94
 	account := strings.TrimSpace(msg.Params[1])
89 95
 	casefoldedAccount, err := CasefoldName(account)

Ładowanie…
Anuluj
Zapisz