mirror of https://github.com/Mikaela/Limnoria.git
User: Only require name for set.password when changing other user's password.
Closes: Sf#3055358 Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
f977a3a260
commit
de726f90f3
|
@ -168,7 +168,7 @@ class User(callbacks.Plugin):
|
||||||
|
|
||||||
class set(callbacks.Commands):
|
class set(callbacks.Commands):
|
||||||
def password(self, irc, msg, args, user, password, newpassword):
|
def password(self, irc, msg, args, user, password, newpassword):
|
||||||
"""<name> <old password> <new password>
|
"""[<name>] <old password> <new password>
|
||||||
|
|
||||||
Sets the new password for the user specified by <name> to <new
|
Sets the new password for the user specified by <name> to <new
|
||||||
password>. Obviously this message must be sent to the bot
|
password>. Obviously this message must be sent to the bot
|
||||||
|
@ -180,6 +180,10 @@ class User(callbacks.Plugin):
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
u = None
|
u = None
|
||||||
|
if user is None:
|
||||||
|
if u is None:
|
||||||
|
irc.errorNotRegistered(Raise=True)
|
||||||
|
user = u
|
||||||
if user.checkPassword(password) or \
|
if user.checkPassword(password) or \
|
||||||
(u and u._checkCapability('owner') and not u == user):
|
(u and u._checkCapability('owner') and not u == user):
|
||||||
user.setPassword(newpassword)
|
user.setPassword(newpassword)
|
||||||
|
@ -187,8 +191,8 @@ class User(callbacks.Plugin):
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
else:
|
else:
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||||
password = wrap(password, ['private', 'otherUser', 'something',
|
password = wrap(password, ['private', optional('otherUser'),
|
||||||
'something'])
|
'something', 'something'])
|
||||||
|
|
||||||
def secure(self, irc, msg, args, user, password, value):
|
def secure(self, irc, msg, args, user, password, value):
|
||||||
"""<password> [<True|False>]
|
"""<password> [<True|False>]
|
||||||
|
|
Loading…
Reference in New Issue