Fixed stupid issue of usermanager for hash creating not being one that is selected from settings.

master
q3k 2013-05-30 23:01:04 +02:00
parent aab5b5536b
commit 29a3c02cfa
1 changed files with 9 additions and 3 deletions

View File

@ -49,13 +49,19 @@ class UserManager(object):
class HackerspaceUserManager(UserManager): class HackerspaceUserManager(UserManager):
"""A user manager for the Warsaw Hackerspace, uses interal apis.""" """A user manager for the Warsaw Hackerspace, uses interal apis."""
def __init__(self): def __init__(self):
super(HackerspaceUserManager, self).__init__(self) super(HackerspaceUserManager, self).__init__()
self.group = settings().get(["accessControl", "group"]) self.group = settings().get(["accessControl", "group"])
def createPasswordHash(self, password):
return password
def findUser(self, username=None): def findUser(self, username=None):
if username == "dummy":
return DummyUser()
print "finduser: {}".format(username)
if requests.get("https://capacifier.hackerspace.pl/{}/{}".format(self.group, username)).status_code == 200: if requests.get("https://capacifier.hackerspace.pl/{}/{}".format(self.group, username)).status_code == 200:
return HackerspaceUser(username) return HackerspaceUser(username)
else else:
return None return None
##~~ FilebasedUserManager, takes available users from users.yaml file ##~~ FilebasedUserManager, takes available users from users.yaml file
@ -245,7 +251,7 @@ class HackerspaceUser(User):
"login": self._username, "login": self._username,
"password": password, "password": password,
} }
return requests.post("https://auth.hackerspace.pl/", data).status_code == 200 return requests.post("https://auth.hackerspace.pl/", data, verify=False).status_code == 200
##~~ DummyUser object to use when accessControl is disabled ##~~ DummyUser object to use when accessControl is disabled