mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 03:02:48 +01:00
remove allow-multiple-per-connection
This commit is contained in:
parent
b45b863fc4
commit
6eda236eab
@ -81,7 +81,6 @@ type AccountRegistrationConfig struct {
|
|||||||
VerifyMessage string `yaml:"verify-message"`
|
VerifyMessage string `yaml:"verify-message"`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AllowMultiplePerConnection bool `yaml:"allow-multiple-per-connection"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type VHostConfig struct {
|
type VHostConfig struct {
|
||||||
|
@ -85,13 +85,9 @@ func parseCallback(spec string, config *AccountConfig) (callbackNamespace string
|
|||||||
func accRegisterHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
func accRegisterHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
||||||
// clients can't reg new accounts if they're already logged in
|
// clients can't reg new accounts if they're already logged in
|
||||||
if client.LoggedIntoAccount() {
|
if client.LoggedIntoAccount() {
|
||||||
if server.AccountConfig().Registration.AllowMultiplePerConnection {
|
|
||||||
server.accounts.Logout(client)
|
|
||||||
} else {
|
|
||||||
rb.Add(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", client.t("You're already logged into an account"))
|
rb.Add(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", client.t("You're already logged into an account"))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// get and sanitise account name
|
// get and sanitise account name
|
||||||
account := strings.TrimSpace(msg.Params[1])
|
account := strings.TrimSpace(msg.Params[1])
|
||||||
|
@ -264,13 +264,9 @@ func nsRegisterHandler(server *Server, client *Client, command, params string, r
|
|||||||
}
|
}
|
||||||
|
|
||||||
if client.LoggedIntoAccount() {
|
if client.LoggedIntoAccount() {
|
||||||
if server.AccountConfig().Registration.AllowMultiplePerConnection {
|
|
||||||
server.accounts.Logout(client)
|
|
||||||
} else {
|
|
||||||
nsNotice(rb, client.t("You're already logged into an account"))
|
nsNotice(rb, client.t("You're already logged into an account"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
config := server.AccountConfig()
|
config := server.AccountConfig()
|
||||||
var callbackNamespace, callbackValue string
|
var callbackNamespace, callbackValue string
|
||||||
|
@ -163,10 +163,6 @@ accounts:
|
|||||||
# password: ""
|
# password: ""
|
||||||
# sender: "admin@my.network"
|
# sender: "admin@my.network"
|
||||||
|
|
||||||
# allow multiple account registrations per connection
|
|
||||||
# this is for testing purposes and shouldn't be allowed on real networks
|
|
||||||
allow-multiple-per-connection: false
|
|
||||||
|
|
||||||
# is account authentication enabled?
|
# is account authentication enabled?
|
||||||
authentication-enabled: true
|
authentication-enabled: true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user