INQ-37
This commit is contained in:
parent
75752adff0
commit
ecebcfc0b5
5
App.py
5
App.py
@ -65,10 +65,11 @@ def do_login():
|
||||
password=request.form['password']
|
||||
ldapquery = py_ldap.LdapQuery(servers, port, root)
|
||||
auth=ldapquery.authenticate(login+suffix, password)
|
||||
if auth==True and login == 's396355':
|
||||
searchstring=ldapquery.search_user(login);
|
||||
if auth==True and (searchstring[0][0].lower().find('ou=faculty')!=-1 or login == 's396355'):
|
||||
session['logged_in'] = True
|
||||
session['user_type'] = 'lecturer'
|
||||
elif auth==True and login == 's441471':
|
||||
elif auth==True and searchstring[0][0].lower().find('ou=students')!=-1:
|
||||
session['logged_in'] = True
|
||||
session['user_type'] = 'student'
|
||||
else:
|
||||
|
Binary file not shown.
BIN
inquire.db
BIN
inquire.db
Binary file not shown.
@ -25,7 +25,7 @@ class LdapQuery():
|
||||
self.root,
|
||||
ldap.SCOPE_SUBTREE,
|
||||
'cn=' + login,
|
||||
['givenname', 'sn', 'mail'])
|
||||
['givenname', 'sn', 'title', 'mail'])
|
||||
|
||||
def authenticate(self, login=None, passwd=None):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user