コード例 #1
0
 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
コード例 #2
0
 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)