def do_login(self, username=None, password=None): if not username or not password: return "Empty username or password." user = None for u in User.get_all(): if u.username == username: user = u break if user is None: return "Invalid username." if user.check_password(password): self.server.services.authentication.authenticate(self.request, user) return "Logged in." else: return "Invalid password."
def list(self): """Return the list of users.""" return self.render("auth.user.list", users=ModUser.get_all())
def list(self): """Return the list of users.""" print(self.server.services.authentication.authenticated(self.request)) return self.render("auth.user.list", users=ModUser.get_all())
def list(self): """Return the list of users.""" print(self.server.services.authentication.authenticated(self.request)) return self.render("auth.user.list", users=ModUser.get_all())
def list(self): """Return the list of users.""" return self.render("auth.user.list", users=ModUser.get_all())