show manifold server URL in auth page
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 12 Feb 2013 14:06:47 +0000 (15:06 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 12 Feb 2013 14:06:47 +0000 (15:06 +0100)
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 6e3013c..80182ef 100644 (file)
@@ -5,13 +5,16 @@
 {% endblock content_related %}
 
 {% block content_main %}
-<code>
-This page is currently not connected to any useful authentication system, but instead, as a proof of concept, it uses a set of hardwired user accounts, 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>, and</li>
+<li>
+as a proof of concept, a set of hardwired user accounts, see auth/backend.py 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 %}