X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=auth%2Fmanifoldbackend.py;h=96697b3f001daa3c64ed39c99ebf72f275525daf;hb=b709866ba93d98c32127ff4deae5b783e271e5b3;hp=da3c23f93b545dee7e6b6d2e087ae67749148ecd;hpb=bbdf40b4dd1bebc81461f1c9294aca95323bf889;p=myslice.git diff --git a/auth/manifoldbackend.py b/auth/manifoldbackend.py index da3c23f9..96697b3f 100644 --- a/auth/manifoldbackend.py +++ b/auth/manifoldbackend.py @@ -1,10 +1,8 @@ -# import the User object +import time + from django.contrib.auth.models import User -from engine.manifoldapi import ManifoldAPI - -# import time - this is used to create Django's internal username -import time +from manifold.manifoldapi import ManifoldAPI # Name my backend 'ManifoldBackend' class ManifoldBackend: @@ -27,19 +25,19 @@ class ManifoldBackend: if not session : return None - request.session['manifold_session'] = session #self.session = session # Change GetSession() at some point to return expires as well expires = time.time() + (24 * 60 * 60) # Change to session authentication api.auth = {'AuthMethod': 'session', 'session': session} - #self.api = api + self.api = api # Get account details person = api.GetPersons(auth)[0] - request.session['manifold_person'] = person - #self.person = person[0] + self.person = person + + request.session['manifold'] = {'auth': api.auth, 'person': person, 'expires': expires} except: return None