Merge branch 'fibre' of ssh://git.onelab.eu/git/myslice into fibre
authorLoic Baron <loic.baron@lip6.fr>
Fri, 25 Jul 2014 18:31:07 +0000 (15:31 -0300)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 25 Jul 2014 18:31:07 +0000 (15:31 -0300)
12 files changed:
portal/actions.py
portal/templates/fibre/fibre_activate_user.html [new file with mode: 0644]
portal/templates/fibre/fibre_activate_user.txt [new file with mode: 0644]
portal/templates/fibre/fibre_activate_user_email_subject.txt [new file with mode: 0644]
portal/templates/fibre/fibre_email_default_sender.txt [new file with mode: 0644]
portal/templates/fibre/fibre_registration_view.html
portal/templates/fibre/fibre_slice_request_email.html [new file with mode: 0644]
portal/templates/fibre/fibre_slice_request_email.txt [new file with mode: 0644]
portal/templates/fibre/fibre_slice_request_email_subject.txt [new file with mode: 0644]
portal/templates/fibre/fibre_user_request_email.html
portal/templates/fibre/fibre_user_request_email.txt
portal/templates/fibre/fibre_user_request_email_subject.txt [new file with mode: 0644]

index 5f17385..689e0f1 100644 (file)
@@ -153,6 +153,10 @@ def manifold_add_user(wsgi_request, request):
         ?
     
     """
+
+    authority_hrn = request['authority_hrn']
+    request['authority_hrn'] = authority_hrn.split(".")[0]
+
     USER_CONFIG = '{"firstname": "%(first_name)s", "lastname": "%(last_name)s", "authority": "%(authority_hrn)s"}'
 
     user_params = {
@@ -162,6 +166,8 @@ def manifold_add_user(wsgi_request, request):
         'status'    : 1,
     }
 
+    request['authority_hrn'] = authority_hrn
+
     query = Query.create('local:user').set(user_params).select('email')
     results = execute_admin_query(request, query)
     if not results:
@@ -473,7 +479,11 @@ def create_pending_slice(wsgi_request, request, email):
         subject = render_to_string(theme.template, request)
         subject = subject.replace('\n', '')
     
-        sender = email
+        theme.template_name = 'email_default_sender.txt'
+        sender =  render_to_string(theme.template, request)
+        sender = sender.replace('\n', '')
+
+        #sender = email
         msg = EmailMultiAlternatives(subject, text_content, sender, recipients)
         msg.attach_alternative(html_content, "text/html")
         msg.send()
@@ -560,7 +570,7 @@ def sfa_create_user(wsgi_request, request):
     else:
         subject = 'User validated'
         msg = 'A manager of your institution has validated your account. You have now full user access to the portal.'
-        send_mail(subject, msg, 'support@onelab.eu',[request['email']], fail_silently=False)       
+        send_mail(subject, msg, 'support@fibre.org.br',[request['email']], fail_silently=False)       
     return results
 
 def ldap_create_user(wsgi_request, request, user_detail):
@@ -819,7 +829,10 @@ def create_pending_user(wsgi_request, request, user_detail):
     try:
         # Send an email: the recipients are the PI of the authority
         # If No PI is defined for this Authority, send to a default email (different for each theme)
-        recipients = authority_get_pi_emails(wsgi_request, request['authority_hrn'])
+
+        split_authority_hrn = request['authority_hrn'].split(".")[0]
+
+        recipients = authority_get_pi_emails(wsgi_request, split_authority_hrn)
         
         theme.template_name = 'user_request_email.html'
         html_content = render_to_string(theme.template, request)
diff --git a/portal/templates/fibre/fibre_activate_user.html b/portal/templates/fibre/fibre_activate_user.html
new file mode 100644 (file)
index 0000000..3593639
--- /dev/null
@@ -0,0 +1,28 @@
+<img src="https://146.164.47.246:27486/static/img/fibre-logo.gif" width="217" height="100">
+<br>
+<p>We have received a user signup request for your email address at {{current_site}}</p>
+<p>You have the following user details:</p>
+
+Organization: {{organization}}<br>
+First name: {{first_name}}<br>
+Last name: {{last_name}}<br>
+Email: {{email}}<br>
+
+<p></p>
+<p>
+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:
+</p>
+
+<ul>
+<li>1. You confirm that you have indeed made this request by clicking on the following link: <br>
+       <a href={{validation_link}}>{{validation_link}}</a> 
+               <ul><li>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.</li></ul>
+</li>
+<li>
+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.
+</li>
+</ul>
+<p>
+We look forward to welcoming you to Myslice. You will find answers to frequently asked questions <a href="https://{{current_site}}/portal/support/">here</a>. 
+Please don't hesitate to <a href="https://{{current_site}}/portal/contact/">contact us</a> with any additional questions that you might have.
+</p>
diff --git a/portal/templates/fibre/fibre_activate_user.txt b/portal/templates/fibre/fibre_activate_user.txt
new file mode 100644 (file)
index 0000000..0d3253a
--- /dev/null
@@ -0,0 +1,24 @@
+We have received a user signup request for your email address at {{current_site}}
+
+You have the following user details:
+
+Organization: {{organization}}
+First name: {{first_name}}
+Last name: {{last_name}}
+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:
+
+               {{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.
+
+We look forward to welcoming you to Myslice. 
+Please don't hesitate to contact us at support@fibre.org.br with any additional questions that you might have.
+
+
+
diff --git a/portal/templates/fibre/fibre_activate_user_email_subject.txt b/portal/templates/fibre/fibre_activate_user_email_subject.txt
new file mode 100644 (file)
index 0000000..0e76f7c
--- /dev/null
@@ -0,0 +1 @@
+{{current_site}} Portal user email activation
diff --git a/portal/templates/fibre/fibre_email_default_sender.txt b/portal/templates/fibre/fibre_email_default_sender.txt
new file mode 100644 (file)
index 0000000..32008b9
--- /dev/null
@@ -0,0 +1 @@
+support@fibre.org.br
index 474a1b8..4b57f8b 100644 (file)
@@ -164,7 +164,11 @@ $(document).ready(function(){
             {% if authority.name %}
                 {value:"{{ authority.name }}",label:"{{authority.name}}"},
             {% else %}
-                {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"},
+               {% if authority.authority_hrn == "fibre.ufrj" %}
+                       {value:"{{ authority.authority_hrn }}",label:"UNIVERSIDADE FEDERAL DO RIO DE JANEIRO"},
+               {% else %}
+                       {value:"{{ authority.authority_hrn }}",label:"FIBRE"},
+               {% endif %}
             {% endif %}
         {% endfor %}    
     {% else %}
diff --git a/portal/templates/fibre/fibre_slice_request_email.html b/portal/templates/fibre/fibre_slice_request_email.html
new file mode 100644 (file)
index 0000000..fd140d7
--- /dev/null
@@ -0,0 +1,11 @@
+<img src="https://146.164.47.246:27486/static/img/fibre-logo.gif" width="217" height="100">
+<br>
+<h1>NEW SLICE REQUEST</h1>
+<br>
+<b>Slice name      :</b> {{slice_name}}</br>
+<b>URL                            :</b> {{exp_url}}</br>
+<b>Purpose         :</b> {{purpose}}</br>
+<b>Organization           :</b> {{organization}}</br>
+<b>Email           :</b> {{email}}</br>
+<b>Portal url     :</b> {{current_site}}</br> 
+
diff --git a/portal/templates/fibre/fibre_slice_request_email.txt b/portal/templates/fibre/fibre_slice_request_email.txt
new file mode 100644 (file)
index 0000000..c8a51b5
--- /dev/null
@@ -0,0 +1,9 @@
+NEW SLICE REQUEST
+
+Slice name      : {{slice_name}}
+URL                    : {{exp_url}}
+Purpose         : {{purpose}}
+Email           : {{email}}
+Organization   : {{organization}}
+Portal url             : {{current_site}}
+
diff --git a/portal/templates/fibre/fibre_slice_request_email_subject.txt b/portal/templates/fibre/fibre_slice_request_email_subject.txt
new file mode 100644 (file)
index 0000000..e3988df
--- /dev/null
@@ -0,0 +1 @@
+Slice request submitted 
index fa0e896..5a4c7eb 100644 (file)
@@ -1,9 +1,9 @@
-<img src="https://onelab.eu/templates/onelab2/images/logo.png">
+<img src="https://146.164.47.246:27486/static/img/fibre-logo.gif" width="217" height="100">
 <br>
 <h1>NEW USER REQUEST</h1>
 <br>
-<p>You are receiving this request because we have you listed as a manager at an organization that uses OneLab.</p> 
-<p>If you believe that you have received this message in error, or if you have any questions, kindly contact support@onelab.eu.</p>
+<p>You are receiving this request because we have you listed as a manager at an organization that uses Myslice portal.</p> 
+<p>If you believe that you have received this message in error, or if you have any questions, kindly contact support@fibre.org.br.</p>
 <br>
 <b>First name   :</b> {{first_name}}<br>
 <b>Last name    :</b> {{last_name}}<br>
@@ -14,5 +14,5 @@
 <b>User hrn     :</b> {{user_hrn}}<br>
 <b>Portal url  :</b> {{ current_site }}<br>
 <p></p>
-<p>You can validate the user <a href="http://{{current_site}}/portal/validate">here</a>.<p>
-<p>Please note that the validation request will only become visible to you on the OneLab portal once the user has confirmed his/her email address.</p>
+<p>You can validate the user <a href="https://{{current_site}}/portal/validate">here</a>.<p>
+<p>Please note that the validation request will only become visible to you on the Myslice portal once the user has confirmed his/her email address.</p>
index b782e71..e3a0418 100644 (file)
@@ -1,7 +1,7 @@
 NEW USER REQUEST
 
-You are receiving this request because we have you listed as a manager at an organization that uses OneLab
-If you believe that you have received this message in error, or if you have any questions, kindly contact support@onelab.eu.
+You are receiving this request because we have you listed as a manager at an organization that uses Myslice portal
+If you believe that you have received this message in error, or if you have any questions, kindly contact support@fibre.org.br.
 
 First name   : {{first_name}}
 Last name    : {{last_name}} 
@@ -12,8 +12,8 @@ Email        : {{email}}
 User hrn     : {{user_hrn}}
 Portal url   : {{ current_site }}
 
-You can validate the user here: http://{{current_site}}/portal/validate
+You can validate the user here: https://{{current_site}}/portal/validate
 
-Please note that the validation request will only become visible to you on the OneLab portal once the user has confirmed his/her email address.
+Please note that the validation request will only become visible to you on the Myslice portal once the user has confirmed his/her email address.
 
 
diff --git a/portal/templates/fibre/fibre_user_request_email_subject.txt b/portal/templates/fibre/fibre_user_request_email_subject.txt
new file mode 100644 (file)
index 0000000..a373b60
--- /dev/null
@@ -0,0 +1 @@
+User request submitted