From: Loic & Edelberto Date: Wed, 23 Apr 2014 14:03:49 +0000 (-0300) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into fibre X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=28bd593d5a6cca6cc6d405dbbdd98ce89b3b4ea2;p=unfold.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into fibre Conflicts: auth/manifoldbackend.py myslice/settings.py portal/templates/contact.html portal/templates/documentationview.html portal/templates/registration_view.html setup.py --- 28bd593d5a6cca6cc6d405dbbdd98ce89b3b4ea2 diff --cc auth/manifoldbackend.py index 69cbf21a,afb87821..0522653b --- a/auth/manifoldbackend.py +++ b/auth/manifoldbackend.py @@@ -201,31 -54,22 +201,31 @@@ class ManifoldBackend import traceback traceback.print_exc() return None - - try: - # Check if the user exists in Django's local database - user = User.objects.get(username=username) - except User.DoesNotExist: - # Create a user in Django's local database - user = User.objects.create_user(username, username, 'passworddoesntmatter') - user.email = person['email'] + + if not usernameldap: + try: + # Check if the user exists in Django's local database + user = User.objects.get(username=username) + except User.DoesNotExist: + # Create a user in Django's local database + user = User.objects.create_user(username, usernamep, 'passworddoesntmatter') - user.first_name = "DUMMY_FIRST_NAME" #person['first_name'] - user.last_name = "DUMMY LAST NAME" # person['last_name'] + user.email = person['email'] - return user + else: + if checkldap: + try: + # Check if the user exists in Django's local database + user = User.objects.get(username=usernameldap) + except User.DoesNotExist: + # Create a user in Django's local database + user = User.objects.create_user(username, usernameldap, 'passworddoesntmatter') - user.first_name = "DUMMY_FIRST_NAME" #person['first_name'] - user.last_name = "DUMMY LAST NAME" # person['last_name'] + user.email = person['email'] - return user + if 'firstname' in person: + user.first_name = person['firstname'] + if 'lastname' in person: + user.last_name = person['lastname'] + + return user - # Required for your backend to work properly - unchanged in most scenarios def get_user(self, user_id): try: diff --cc myslice/settings.py index cf9cbb6c,620ab5ba..d4240f4c mode 100644,100755..100755 --- a/myslice/settings.py +++ b/myslice/settings.py @@@ -181,17 -199,17 +199,18 @@@ ROOT_URLCONF = 'myslice.urls # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'unfold.wsgi.application' +#WSGI_APPLICATION = 'myslice.wsgi.application' - TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - #os.path.join(HTTPROOT,"templates"), - os.path.join(HTTPROOT,"templates"), - ) + TEMPLATE_DIRS = [ ] + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + if theme is not None: + TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"portal/templates", theme)) + TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"portal/templates")) + TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"templates")) - INSTALLED_APPS = [ + INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', diff --cc myslice/urls.py index 570916cb,2638e4df..3c729719 --- a/myslice/urls.py +++ b/myslice/urls.py @@@ -15,9 -15,8 +15,10 @@@ from settings import auxiliaries, INSTA import portal.platformsview import portal.dashboardview import portal.homeview + import portal.newsview +import plugins.cafe.edelberto + home_view=portal.homeview.HomeView.as_view() dashboard_view=portal.dashboardview.DashboardView.as_view() platforms_view=portal.platformsview.PlatformsView.as_view() diff --cc portal/homeview.py index bdaa6b9c,62b41366..2667b634 --- a/portal/homeview.py +++ b/portal/homeview.py @@@ -26,18 -26,13 +26,20 @@@ class HomeView (FreeAccessView, ThemeVi def post (self,request): env = self.default_env() env['theme'] = self.theme + env['section'] = "Dashboard" + username = request.POST.get('username') password = request.POST.get('password') + + # LDAP form - If FIBRE, then get the possibilite to authenticate using usernameldap + #if self.theme == 'fibre': + usernameldap = request.POST.get('usernameldap') + token = {'usernameldap': usernameldap, 'username': username ,'password': password, 'request': request} + #else: - # pass request within the token, so manifold session key can be attached to the request session. - token = {'username': username, 'password': password, 'request': request} + # Follow original code + ## pass request within the token, so manifold session key can be attached to the request session. + #token = {'username': username, 'password': password, 'request': request} # our authenticate function returns either # . a ManifoldResult - when something has gone wrong, like e.g. backend is unreachable diff --cc portal/registrationview.py index d7efa79b,ab09c9f1..4f8ab90a --- a/portal/registrationview.py +++ b/portal/registrationview.py @@@ -15,11 -16,9 +16,11 @@@ from manifoldapi.manifoldapi import from manifold.core.query import Query from portal.models import PendingUser -from portal.actions import create_pending_user +#from portal.actions import create_pending_user +# Edelberto - LDAP +from portal.actions import create_pending_user, ldap_create_user - from theme import ThemeView + from myslice.theme import ThemeView # since we inherit from FreeAccessView we cannot redefine 'dispatch' # so let's override 'get' and 'post' instead diff --cc portal/templates/fibre/fibre_contact.html index 00000000,00000000..a610c87f new file mode 100644 --- /dev/null +++ b/portal/templates/fibre/fibre_contact.html @@@ -1,0 -1,0 +1,42 @@@ ++{% extends "layout.html" %} ++ ++{% block head %} ++{{ wizard.form.media }} ++{% endblock %} ++ ++{% block content %} ++
++
++

Open a Ticket FIBRE Support

++
++
++
++
 
++
++
++
++

Please check our FAQ section. Most of the basic problems are explained there.

++

++ If you haven't find your answes in the FAQ, please contact us by filling the form below.
++ You can also e-mail us directly. ++

++
++
++ ++
++
++
++
++ {% csrf_token %} ++ {% for field in form %} ++
++ ++ {{ field.errors }} {{ field }} ++
++ {% endfor %} ++ ++
++
++
++{% endblock %} ++ diff --cc portal/templates/fibre/fibre_documentationview.html index 00000000,00000000..3a22020b new file mode 100644 --- /dev/null +++ b/portal/templates/fibre/fibre_documentationview.html @@@ -1,0 -1,0 +1,15 @@@ ++{% extends "layout.html" %} ++ ++{% block content %} ++
++
++

Open a Ticket FIBRE Portal Documentation

++
++
++
++
++ ++
++
++{% endblock %} ++ diff --cc portal/templates/fibre/fibre_registration_view.html index 00000000,00000000..eb59dfe3 new file mode 100644 --- /dev/null +++ b/portal/templates/fibre/fibre_registration_view.html @@@ -1,0 -1,0 +1,120 @@@ ++{% extends "layout.html" %} ++ ++{% block content %} ++ ++
++
++

User Registration FIBRE Experimenter Registration

++
++
++
++
++

For First Line Support please Contact Support

++
++
++{% if errors %} ++ ++{% endif %} ++ ++
++
++
++
++ {% csrf_token %} ++
++ ++ ++
++
++ ++ ++
++
++ ++ ++

An authority responsible for vetting your account

++
++ ++ ++ ++
++ ++ ++
++
++ ++ ++
++
++ ++ ++
++
++ ++ ++

Genkey: Account Delegation Automatic (Recommended)

++
++ ++
++ ++
++
++
++ ++{% endblock %} ++ diff --cc setup.py index c5890d54,07e121be..4f47f7b7 --- a/setup.py +++ b/setup.py @@@ -17,6 -17,14 +17,13 @@@ print package # Avoid troubles : clean /usr/share/unfold/ #shutil.rmtree('/usr/share/unfold/') + def images (dir): + return glob( dir+"/*.png") + glob ( dir+"/*.gif") + def javascript (dir): + return glob( dir+"/*.js") + def stylesheets (dir): + return glob( dir+"/*.css") + - setup(packages = packages, # xxx somehow this does not seem to show up in debian packaging scripts = [ 'apache/unfold-init-ssl.sh' ],