Merge branch 'master' of ssh://git.onelab.eu/git/myslice-django
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 12 Feb 2013 14:09:20 +0000 (15:09 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 12 Feb 2013 14:09:20 +0000 (15:09 +0100)
Conflicts:
templates/view-login.html

auth/views.py
engine/manifold_api.py
myslice/config.py
templates/view-login.html

index d1e78b5..f6afa3f 100644 (file)
@@ -8,12 +8,15 @@ from django.http import HttpResponseRedirect
 from auth.backend import MyCustomBackend
 
 from myslice.viewutils import the_user
+from myslice.config import Config
 
 def login_user(request):
     state = "Please log in below..."
     username = password = ''
-    env={'hard_wired_users':MyCustomBackend.hard_wired_users}
-    
+    env={'hard_wired_users':MyCustomBackend.hard_wired_users,
+         'manifold_url':Config.manifold_url(),
+         }
+
     if request.POST:
         username = request.POST.get('username')
         password = request.POST.get('password')
index f827b51..c166bd8 100644 (file)
@@ -16,7 +16,7 @@ class ManifoldAPI:
     self.trace = []
     self.calls = {}
     self.multicall = False
-    self.url = "http://"+self.server+":"+self.port+"/"
+    self.url = config.manifold_url()
     self.proxy = xmlrpclib.Server(self.url, verbose=False, allow_none=True)
 
   def __getattr__(self, methodName):
index b882b7d..84a0ee0 100644 (file)
@@ -4,3 +4,7 @@ class Config:
     manifold_server = 'debian04.pl.sophia.inria.fr'
     manifold_port = '7080'
     manifold_path = '/'
+
+    @staticmethod
+    def manifold_url (): 
+        return "http://%s:%s%s"%(Config.manifold_server,Config.manifold_port,Config.manifold_path)
index 3edcff0..5a5aeb4 100644 (file)
@@ -5,16 +5,16 @@
 {% endblock content_related %}
 
 {% block content_main %}
-</br>
-<code>
-This page is currently connected to the Manifold authentication backend, By default it is pointing to the Manifold API running at "demo.myslice.info", in case you want to point it to your own Manifold API, please edit engine/manifold_api.py.
-</br></br>
-And also, as a proof of concept, it uses a set of hardwired user accounts for testing purposes, see auth/backend.py for more details.
-</code>
-<p>Currently hard wired users:</p>
+<code> This page is currently connected to two authentication systems:</code>
+<ul>
+<li> A manifold server, located at <code>{{ manifold_url }}</code>, (configured in <code>myslice/config.py</code>), and</li>
+<li>
+as a proof of concept, a set of hardwired user accounts, see <code>auth/backend.py</code> for more details. 
+Currently hard wired users are:
 <ul>
   {% for k,v in hard_wired_users.iteritems %}
   <li class='well'> Name= <code>{{ k }}</code>, Password= <code>{{ v }}</code> </li>
   {% endfor %}
 </ul>
+</li></ul>
 {% endblock content_main %}