Adding new changes for merge.
authorRezende & Pedro & Carlos & Raphael <rezende@land.ufrj.br>
Fri, 24 Oct 2014 16:58:44 +0000 (14:58 -0200)
committerRezende & Pedro & Carlos & Raphael <rezende@land.ufrj.br>
Fri, 24 Oct 2014 16:58:44 +0000 (14:58 -0200)
portal/actions.py
portal/homeview.py
portal/lsapiclient.py
portal/slicerequestview.py
portal/templates/fibre/fibre_account-view.html
portal/templates/fibre/fibre_institution.html
portal/templates/fibre/fibre_registration_view.html
portal/templates/fibre/fibre_slice_request_email.html
portal/templates/fibre/fibre_termsview.html

index c7ed62b..20a623d 100644 (file)
@@ -593,21 +593,31 @@ def create_slice(wsgi_request, request):
         Exception
     """
     hrn = "%s.%s" % (request['authority_hrn'], request['slice_name'])
+     
     # XXX tmp sfa dependency
     from sfa.util.xrn import Xrn 
     urn = Xrn(hrn, request['type']).get_urn()
     
     # Add User to Slice if we have the user_hrn in pendingslice table
     user_hrn = request.get('user_hrn', None)
+    user_obj = User.objects.get(username = user_hrn.split(".")[1])
+    list_users = []
     user_hrns = list([user_hrn]) if user_hrn else list()
+    for user in user_hrns:
+        list_users +=[User.objects.get(username = user.split(".")[1])] 
+    
+    #user_query  = Query.get('local:user').select('email').filter_by('email','==',user.username)
+    #user_details_sfa = execute_admin_query(wsgi_request, user_query)
+    
+    pendinguser = PendingUser.objects.filter(login__iexact = user_obj.username)    
+    if pendinguser :
+        raise Exception, "User %s doesn't exist, validate user before validating slice" % user_obj.username
+    #if not user_details_sfa:
+    #    raise Exception, "User %s doesn't exist, validate user before validating slice" % user_hrn
+    #for user in list_users:
+     
+    user_email = user_obj.email
     
-    user_query  = Query().get('user').select('user_hrn','user_email').filter_by('user_hrn','==',user_hrn)
-    user_details_sfa = execute_admin_query(wsgi_request, user_query)
-    if not user_details_sfa:
-        raise Exception, "User %s doesn't exist, validate user before validating slice" % user_hrn
-    for user in user_details_sfa:
-        user_email = user['user_email']
-
     # XXX LOIC Quick fix because this is totally inconsistent
     if not 'number_of_nodes' in request:
         request['number_of_nodes']=""
@@ -622,15 +632,16 @@ def create_slice(wsgi_request, request):
         'slice_enabled'    : True
     }
     # ignored in request: id, timestamp,  number_of_nodes, type_of_nodes, purpose
-
+    
     query = Query.create('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)
+        clear_user_creds(wsgi_request,user_obj.username)
         # 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)
index cf3fcba..ddad254 100644 (file)
@@ -65,7 +65,7 @@ class HomeView (FreeAccessView, ThemeView):
        ## first you must open a connection to the server
        try:
                # Connect to NOC
-               l = ldap.initialize("ldap://10.128.0.50:389")
+                l = ldap.initialize("ldap://200.130.15.186:389")
                # Bind/authenticate with a root user to search all objects
                l.simple_bind_s("cn=Manager,dc=br,dc=fibre","fibre2013")
                
index 23584ab..c99ecae 100644 (file)
@@ -16,7 +16,9 @@ class LaboraSchedulerClient:
                      'get_user_id_by_username', 'add_user_public_key', 'delete_user_public_key' ]
 
     def __init__ ( self, organization ):
-       self.url, self.key = self.getOrganizationConfigs( organization )
+       #self.url, self.key = self.getOrganizationConfigs( organization )
+       self.url = "https://portal.ufrj.fibre.org.br:3002/LS-Sched/"
+       self.key = "9763dd03f2da8138fb22a63d78e5e9792b59a637"
 
     def __getattr__(self, name):
         
index 97a11dd..b51273f 100644 (file)
@@ -117,7 +117,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView):
                 'authority_hrn'     : authority_hrn,
                 'organization'      : wsgi_request.POST.get('org_name', ''),
                 'slice_name'        : wsgi_request.POST.get('slice_name', ''),
-                'url'               : wsgi_request.POST.get('url', ''),
+                'url'               : wsgi_request.POST.get('exp_url', ''),
                 'purpose'           : wsgi_request.POST.get('purpose', ''),
                 'current_site'      : current_site
             }
index 9941e97..c802852 100644 (file)
                                                                <div><h3>Platform: Myslice</h3></div>
                                                </td>
                                        </tr>
+                               <!--    <tr>
+                                                <td class="key">Username</td>
+                                                <td class="value">
+                                                                <span id="userval" class="value" >{{ username }}</span>
+                                                </td>
+                                        </tr> -->
                                        <tr>
                                                <td class="key">Email</td>
                                                <td class="value">
index 1d6cf97..87b6dab 100644 (file)
@@ -98,13 +98,10 @@ $(document).ready(function() {
     {% if user_details.parent_authority %}
 
         $.post("/rest/slice/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
-           var username = "{{person.username}}";
             var list_slices = [];
             var table_slices = [];
             /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
             $.each( data, function( key, val ) {
-               if(String(val.users[0]).indexOf("@") != -1){
-               if(String(val.users[0]).split("@")[1] == username.split("@")[1]){
                 list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
                 if(val.nodes=="undefined" || val.nodes==null){
                     nodes_length=0;
@@ -133,8 +130,6 @@ $(document).ready(function() {
                 slice_row += "<td>"+val.slice_expires+"</td>";
                 slice_row += "</tr>";
                 table_slices.push(slice_row);
-               }
-              }
             });
            
             /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
index baa2e25..44b16a7 100644 (file)
                                        <br/>
                                                <a href="/portal/terms" target="_blank">[Printable format]</a>
                                                </p>
-                                       <h1 align="left">1 Context</h1>
-                                       <p align="left">
-                    The main goal of the FIBRE project is the design, implementation and validation of a shared Future Internet research facility, supporting the joint experimentation of European and Brazilian researchers. In order to achieve this goal the project will carry out four main activities:
+                   <p align="justify">
+                    By registering as a FIBRE-BR testbed user, experimenters shall be deemed to accept these conditions of use:
                     </p>
-                                       <p align="left">
-                    The development and operation of a new experimental facility in Brazil, including the setup of equipment to support experimentation with various technologies (fixed layer 2 and layer 3, wireless, optical) as well as the design and implementation of a control framework to automate the use and operation of the testbed.
-                    </p>
-                                       <p align="left">
-                    The development and operation of a Future Internet facility in Europe based on enhancements and the federation of two existing infrastructures: OFELIA and OneLab. Two OFELIA islands (i2CAT and University of Bristol (UNIVBRIS)) and the UTH's NITOS testbed will be enhanced by i) adding more physical resources (servers, OpenFlow-enabled switches and access points) to be able to cope with a bigger number ofusers and different use cases, ii) improving its respective control frameworks (based on the OFELIA control framework and OMF) and iii) adding more manpower to operate the facilities.
-                    </p>
-                                       <p align="left">
-                    The federation of the Brazilian and European experimental facilities, both at the physical connectivity and control framework level, to support the provisioning of slices using resources from both testbeds.
-                    </p>
-<h2>PROCEDURE OVERVIEW</h2>
-<p>If your institution is willing to join the FIBRE Consortium, you are kindly requested to follow the steps below:<br></p>
-<p>1. <a mce_href="http://www.fibre-ict.eu/images/stories/docs/fibre_mou_v0.3.doc" href="http://www.fibre-ict.eu/images/stories/docs/fibre_mou_v0.3.doc">Download the MoU model</a>  to understand the framework of collaboration between your institution and FIBRE project. The content of the MoU shall be discussed in case-by-case basis between the two parties.&nbsp;<span style="line-height: 1.3em;" mce_style="line-height: 1.3em;">&nbsp;</span></p>
-<p>2. Contact the Project office at <a href="mailto:info@fibre.org.br">info@fibre.org.br</a> to schedule a call to clarify all your questions concerning the duties, responsibilities and advantages of joining the FIBRE project.</p>
-<p>3. If your institution understand and agree on the commitment stated in the MoU, please submit the application by editing the <a href="http://www.fibre-ict.eu/images/fibre_mou_v0.2_ff.doc" mce_href="http://www.fibre-ict.eu/images/fibre_mou_v0.2_ff.doc" style="style" mce_style="style">MoU template</a> and sending it to 
- <a href="mailto:info@fibre.org.br">info@fibre.org.br</a></p>
-<p>4. Application Approval: the FIBRE General Assembly will decide based on the application and information gathered during the call. The approval process will normally take around one month.</p><p>5. By mutual agreement of both parties, MoU will be prepared and signed.</p>
-<p><span style="line-height: 1.3em;" mce_style="line-height: 1.3em;">6. Testbed usage / island installation: FIBRE will provide instructions and support to help your institution to carry out the activities described in the MoU.</span></p>
-<p><br></p>
-<p><span style="line-height: 1.3em;" mce_style="line-height: 1.3em;"><a mce_href="http://webconf2.rnp.br/p27egdf20y7/" href="http://webconf2.rnp.br/p27egdf20y7/">Watch the webconference meeting about the MoU details</a><br> (Held on 5/July 2013, in Portuguese)<br></span></p>
-<p><br></p>
+                   <ol style="text-align:justify">
+                                        <li>
+                        Users shall not use the testbed resources for any unlawful purpose and not (attempt to) breach or circumvent any administrative or security controls.
+                    </li><br/>
+                                        <li>
+                        Users shall respect intellectual property and confidentiality agreements.
+                    </li><br/>
+                                        <li>
+                        Users shall protect their access credentials (e.g. private keys or passwords).
+                    </li><br/>
+                                        <li>
+                        User access credentials will expire 1 year after your registration. Users can renew your registration at any time after the expiry date.
+                    </li><br/>
+                                        <li>
+                        Users shall immediately report any known or suspected security breach or misuse of the testbed or access credentials to FIBRE-BR´s Network Operation Centre (a.k.a. NOC).
+                    </li><br/>
+                                        <li>
+                        Users must notify the NOC of any changes to their Registration Information.
+                    </li><br/>
+                                        <li>
+                        Use of the testbed resources is at their own risk. The resources offered by each island are provided “as is”, with no guarantee that the testbed will be available at any time or that it will suit any purpose.
+                    </li><br/>
+                                        <li>
+                        Logged information, including information provided by users for registration purposes, is used for administrative, operational, accounting, monitoring and security purposes only. This information may be disclosed, via secured mechanisms, only for the same purposes and only as far as necessary to other organizations cooperating with the FIBRE-BR testbed. Although efforts are made to maintain confidentiality, no guarantees are given.
+                    </li><br/>
+                                        <li>
+                        The island administrators and resource providers are entitled to regulate, suspend or terminate users’ access, within their domain of authority, and users shall immediately comply with their instructions.
+                    </li><br/>
+                                        <li>
+                        Users are liable for the consequences of their violation of any of these conditions of use.
+                    </li><br/>
+                   </ol>
                                </div>
                                <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
index fd140d7..f053a24 100644 (file)
@@ -3,7 +3,7 @@
 <h1>NEW SLICE REQUEST</h1>
 <br>
 <b>Slice name      :</b> {{slice_name}}</br>
-<b>URL                            :</b> {{exp_url}}</br>
+<b>URL                            :</b> {{number_of_nodes}}</br>
 <b>Purpose         :</b> {{purpose}}</br>
 <b>Organization           :</b> {{organization}}</br>
 <b>Email           :</b> {{email}}</br>
index a82e2b1..7e866aa 100644 (file)
     Fibre: Future Internet testbeds experimentation between Brazil and Europe
     <br/>
 </p>
-<h2 align="left">Context</h2>
-                                       <p align="left">
-                    The main goal of the FIBRE project is the design, implementation and validation of a shared Future Internet research facility, supporting the joint experimentation of European and Brazilian researchers. In order to achieve this goal the project will carry out four main activities:
+                                       <p align="justify">
+                    By registering as a FIBRE-BR testbed user, experimenters shall be deemed to accept these conditions of use:
                     </p>
-                                       <p align="left">
-                    The development and operation of a new experimental facility in Brazil, including the setup of equipment to support experimentation with various technologies (fixed layer 2 and layer 3, wireless, optical) as well as the design and implementation of a control framework to automate the use and operation of the testbed.
-                    </p>
-                                       <p align="left">
-                    The development and operation of a Future Internet facility in Europe based on enhancements and the federation of two existing infrastructures: OFELIA and OneLab. Two OFELIA islands (i2CAT and University of Bristol (UNIVBRIS)) and the UTH's NITOS testbed will be enhanced by i) adding more physical resources (servers, OpenFlow-enabled switches and access points) to be able to cope with a bigger number ofusers and different use cases, ii) improving its respective control frameworks (based on the OFELIA control framework and OMF) and iii) adding more manpower to operate the facilities.
-                    </p>
-                                       <p align="left">
-                    The federation of the Brazilian and European experimental facilities, both at the physical connectivity and control framework level, to support the provisioning of slices using resources from both testbeds.
-                    </p>
-<h2>PROCEDURE OVERVIEW</h2>
-<p>If your institution is willing to join the FIBRE Consortium, you are kindly requested to follow the steps below:<br></p>
-<p>1. <a mce_href="http://www.fibre-ict.eu/images/stories/docs/fibre_mou_v0.3.doc" href="http://www.fibre-ict.eu/images/stories/docs/fibre_mou_v0.3.doc">Download the MoU model</a>  to understand the framework of collaboration between your institution and FIBRE project. The content of the MoU shall be discussed in case-by-case basis between the two parties.&nbsp;<span style="line-height: 1.3em;" mce_style="line-height: 1.3em;">&nbsp;</span></p>
-<p>2. Contact the Project office at <a href="mailto:info@fibre.org.br">info@fibre.org.br</a> to schedule a call to clarify all your questions concerning the duties, responsibilities and advantages of joining the FIBRE project.</p>
-<p>3. If your institution understand and agree on the commitment stated in the MoU, please submit the application by editing the <a href="http://www.fibre-ict.eu/images/fibre_mou_v0.2_ff.doc" mce_href="http://www.fibre-ict.eu/images/fibre_mou_v0.2_ff.doc" style="style" mce_style="style">MoU template</a> and sending it to 
- <a href="mailto:info@fibre.org.br">info@fibre.org.br</a></p>
-<p>4. Application Approval: the FIBRE General Assembly will decide based on the application and information gathered during the call. The approval process will normally take around one month.</p><p>5. By mutual agreement of both parties, MoU will be prepared and signed.</p>
-<p><span style="line-height: 1.3em;" mce_style="line-height: 1.3em;">6. Testbed usage / island installation: FIBRE will provide instructions and support to help your institution to carry out the activities described in the MoU.</span></p>
-<p><br></p>
-<p><span style="line-height: 1.3em;" mce_style="line-height: 1.3em;"><a mce_href="http://webconf2.rnp.br/p27egdf20y7/" href="http://webconf2.rnp.br/p27egdf20y7/">Watch the webconference meeting about the MoU details</a><br> (Held on 5/July 2013, in Portuguese)<br></span></p>
+                  <ol style="text-align:justify">
+                                       <li>
+                       Users shall not use the testbed resources for any unlawful purpose and not (attempt to) breach or circumvent any administrative or security controls.
+                    </li><br/>
+                                       <li>
+                       Users shall respect intellectual property and confidentiality agreements.
+                    </li><br/>
+                                       <li>
+                       Users shall protect their access credentials (e.g. private keys or passwords).
+                    </li><br/>
+                                       <li>
+                       User access credentials will expire 1 year after your registration. Users can renew your registration at any time after the expiry date.
+                   </li><br/>
+                                       <li>
+                       Users shall immediately report any known or suspected security breach or misuse of the testbed or access credentials to FIBRE-BR´s Network Operation Centre (a.k.a. NOC).
+                   </li><br/>
+                                       <li>
+                       Users must notify the NOC of any changes to their Registration Information.
+                    </li><br/>
+                                       <li>
+                       Use of the testbed resources is at their own risk. The resources offered by each island are provided “as is”, with no guarantee that the testbed will be available at any time or that it will suit any purpose.
+                    </li><br/>
+                                       <li>
+                       Logged information, including information provided by users for registration purposes, is used for administrative, operational, accounting, monitoring and security purposes only. This information may be disclosed, via secured mechanisms, only for the same purposes and only as far as necessary to other organizations cooperating with the FIBRE-BR testbed. Although efforts are made to maintain confidentiality, no guarantees are given.
+                    </li><br/>
+                                       <li>
+                       The island administrators and resource providers are entitled to regulate, suspend or terminate users’ access, within their domain of authority, and users shall immediately comply with their instructions.
+                    </li><br/>
+                                       <li>
+                       Users are liable for the consequences of their violation of any of these conditions of use.
+                    </li><br/>
+                  </ol>
+
 <p><br></p>
 <div>
     <div>