def adduser(self): if not self.values: self.chat("Who are you trying to add?") return whom = Id(self.lastid) if not whom.is_authenticated: self.chat("I'm sorry, Dave, I'm afraid I can't do that") return new_user = Id(self.values[0]) tmp_pass = str(totp.now()) new_user.setpassword(tmp_pass, True) self.chat('Hi %s, your temporary password is %s. Please set up your user ' 'by identifying yourself to me via private message (.identify %s) and ' 'then changing your password (.passwd <newpass>).' % (new_user.nick, tmp_pass, tmp_pass), target=new_user.nick)
def _setaccess(self): return totp.now()