mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-02 16:31:09 -05:00
Updated for the new _checkCapability name.
This commit is contained in:
parent
58b4e09e83
commit
ae48b426b4
16
src/User.py
16
src/User.py
@ -67,7 +67,7 @@ class User(callbacks.Privmsg):
|
|||||||
if option == 'capability':
|
if option == 'capability':
|
||||||
def p(u, cap=arg):
|
def p(u, cap=arg):
|
||||||
try:
|
try:
|
||||||
return u.checkCapability(cap)
|
return u._checkCapability(cap)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return False
|
return False
|
||||||
predicates.append(p)
|
predicates.append(p)
|
||||||
@ -116,7 +116,7 @@ class User(callbacks.Privmsg):
|
|||||||
'Hostmasks are not valid usernames.', Raise=True)
|
'Hostmasks are not valid usernames.', Raise=True)
|
||||||
try:
|
try:
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
if u.checkCapability('owner'):
|
if u._checkCapability('owner'):
|
||||||
addHostmask = False
|
addHostmask = False
|
||||||
else:
|
else:
|
||||||
irc.error('Your hostmask is already registered to %s' % u.name)
|
irc.error('Your hostmask is already registered to %s' % u.name)
|
||||||
@ -140,7 +140,7 @@ class User(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
caller = ircdb.users.getUser(msg.prefix)
|
caller = ircdb.users.getUser(msg.prefix)
|
||||||
isOwner = caller.checkCapability('owner')
|
isOwner = caller._checkCapability('owner')
|
||||||
except KeyError:
|
except KeyError:
|
||||||
caller = None
|
caller = None
|
||||||
isOwner = False
|
isOwner = False
|
||||||
@ -213,7 +213,7 @@ class User(callbacks.Privmsg):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||||
Raise=True)
|
Raise=True)
|
||||||
if not u.checkCapability('owner'):
|
if not u._checkCapability('owner'):
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||||
Raise=True)
|
Raise=True)
|
||||||
try:
|
try:
|
||||||
@ -241,7 +241,7 @@ class User(callbacks.Privmsg):
|
|||||||
if not user.checkPassword(password) and \
|
if not user.checkPassword(password) and \
|
||||||
not user.checkHostmask(msg.prefix):
|
not user.checkHostmask(msg.prefix):
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
if not u.checkCapability('owner'):
|
if not u._checkCapability('owner'):
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
@ -270,7 +270,7 @@ class User(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
if user.checkPassword(password) or \
|
if user.checkPassword(password) or \
|
||||||
(u.checkCapability('owner') and not u == user):
|
(u._checkCapability('owner') and not u == user):
|
||||||
user.setPassword(newpassword)
|
user.setPassword(newpassword)
|
||||||
ircdb.users.setUser(user)
|
ircdb.users.setUser(user)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
@ -419,9 +419,9 @@ class User(callbacks.Privmsg):
|
|||||||
users += 1
|
users += 1
|
||||||
hostmasks += len(user.hostmasks)
|
hostmasks += len(user.hostmasks)
|
||||||
try:
|
try:
|
||||||
if user.checkCapability('owner'):
|
if user._checkCapability('owner'):
|
||||||
owners += 1
|
owners += 1
|
||||||
elif user.checkCapability('admin'):
|
elif user._checkCapability('admin'):
|
||||||
admins += 1
|
admins += 1
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user