LDAP integration: change name/email/password/keys -- Guilherme Iecker
[myslice.git] / portal / templates / fibre / fibre_registration_view.html
1 {% extends "layout.html" %}
2
3 {% block content %}        
4
5 <div class="row">
6         <div class="col-md-12">
7         <h1><img src="{{ STATIC_URL }}icons/user-xs.png" alt="User Registration" />User sign-up</h1>
8         </div>
9 </div>
10 <div class="row">
11         <div class="col-md-12">
12                 <p><strong>Questions? <a href="/portal/contact" >Contact us.</a></strong></p>
13   </div>
14 </div>
15 {% if errors %}
16 <ul>
17   {% for error in errors %}
18   <li>{{ error }}</li>
19   {% endfor %}
20 </ul>
21 {% endif %}
22
23
24 <form action="/register" class="cmxform form-horizontal" method="post" enctype="multipart/form-data">
25 <div class="row">
26         
27         <div class="col-md-12">
28                         
29                         <div class="form-group">
30                                 {% csrf_token %}
31                                 <label for="authority_hrn" class="control-label">Organization</label>
32                                 <p></p>
33                                 <input id="authority_hrn" name="org_name" class="form-control" style="width:590px" value="{{ organization }}" 
34                                 title="Choose your organization (company/university) from the list that apears when you click in the field and start to type.
35                                  Use the arrow keys to scroll through the list; type part of the name to narrow down the list. If it is not in the list, 
36                                 please choose the FIBRE organization. We will send an email to the managers that we have on record for
37                                 your organization, asking them to validate your sign-up request." required />
38                                 <p></p>
39                                 <!-- <p>Organization not listed? <a href="/portal/join">Request its addition now.</a></p> -->
40                         </div>
41         </div>
42 </div>
43
44 <div class="row">
45         <div class="col-md-6">
46         
47             <div class="form-group">
48                         <label for="firstname" class="control-label">Personal information</label>
49                         <p></p>
50                         <input type="text" name="firstname" class="form-control" style="width:350px" minlength="2" value="{{ first_name }}" placeholder="First name" required />
51             </div>
52             <div class="form-group">
53                         <input type="text" name="lastname" size="25" class="form-control" style="width:350px" minlength="2" value="{{ last_name }}" placeholder="Last name" required />
54             </div>
55                 <div class="form-group">
56                 <input type="email" name="email" size="25"  class="form-control" style="width:350px" value="{{ email }}" 
57                         title="Your e-mail address will be your identifier for logging in. We contact you to verify your account and then, occasionally, for important issues."
58                         placeholder="Email" required />
59                 </div>
60                 <div class="form-group">
61                         <label for="Reasons" class="control-label" >Reasons for Applying</label>
62                         <p></p>
63                         <textarea type="text" rows="4" cols="70" name="reasons" size="25" class="form-control" style="width:350px;height:60px"  minlength="5" maxlength="250" value="{{reasons}}" placeholder="Reasons for applying" title="Identify yourself and tell us more about your expectations to use the testbed." required ></textarea>
64                 </div>
65         </div>  
66
67         <div class="col-md-6">
68             <div class="form-group">
69               <label for="password" class="control-label">Authentication</label>
70                   <p></p>       
71                         <input type="text" name="username" size="25" class="form-control" style="width:350px" minlength="5" value="{{ username }}" placeholder="Username" required />
72             </div>
73             <div class="form-group">
74                         <input type="password"  id="password" name="password"   class="form-control" style="width:250px" minlength="4" value="{{ password }}" 
75                         title="Your password allows you to log in to this portal."
76                         placeholder="Password" required />      
77             </div>
78             <div class="form-group">
79                         <input type="password"  id="confirmpassword" name="confirmpassword" style="width:250px"  minlength="4" class="form-control" value="" 
80                                 placeholder="Confirm password" required />
81             </div>
82             <div class="form-group">
83                         <select name="question" class="form-control" style="width:350px" id="key-policy" 
84                                 title="Your public/private key pair allows you to access the testbeds." required >        
85                                 <option value="generate">Generate my keys for me (recommended)</option>
86                                 <option value="upload">Upload my public key (advanced users only)</option>
87                         </select>
88             </div>
89             <div class="form-group" style="display:none;" id="upload_key">
90                 <label for="file" class="control-label">Upload public key</label>
91                 <input type="file" name="user_public_key" class="form-control" style="width:200px" id="user_public_key" />
92                 <br />
93                         <div class="alert alert-danger" id="pkey_del_msg">
94                                 In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to 
95                                 <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">delegate your public key to the portal.</a>
96                         </div>
97             </div>
98         </div>
99 </div>
100 <div class="row">
101         <div class="col-md-12">
102                 <div class="form-group">
103                         <p></p>
104                         <input type="checkbox" name="agreement" value="agreement" required />&nbsp;&nbsp; I agree to the 
105                         <a href="#" data-toggle="modal" data-target="#myModal">terms and conditions.</a> 
106                 </div>
107         </div>
108 </div>
109 <div class="row">
110         <div class="col-md-12">
111                 <div class="form-group" id="register">
112                         <p></p> 
113                 <input class="submit btn btn-onelab" type="submit" value="Request My Account" />
114
115             </div>
116         </div>
117 </div>
118 </form>
119
120         <!-- Modal - columns selector -->
121 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
122                         <div class="modal-dialog">
123                         <div class="modal-content">
124                                 <div class="modal-header">
125                                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
126                                                 <h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
127                                 </div>
128                                 <div class="modal-body">
129                                                 <p align="left">
130                                         Fibre: Future Internet testbeds experimentation between Brazil and Europe
131                                         <br/>
132                                                 <a href="/portal/terms" target="_blank">[Printable format]</a>
133                                                 </p>
134                     <p align="justify">
135                     By registering as a FIBRE-BR testbed user, experimenters shall be deemed to accept these conditions of use:
136                     </p>
137                    <ol style="text-align:justify">
138                                         <li>
139                         Users shall not use the testbed resources for any unlawful purpose and not (attempt to) breach or circumvent any administrative or security controls.
140                     </li><br/>
141                                         <li>
142                         Users shall respect intellectual property and confidentiality agreements.
143                     </li><br/>
144                                         <li>
145                         Users shall protect their access credentials (e.g. private keys or passwords).
146                     </li><br/>
147                                         <li>
148                         User access credentials will expire 1 year after your registration. Users can renew your registration at any time after the expiry date.
149                     </li><br/>
150                                         <li>
151                         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).
152                     </li><br/>
153                                         <li>
154                         Users must notify the NOC of any changes to their Registration Information.
155                     </li><br/>
156                                         <li>
157                         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.
158                     </li><br/>
159                                         <li>
160                         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.
161                     </li><br/>
162                                         <li>
163                         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.
164                     </li><br/>
165                                         <li>
166                         Users are liable for the consequences of their violation of any of these conditions of use.
167                     </li><br/>
168                    </ol>
169                                 </div>
170                                 <div class="modal-footer">
171                                         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
172                                 </div>
173                         </div>
174                         </div>
175 </div>
176
177     
178 <script>
179 $(document).ready(function(){
180     var availableTags = [
181     {% if authorities %}
182         {% for authority in authorities %}
183             {% if authority.name %}
184                 {value:"{{ authority.name }}",label:"{{authority.name}}"},
185             {% else %}
186                 {% if authority.authority_hrn == "fibre.ufrj" %}
187                         {value:"{{ authority.authority_hrn }}",label:"UFRJ - UNIVERSIDADE FEDERAL DO RIO DE JANEIRO"},
188                 {% else %}
189                       {% if authority.authority_hrn == "fibre.ufg" %}
190                               {value:"{{ authority.authority_hrn }}",label:"UFG - UNIVERSIDADE FEDERAL DE GOIAS"},
191                       {% else %}
192                               {% if authority.authority_hrn == "fibre.uff" %}
193                                      {value:"{{ authority.authority_hrn }}",label:"UFF - UNIVERSIDADE FEDERAL FLUMINENSE"},
194                               {% else %}
195                                      {% if authority.authority_hrn == "fibre.ufpa" %}
196                                              {value:"{{ authority.authority_hrn }}",label:"UFPA - UNIVERSIDADE FEDERAL DO PARA"},
197                                      {% else %}
198                                              {% if authority.authority_hrn == "fibre.ufpe" %}
199                                                      {value:"{{ authority.authority_hrn }}",label:"UFPE - UNIVERSIDADE FEDERAL DE PERNAMBUCO"},
200                                              {% else %}
201                                                      {% if authority.authority_hrn == "fibre.ufscar" %}
202                                                             {value:"{{ authority.authority_hrn }}",label:"UFSCAR - UNIVERSIDADE FEDERAL DE SAO CARLOS"},
203                                                      {% else %}
204                                                             {% if authority.authority_hrn == "fibre.unifacs" %}
205                                                                      {value:"{{ authority.authority_hrn }}",label:"UNIFACS - UNIVERSIDADE SALVADOR"},
206                                                             {% else %}
207                                                                      {% if authority.authority_hrn == "fibre.usp" %}
208                                                                             {value:"{{ authority.authority_hrn }}",label:"USP - UNIVERSIDADE DE SAO PAULO"},
209                                                                      {% else %}
210                                                                             {% if authority.authority_hrn == "fibre.cpqd" %}
211                                                                                     {value:"{{ authority.authority_hrn }}",label:"CPQD - CENTRO DE PESQUISA E DESENVOLVIMENTO EM TELECOMUNICACOES"},
212                                                                             {% else %}
213                                                                                     {% if authority.authority_hrn == "fibre.rnp" %}
214                                                                                              {value:"{{ authority.authority_hrn }}",label:"(Catch-all) RNP - REDE NACIONAL DE ENSINO E PESQUISA"},
215                                                                                     {% else %}
216                                                                                         {% if authority.authority_hrn == "fibre.i2cat" %}
217                                                                                                 {value:"{{ authority.authority_hrn }}",label:"I2CAT - FOUNDATION, RESEARCH AND INNOVATION IN THE INTERNET AREA"},
218                                                                                         {% else %}
219                                                                                                 {% if authority.authority_hrn == "fibre.uth" %}
220                                                                                                          {value:"{{ authority.authority_hrn }}",label:"UTH - UNIVERSITY OF THESSALY"},
221                                                                                                 {% else %}
222                                                                                                       {% if authority.authority_hrn == "fibre.bristol" %}
223                                                                                                              {value:"{{ authority.authority_hrn }}",label:"UNIBRIS - UNIVERSITY OF BRISTOL"},
224                                                                                                        {% else %}
225                                                                                                              {% if authority.authority_hrn == "fibre.upmc" %}
226                                                                                                                     {value:"{{ authority.authority_hrn }}",label:"UPMC - UNIVERSITE PIERRE ET MARIE CURIE"},
227                                                                                                              {% else %}
228                                                                                                                     {value:"{{ authority.authority_hrn }}",label:"FIBRE"},
229                                                                                                                 {% endif %}
230                                                                                                 {% endif %}
231                                                                                         {% endif %}
232                                                                                 {% endif %}
233                                                                             {% endif %}
234                                                                          {% endif %}
235                                                                      {% endif %}
236                                                             {% endif %}
237                                                     {% endif %}
238                                              {% endif %}
239                                     {% endif %}
240                               {% endif %}
241                       {% endif %}
242                 {% endif %}
243             {% endif %}
244         {% endfor %}    
245     {% else %}
246         {value:"",label:"No authority found !!!"}
247     {% endif %}
248     ];
249         // sorting the list
250         availableTags.sort(function(a,b){
251                 var nameA=a.value.toLowerCase(), nameB=b.value.toLowerCase();
252                 if (nameA < nameB) {
253                 return -1;
254                 }
255                 if (nameA > nameB) {
256                 return 1;
257                 }
258         return 0;
259         }); 
260         // auto-complete the form
261     $( "#authority_hrn" ).autocomplete({
262       source: availableTags,
263       minLength: 0,
264       change: function (event, ui) {
265           if(!ui.item){
266               //http://api.jqueryui.com/autocomplete/#event-change -
267               // The item selected from the menu, if any. Otherwise the property is null
268               //so clear the item for force selection
269               jQuery("#authority_hrn").val("");
270           }
271       }
272       //select: function( event, ui ) {console.log(jQuery(this))}
273     });
274         // for hover texts
275         $('[title!=""]').qtip();
276         $("form").validate();
277         $("form").submit(function() {
278                 if ($('select option:selected').val() == 'upload') {
279                         if ($('input[name=user_public_key]').val() == '') {
280                                 alert('Please specify the key file to upload');
281                                 return false;
282                         }
283                 }
284         });
285 });
286 </script>
287 {% endblock %}
288