From 8247ee9b8c0108bfe23a677485172950b0a2eed5 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 12 Feb 2013 15:06:47 +0100 Subject: [PATCH] show manifold server URL in auth page --- auth/views.py | 7 +++++-- engine/manifold_api.py | 2 +- myslice/config.py | 4 ++++ templates/view-login.html | 11 +++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) 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 %} -- 2.43.0