1
0
Fork 0
forked from External/ergo

Merge pull request #386 from slingamn/regenabled

allow SAREGISTER even when normal registration is fully disabled
This commit is contained in:
Daniel Oaks 2019-02-18 07:08:04 +10:00 committed by GitHub
commit c604638b7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 11 deletions

View file

@ -307,6 +307,12 @@ func (am *AccountManager) Register(client *Client, account string, callbackNames
}
config := am.server.AccountConfig()
// final "is registration allowed" check, probably redundant:
if !(config.Registration.Enabled || callbackNamespace == "admin") {
return errFeatureDisabled
}
// if nick reservation is enabled, you can only register your current nickname
// as an account; this prevents "land-grab" situations where someone else
// registers your nick out from under you and then NS GHOSTs you