Fixed handling of secure flag by IrcUser.setAuth.

This commit is contained in:
Jeremy Fincher 2003-10-11 10:20:15 +00:00
parent 6406e29268
commit 7528215674

View File

@ -253,7 +253,10 @@ class IrcUser(object):
def setAuth(self, hostmask):
"""Sets a user's authenticated hostmask. This times out in 1 hour."""
self.auth = (time.time(), hostmask)
if self.checkHostmask(hostmask, useAuth=False) or not self.secure:
self.auth = (time.time(), hostmask)
else:
raise ValueError, 'secure flag set, unmatched hostmask'
def unsetAuth(self):
"""Unsets a use's authenticated hostmask."""