diff --git a/plugins/Admin/plugin.py b/plugins/Admin/plugin.py index 781570695..149d08235 100644 --- a/plugins/Admin/plugin.py +++ b/plugins/Admin/plugin.py @@ -298,12 +298,10 @@ class Admin(callbacks.Plugin): def add(self, irc, msg, args, hostmask, expires): """ [] - Ignores or, if a nick is given, ignores whatever - hostmask that nick is currently using. is a "seconds - from now" value that determines when the ignore will expire; if, - for instance, you wish for the ignore to expire in an hour, you - could give an of 3600. If no is given, the - ignore will never automatically expire. + This will set a persistent ignore on or the hostmask + currently associated with . is an optional argument + specifying when (in "seconds from now") the ignore will expire; if + it isn't given, the ignore will never automatically expire. """ ircdb.ignores.add(hostmask, expires) irc.replySuccess() @@ -312,8 +310,8 @@ class Admin(callbacks.Plugin): def remove(self, irc, msg, args, hostmask): """ - Ignores or, if a nick is given, ignores whatever - hostmask that nick is currently using. + This will remove the persistent ignore on or the + hostmask currently associated with . """ try: ircdb.ignores.remove(hostmask) @@ -325,7 +323,7 @@ class Admin(callbacks.Plugin): def list(self, irc, msg, args): """takes no arguments - Returns the hostmasks currently being globally ignored. + Lists the hostmasks that the bot is ignoring. """ # XXX Add the expirations. if ircdb.ignores.hostmasks: diff --git a/plugins/User/plugin.py b/plugins/User/plugin.py index cf1342027..e9eddc3b6 100644 --- a/plugins/User/plugin.py +++ b/plugins/User/plugin.py @@ -150,8 +150,8 @@ class User(callbacks.Plugin): Changes your current user database name to the new name given. is only necessary if the user isn't recognized by hostmask. - If you include the parameter, this message must be sent - to the bot privately (not on a channel). + This message must be sent to the bot privately (not on a channel) since + it may contain a password. """ try: id = ircdb.users.getUserId(newname) @@ -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,7 +191,8 @@ class User(callbacks.Plugin): irc.replySuccess() else: irc.error(conf.supybot.replies.incorrectAuthentication()) - password = wrap(password, ['otherUser', 'something', 'something']) + password = wrap(password, ['private', optional('otherUser'), + 'something', 'something']) def secure(self, irc, msg, args, user, password, value): """ [] @@ -322,6 +327,8 @@ class User(callbacks.Plugin): ircdb.users.setUser(user) except ValueError, e: irc.error(str(e), Raise=True) + except ircdb.DuplicateHostmask: + irc.error('That hostmask is already registered.', Raise=True) irc.replySuccess() add = wrap(add, ['private', first('otherUser', 'user'), optional('something'), additional('something', '')])