From 5ffad1dedf2e0fd3be2006d72e7d06662ece2419 Mon Sep 17 00:00:00 2001 From: Loic & Edelberto Date: Wed, 23 Apr 2014 10:33:48 -0300 Subject: [PATCH] FIBRE portal end of March --- auth/manifoldbackend.py | 16 +- myslice/settings.py | 3 + myslice/urls.py | 6 +- plugins/cafe-1.0/edelberto-120314.py | 258 +++++++----------- plugins/cafe-1.0/edelberto.py | 176 +++++++----- .../others/edelberto.py-noupdateaccountONLY | 197 ------------- plugins/cafe-1.0/others/edelberto.py.101113 | 174 ------------ plugins/cafe-1.0/others/edelberto_context.py | 33 --- plugins/cafe-1.0/others/manifoldbackend.py | 76 ------ plugins/cafe-1.0/others/sub.py | 22 -- portal/actions.py | 26 +- portal/registrationview.py | 24 +- portal/templates/contact.html | 2 +- portal/templates/documentationview.html | 2 +- portal/templates/fibre/fibre_home-view.html | 6 +- .../fibre/fibre_slice-resource-view.html | 46 +++- .../fibre/fibre_slice-user-view.html | 79 +++--- portal/templates/fibre/fibre_slice-view.html | 76 ++---- .../fibre/fibre_widget-slice-sections.html | 36 ++- portal/templates/registration_view.html | 2 +- portal/templates/user_register.html | 2 +- 21 files changed, 390 insertions(+), 872 deletions(-) delete mode 100644 plugins/cafe-1.0/others/edelberto.py-noupdateaccountONLY delete mode 100644 plugins/cafe-1.0/others/edelberto.py.101113 delete mode 100644 plugins/cafe-1.0/others/edelberto_context.py delete mode 100644 plugins/cafe-1.0/others/manifoldbackend.py delete mode 100755 plugins/cafe-1.0/others/sub.py diff --git a/auth/manifoldbackend.py b/auth/manifoldbackend.py index 4f44661e..69cbf21a 100644 --- a/auth/manifoldbackend.py +++ b/auth/manifoldbackend.py @@ -23,14 +23,21 @@ class ManifoldBackend: return None try: - #usernameldap is from LDAP user form. If it is filled - See portal/homeview.py too - usernameldap = token['usernameldap'] + print "ManifoldBackend authenticate()" + # Mandatory fields in token username = token['username'] - password = token['password'] request = token['request'] + # usernameldap is optional - from LDAP user form. + # If it is filled - See portal/homeview.py too + if 'usernameldap' in token: + usernameldap = token['usernameldap'] + else: + usernameldap = None + password = token['password'] # if data are not from LDAP form then normal (local) login if not usernameldap: + print "not userldap ManifoldBackend authenticate()" auth = {'AuthMethod': 'password', 'Username': username, 'AuthString': password} api = ManifoldAPI(auth) sessions_result = api.forward(Query.create('local:session').to_dict()) @@ -62,8 +69,9 @@ class ManifoldBackend: # Edelberto LDAP authentication # if data are from LDAP form, so else: + print "userldap ManifoldBackend authenticate()" # XXX UGLY - # Needing to create an specif entries at settings.py (or myslice.ini) for these vars + # Needing to create an specific entries at settings.py (or myslice.ini) for these vars ################################################## # Edelberto - UFF - esilva@ic.uff.br # v1 - ldap authentication module diff --git a/myslice/settings.py b/myslice/settings.py index 8fd5d9ab..cf9cbb6c 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -265,3 +265,6 @@ CSRF_FAILURE_VIEW = 'manifoldapi.manifoldproxy.csrf_failure' #IA_JS_FORMAT = " + {% endblock %} {% block content %} @@ -9,37 +13,57 @@
-