def changePassword(self, username, pwd): user = self.get(username) if user: hashed = pbkdf2_sha256.encrypt(pwd, **conf.getPBKDFSettings()) user['password'] = hashed self.db.user_update(user) return True return False
def insert(self, user, passwd, admin=False, localOnly=False): hashed = pbkdf2_sha256.encrypt(passwd, **conf.getPBKDFSettings()) data = {'username': user, 'password': hashed} if admin: data['master'] = True if localOnly: data['local_only'] = True self.db.user_add(data)