From de726f90f395c0ec0d705a7e582fe4f643898e86 Mon Sep 17 00:00:00 2001 From: James Vega Date: Sun, 29 Aug 2010 11:10:54 -0400 Subject: [PATCH] User: Only require name for set.password when changing other user's password. Closes: Sf#3055358 Signed-off-by: James Vega --- plugins/User/plugin.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/User/plugin.py b/plugins/User/plugin.py index df5353e88..e08348239 100644 --- a/plugins/User/plugin.py +++ b/plugins/User/plugin.py @@ -168,7 +168,7 @@ class User(callbacks.Plugin): class set(callbacks.Commands): def password(self, irc, msg, args, user, password, newpassword): - """ + """[] Sets the new password for the user specified by to . Obviously this message must be sent to the bot @@ -180,6 +180,10 @@ class User(callbacks.Plugin): u = ircdb.users.getUser(msg.prefix) except KeyError: u = None + if user is None: + if u is None: + irc.errorNotRegistered(Raise=True) + user = u if user.checkPassword(password) or \ (u and u._checkCapability('owner') and not u == user): user.setPassword(newpassword) @@ -187,8 +191,8 @@ class User(callbacks.Plugin): irc.replySuccess() else: irc.error(conf.supybot.replies.incorrectAuthentication()) - password = wrap(password, ['private', 'otherUser', 'something', - 'something']) + password = wrap(password, ['private', optional('otherUser'), + 'something', 'something']) def secure(self, irc, msg, args, user, password, value): """ []