Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorJordan Augé <jordan.auge@lip6.fr>
Thu, 6 Mar 2014 14:58:26 +0000 (15:58 +0100)
committerJordan Augé <jordan.auge@lip6.fr>
Thu, 6 Mar 2014 14:58:26 +0000 (15:58 +0100)
portal/registrationview.py
portal/templates/contact.html
portal/templates/documentationview.html
portal/templates/onelab/onelab_home-view.html
portal/templates/password_reset_confirm.html

index 8fd5917..f79b1b5 100644 (file)
@@ -41,14 +41,7 @@ class RegistrationView (FreeAccessView, ThemeView):
         authorities = execute_admin_query(wsgi_request, authorities_query)
         if authorities is not None:
             authorities = sorted(authorities)
-
-        # xxx tocheck - if authorities is empty, it's no use anyway
-        # (users won't be able to validate the form anyway)
-
-        # Who am I ?
-        user_query  = Query().get('local:user').select('user_id','email')
-        user_details = execute_admin_query(wsgi_request, user_query)
-
+        
         # Page rendering
         page = Page(wsgi_request)
         page.add_js_files  ( [ "js/jquery.validate.js", "js/my_account.register.js" ] )
@@ -83,9 +76,18 @@ class RegistrationView (FreeAccessView, ThemeView):
                 errors.append('Email is pending for validation. Please provide a new email address.')
             if UserModel._default_manager.filter(email__iexact = user_request['email']): 
                 errors.append('This email is not usable. Please contact the administrator or try with another email.')
+            # Does the user exist in Manifold?
+            user_query  = Query().get('local:user').select('user_id','email')
+            user_details = execute_admin_query(wsgi_request, user_query)
             for user_detail in user_details:
                 if user_detail['email'] == user_request['email']:
                     errors.append('Email already registered in Manifold. Please provide a new email address.')
+            # Does the user exist in sfa? [query is very slow!!]
+            user_query  = Query().get('user').select('user_hrn','user_email')
+            user_details_sfa = execute_admin_query(wsgi_request, user_query)
+            for user in user_details_sfa:
+                if user['user_email'] == user_request['email']:
+                    errors.append('Email already registered in SFA registry. Please use another email.')
 
             # XXX TODO: Factorize with portal/accountview.py
             if 'generate' in wsgi_request.POST['question']:
index 5660912..fe327a6 100644 (file)
@@ -9,9 +9,10 @@
        <h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> OneLab Support</h1>
 </div>
 <div class="row">
+       <p>Please check our <a href="/portal/support/documentation">FAQ</a> section. Most of the basic problems are explained there.</p>
        <p>
-       If you have any diffculties using the portal, please contact us by filling this form below.<br />
-       You can also <a href="mailto:support@myslice.info">e-mail</a> us directly or consult to our <a target="_blank" href="http://trac.myslice.info/" >documentation</a>
+       If you haven't find your answes in the FAQ, please contact us by filling the form below.<br />
+       You can also <a href="mailto:support@myslice.info">e-mail</a> us directly.
        </p>
 </div>
 
index 5c838d0..00a07f9 100644 (file)
@@ -28,7 +28,26 @@ Manifold is the backend that is running behind the portal.
 <p> More Info: <a href="http://svn.planet-lab.org/wiki/SfaDeveloperRegistryTutorial#RunninginRegistry-Onlymode" target="_blank">SFA Registry</a></p>
 <h2>FAQ<h2>
 <h3>Users</h3>
+<h5>Who is a User?</h5>
+<p>A user is an experimenter who registers to the onelab portal and able to use all the facilites that the portal has to offer. However, a user does not
+have the right to do any admin operation such as managing slices, users and resources.</p>
+<h5>How do I register?</h5>
+<h5>Why can't I register with my email?</h5>
+<h5>Who is responsible for validating my account?</h5>
+<h5>How long I have to wait for validation?</h5>
+<h5>I just registered. Why can't I see any slices and resources?</h5>
+<h5>How can I get access to a slice?</h5>
+<h5>I forgot my password, how to recover it?</h5>
+
 <h3>Managers</h3>
+<h5>Who is a Manager?</h5>
+<p>A manager is the Principal Investigator (PI) of the institution. Each PI has authority over his own institution. A PI can add, delete, validate users or 
+slices that belongs to his institution.</p>
+<h5>What is pending users/slices?</h5>
+<h5>How to see the pending users/slices of my instituion?</h5>
+<h5>How to validate/reject pending users/slices?</h5>
+<h5>Can I see the pending users/slices of other institutions?</h5>
+<h5>How can I manage the users that belong to my institution?</h5>
 </div>
 {% endblock %}
 
index 4915b9e..f3090b2 100644 (file)
@@ -35,7 +35,7 @@
                                </td>
                                <td>
                                {% if person %}
-                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
+                                       <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
                                        <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
                                {% else %}
                                {% endif %}
@@ -73,7 +73,7 @@
                                </td>
                                <td>
                                        {% if person %}
-                                   <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
+                                   <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
                                        {% endif %}
                                </td>
                                <td class="support">
index 8f9d2f7..5701ab1 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "layout.html" %}
 {% block content %}
-
+{% load i18n %}
 {% if validlink %}
 
 <div class="row">