From: Loic Baron Date: Wed, 29 Oct 2014 15:12:15 +0000 (+0100) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.1~13^2~9^2~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5a690e87a71059403fe3872a5a11b437f22f0438;hp=2ab33522a6a0799cb9aaf9a663e3b91a5e4fa2ac;p=myslice.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/README b/README index 4e0b4716..b1f201da 100644 --- a/README +++ b/README @@ -11,7 +11,7 @@ See the devel/ subdir for more devel-oriented doc. ** see devel/django-install.txt in case of trouble $ apt-get install python-django $ apt-get install python-django-south -$ apt-get install python-pip +$ apt-get install python-pip or sudo easy_install pip==1.4.1 $ pip install requests $ pip install djangorestframework * git clone git://git.onelab.eu/myslice.git diff --git a/activity/__init__.py b/activity/__init__.py index d2a9e94f..4719a61c 100644 --- a/activity/__init__.py +++ b/activity/__init__.py @@ -62,9 +62,10 @@ def logWrite(request, action, message, objects = None): "testbed" : None, } - for o in objects : - if (o in log) : - log[o] = objects[o] + if objects is not None: + for o in objects : + if (o in log) : + log[o] = objects[o] try : result = urllib2.urlopen(server, urllib.urlencode(log)) @@ -72,7 +73,8 @@ def logWrite(request, action, message, objects = None): content = result.read() except urllib2.URLError as e: print "===============>> activity: connection to " + server + " impossible, could not log action" - print "==>> " + e.strerror + print e.strerror + print "" def log(request, action, message, objects = None): # Create a new thread in Daemon mode to send the log entry diff --git a/portal/actions.py b/portal/actions.py index 400f3a73..6fde0211 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -612,14 +612,14 @@ def create_slice(wsgi_request, request): } # ignored in request: id, timestamp, number_of_nodes, type_of_nodes, purpose - query = Query.create('slice').set(slice_params).select('slice_hrn') + query = Query.create('myslice:slice').set(slice_params).select('slice_hrn') results = execute_query(wsgi_request, query) if not results: raise Exception, "Could not create %s. Already exists ?" % slice_params['hrn'] else: clear_user_creds(wsgi_request,user_email) # log user activity - activity.slice.validate(self.request, "Slice validation", { "slice" : hrn }) + #activity.slice.validate(request, "Slice validation", { "slice" : hrn }) try: theme.template_name = 'slice_request_validated.txt' text_content = render_to_string(theme.template, request) diff --git a/portal/homeview.py b/portal/homeview.py index 00b279d2..f1ac37cc 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -1,24 +1,25 @@ # this somehow is not used anymore - should it not be ? -from django.core.context_processors import csrf -from django.http import HttpResponseRedirect -from django.contrib.auth import authenticate, login, logout -from django.template import RequestContext -from django.shortcuts import render_to_response -from django.shortcuts import render +from django.core.context_processors import csrf +from django.http import HttpResponseRedirect +from django.contrib.auth import authenticate, login, logout +from django.template import RequestContext +from django.shortcuts import render_to_response +from django.shortcuts import render -import json -from unfold.loginrequired import FreeAccessView +from unfold.loginrequired import FreeAccessView from manifold.core.query import Query from manifoldapi.manifoldapi import execute_query -from manifoldapi.manifoldresult import ManifoldResult -from ui.topmenu import topmenu_items, the_user -from myslice.configengine import ConfigEngine +from manifoldapi.manifoldresult import ManifoldResult +from ui.topmenu import topmenu_items, the_user +from myslice.configengine import ConfigEngine -from myslice.theme import ThemeView +from myslice.theme import ThemeView +from portal.models import PendingSlice +import json import activity.user class HomeView (FreeAccessView, ThemeView): @@ -97,8 +98,13 @@ class HomeView (FreeAccessView, ThemeView): user_cred = 'no_creds' else: user_cred = 'has_creds' + + # list the pending slices of this user + pending_slices = [] + for slices in PendingSlice.objects.filter(type_of_nodes__iexact=self.request.user).all(): + pending_slices.append(slices.slice_name) - + env['pending_slices'] = pending_slices env['pi'] = pi env['user_cred'] = user_cred else: @@ -155,8 +161,13 @@ class HomeView (FreeAccessView, ThemeView): user_cred = 'no_creds' else: user_cred = 'has_creds' - + # list the pending slices of this user + pending_slices = [] + for slices in PendingSlice.objects.filter(type_of_nodes__iexact=self.request.user).all(): + pending_slices.append(slices.slice_name) + + env['pending_slices'] = pending_slices env['pi'] = pi env['user_cred'] = user_cred env['person'] = self.request.user diff --git a/portal/templates/activate_user.html b/portal/templates/activate_user.html index 8f2b0c14..9f165d0e 100644 --- a/portal/templates/activate_user.html +++ b/portal/templates/activate_user.html @@ -15,12 +15,12 @@ You may now log in to the portal using you

diff --git a/portal/templates/activate_user.txt b/portal/templates/activate_user.txt index fd7278fe..a68d1ceb 100644 --- a/portal/templates/activate_user.txt +++ b/portal/templates/activate_user.txt @@ -9,13 +9,13 @@ Email: {{email}} You may now log in to the portal using your email address and the password that you provided, but your access will be limited. To gain full access, two steps are required: - 1. You confirm that you have indeed made this request by clicking on the following link: + 1. You must confirm that you have indeed made this request by clicking on the following link: {{validation_link}} If you did not make this request, we apologise. You may disregard this email or you may advise us the error by replying to this email. - 2. A manager from your organization validates your request. Upon confirmation of your signup request, we will send an email to the managers at your organization with a validation request. + 2. A manager from your organization must also validate your request. Upon confirmation of your signup request, we will send an email to the managers at your organization with a validation request. We look forward to welcoming you to OneLab. Please don't hesitate to contact us at support@onelab.eu with any additional questions that you might have. diff --git a/portal/templates/email_activation.html b/portal/templates/email_activation.html index ce763ba3..d923b9da 100644 --- a/portal/templates/email_activation.html +++ b/portal/templates/email_activation.html @@ -8,17 +8,17 @@

{% if activation_status == 'success' %}

Signup request confirmed.

-

You are currently able to log in to the portal using your email address and the password that you provided, but your access is still limited.

-

You will have full access as soon as your account is validated by a manager at your organization. We have sent an email to the managers with a validation request.

+

You are currently able to log in to the portal using your email address and the password that you have provided; however, your access is still limited.

+

You will have full access as soon as your account is validated by a manager at your organization. We have sent an email to your organisation's managers with a validation request.

{% elif activation_status == 'validated' %}

Account validated.

We have identified you as a valid PLE user. Your OneLab account has automatically been approved.

You have a full access to OneLab testbeds.

{%else%}

Signup confirmation failed.

-

You have probably arrived at this page by clicking a confirmation link in an email that we have sent to you. However, - we have been unable to match the link that you have clicked to a signup request in our database.

-

Please contact support so that we can help you complete the signup process.

+

You have probably arrived at this page by clicking a confirmation link in an email that we have sent to you. + We have been unable to match the link that you have clicked to a signup request in our database.

+

Please contact support so that we may help you complete the signup process.

{%endif%}
diff --git a/portal/templates/onelab/onelab_account-view.html b/portal/templates/onelab/onelab_account-view.html index 199444a3..549ec6b4 100644 --- a/portal/templates/onelab/onelab_account-view.html +++ b/portal/templates/onelab/onelab_account-view.html @@ -154,9 +154,9 @@ -

Tradeoff: Ease-of-use vs Security.
- Ease-of-use: Automatic account delegation. Don't delete private key.
- Security: Manual account delegation. Download & Delete private key. +

+ Automatic vs. Manual delegation of credentials: + Trade-off between ease-of-use & security

@@ -276,24 +276,31 @@ -