(self, pw)
| 32 | self.admin = admin |
| 33 | |
| 34 | def encodeAndSetPassword(self, pw): |
| 35 | h = hashlib.new("sha256") |
| 36 | salt = "".join([random.choice(string.letters) for _ in range(32)]) |
| 37 | h.update(pw) |
| 38 | h.update(salt) |
| 39 | self.password = ("%s%s" % (h.hexdigest(), salt)) |
| 40 | |
| 41 | def isPasswordValid(self, pw): |
| 42 | if self.password is None: |