From: Thierry Parmentelat Date: Tue, 12 Feb 2013 14:06:47 +0000 (+0100) Subject: show manifold server URL in auth page X-Git-Tag: myslice-django-0.1-1~90 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=8247ee9b8c0108bfe23a677485172950b0a2eed5 show manifold server URL in auth page --- diff --git a/auth/views.py b/auth/views.py index d1e78b53..f6afa3fb 100644 --- a/auth/views.py +++ b/auth/views.py @@ -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') diff --git a/engine/manifold_api.py b/engine/manifold_api.py index f827b518..c166bd8c 100644 --- a/engine/manifold_api.py +++ b/engine/manifold_api.py @@ -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): diff --git a/myslice/config.py b/myslice/config.py index b882b7d4..84a0ee0d 100644 --- a/myslice/config.py +++ b/myslice/config.py @@ -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) diff --git a/templates/view-login.html b/templates/view-login.html index 6e3013cf..80182efb 100644 --- a/templates/view-login.html +++ b/templates/view-login.html @@ -5,13 +5,16 @@ {% endblock content_related %} {% block content_main %} - -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. - -

Currently hard wired users:

+ This page is currently connected to two authentication systems: + {% endblock content_main %}