split engine/ into manifold/ (backend oriented) and unfold/ (the UI)
[myslice.git] / auth / manifoldbackend.py
index da3c23f..96697b3 100644 (file)
@@ -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