-# import the User object
-from django.contrib.auth.models import User
-from engine.manifoldapi import ManifoldAPI
+import time
+from django.contrib.auth.models import User
-# import time - this is used to create Django's internal username
-import time
+from engine.manifoldapi import ManifoldAPI
# Name my backend 'ManifoldBackend'
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