diff --git a/ChangeLog b/ChangeLog index ad7c95421..d313f2735 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ + * Changed the supybot.user configuration variable so that if it + isn't configured, the user will stay up-to-date with the current + version of the bot. To take advantage of this, set your + supybot.user configuration variable to "" + * Fixed a bug with AutoMode's auto-banning feature; a variable was misspelled. diff --git a/src/User.py b/src/User.py index 55aa0e057..e50140f10 100755 --- a/src/User.py +++ b/src/User.py @@ -259,31 +259,24 @@ class User(callbacks.Privmsg): removehostmask = wrap(removehostmask, ['private', 'otherUser', 'something', additional('something', '')]) - def setpassword(self, irc, msg, args, optlist, user, password,newpassword): - """[--hashed] + def setpassword(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 - privately (not in a channel). If --hashed is given, the password will - be hashed on disk (rather than being stored in plaintext. If the - requesting user is an owner user (and the user whose password is being - changed isn't that same owner user), then needn't be - correct. + privately (not in a channel). If the requesting user is an owner user + (and the user whose password is being changed isn't that same owner + user), then needn't be correct. """ - hashed = conf.supybot.databases.users.hash() - for (option, arg) in optlist: - if option == 'hashed': - hashed = True u = ircdb.users.getUser(msg.prefix) if user.checkPassword(password) or \ (u.checkCapability('owner') and not u == user): - user.setPassword(newpassword, hashed=hashed) + user.setPassword(newpassword) ircdb.users.setUser(user) irc.replySuccess() else: irc.error(conf.supybot.replies.incorrectAuthentication()) - setpassword = wrap(setpassword, [getopts({'hashed':''}), 'otherUser', - 'something', 'something']) + setpassword = wrap(setpassword, ['otherUser', 'something', 'something']) def username(self, irc, msg, args, hostmask): """ diff --git a/src/ircdb.py b/src/ircdb.py index d9ff11ead..97d394bc5 100644 --- a/src/ircdb.py +++ b/src/ircdb.py @@ -755,8 +755,7 @@ class UsersDictionary(utils.IterableMap): def newUser(self): """Allocates a new user in the database and returns it and its id.""" - hashed = conf.supybot.databases.users.hash() - user = IrcUser(hashed=hashed) + user = IrcUser(hashed=True) self.nextId += 1 id = self.nextId self.users[id] = user diff --git a/test/test_User.py b/test/test_User.py index 0eb5dc258..020f12567 100644 --- a/test/test_User.py +++ b/test/test_User.py @@ -87,19 +87,13 @@ class UserTestCase(PluginTestCase, PluginDocumentation): self.assertNotError('changename foo baz') def testSetpassword(self): - orig = conf.supybot.databases.users.hash() - try: - conf.supybot.databases.users.hash.setValue(False) - self.prefix = self.prefix1 - self.assertNotError('register foo bar') - self.assertEqual(ircdb.users.getUser(self.prefix).password, 'bar') - self.assertNotError('setpassword foo bar baz') - self.assertEqual(ircdb.users.getUser(self.prefix).password, 'baz') - self.assertNotError('setpassword --hashed foo baz biff') - self.assertNotEqual(ircdb.users.getUser(self.prefix).password, - 'biff') - finally: - conf.supybot.databases.users.hash.setValue(orig) + self.prefix = self.prefix1 + self.assertNotError('register foo bar') + password = ircdb.users.getUser(self.prefix).password + self.assertNotEqual(password, 'bar') + self.assertNotError('setpassword foo bar baz') + self.assertNotEqual(ircdb.users.getUser(self.prefix).password,password) + self.assertNotEqual(ircdb.users.getUser(self.prefix).password, 'baz') def testStats(self): self.assertNotError('user stats')