mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Disable unregister by default.
This commit is contained in:
parent
33254cb538
commit
f515617529
20
src/User.py
20
src/User.py
@ -141,13 +141,19 @@ class User(callbacks.Privmsg):
|
||||
Unregisters <name> from the user database. If the user giving this
|
||||
command is an owner user, the password is not necessary.
|
||||
"""
|
||||
if not user.checkPassword(password):
|
||||
user = ircdb.users.getUser(msg.prefix)
|
||||
if not user.checkCapability('owner'):
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||
return
|
||||
ircdb.users.delUser(user.id)
|
||||
irc.replySuccess()
|
||||
if conf.supybot.databases.users.allowUnregistration():
|
||||
if not user.checkPassword(password):
|
||||
try:
|
||||
user = ircdb.users.getUser(msg.prefix)
|
||||
except KeyError:
|
||||
user = None
|
||||
if not user or not user.checkCapability('owner'):
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||
ircdb.users.delUser(user.id)
|
||||
irc.replySuccess()
|
||||
else:
|
||||
irc.error('This command has been disabled. You\'ll have to ask '
|
||||
'the owner of this bot to unregister your user.')
|
||||
unregister = wrap(unregister, ['private', 'otherUser',
|
||||
additional('something', '')])
|
||||
|
||||
|
@ -748,6 +748,11 @@ registerGlobalValue(supybot.databases.users, 'timeoutIdentification',
|
||||
registry.Integer(0, """Determines how long it takes identification to time
|
||||
out. If the value is less than or equal to zero, identification never
|
||||
times out."""))
|
||||
registerGlobalValue(supybot.databases.users, 'allowUnregistration',
|
||||
registry.Boolean(False, """Determines whether the bot will allow users to
|
||||
unregister their users. This can wreak havoc with already-existing
|
||||
databases, so by default we don't allow it. Enable this at your own risk.
|
||||
"""))
|
||||
registerGlobalValue(supybot.databases.users, 'hash',
|
||||
registry.Boolean(True, """Determines whether the passwords in the user
|
||||
database will be hashed by default. This only affects new users; users
|
||||
|
Loading…
Reference in New Issue
Block a user