1 {% extends "layout.html" %}
2 {% load portal_filters %}
4 {% widget "_widget-no_credentials.html" %}
5 {% widget "_widget-tradeoff.html" %}
7 <div class="col-md-12">
8 <div class="breadcrumbs">
9 Account > <a href="/account">{{ person.email }}</a>
12 {%if 'no_creds' in user_cred %}
13 <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
15 {%if 'creds_expired' in user_cred %}
16 <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
22 {% for message in messages %}
23 <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
28 <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
29 <input type="hidden" id="button_value" name="button_value" value="" />
32 <div class="col-md-12">
33 <ul class="nav nav-tabs nav-section">
34 <li class="active"><a href="#profile">User Profile</a></li>
35 <li><a href="#account">Account</a></li>
36 <li><a href="#access">Testbed Access</a></li>
40 <div class="tab-content">
41 <div class="tab-pane active row" id="profile">
43 <div class="col-md-12">
46 <table class="profile">
49 <div><h3>Platform: Myslice</h3></div>
53 <td class="key">Email</td>
55 <span id="emailval" class="value" >{{ person.email }}</span>
56 <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
57 <span class="glyphicon glyphicon-question-sign"></span> Edit
62 <td class="key">Password</td>
64 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
65 <span class="glyphicon glyphicon-edit"></span> Edit
67 <span id="passval"class="value">******** </span>
68 <span class="hide_this" id="span_pass">
69 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
70 <div style='display:none;' id="pass_form">
71 <input type='hidden' value='' /></div>
72 <table id="edit_password">
74 <td>Enter password: </td>
75 <td class="field"> <input type="password" name="password" id="password" /> </td>
78 <td>Confirm password: </td>
80 <input type="password" name="confirmpassword" id="confirmpassword" />
81 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
89 <td class="key">Full Name</td>
91 <span id="nameval" class="value" >{{ fullname }} </span>
92 <span class="hide_this" id="span_name">
93 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
94 <div style='display:none;'><input type='hidden' name='nameform' /></div>
95 <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
96 <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
97 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
99 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
100 <span class="glyphicon glyphicon-edit"></span> Edit
105 <td class="key">Authority</td>
107 <span id="affval" class="value">{{ authority }}</span>
108 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
109 <span class="glyphicon glyphicon-question-sign"></span> Edit
113 {%if 'Enabled' in user_status %}
115 <td class="key">Generate Keys</td>
117 <input type="submit" name="generate" class="btn btn-primary" value="Generate a new Key Pair" id="generate_keypair"
118 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
119 title="It will generate a new key Pair and your current credentials will be overwritten."/>
123 <td class="key">Public Key</td>
125 <span id="keyval" class="value">******** </span>
126 <span class="hide_this" id="span_upload">
127 <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
128 <div style='display:none;'>
129 <input type='hidden' name='upload' /></div>
130 <input type="file" name="pubkey" class="required" id="pubkey"/>
131 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
132 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
134 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
135 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_pubkey" onclick="javascript:document.getElementById('button_value').value='dl_pubkey';">
136 <span class="glyphicon glyphicon-download"></span> Download
138 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
139 <span class="glyphicon glyphicon-upload"></span> Upload
143 <tr class="even" id="pkey_row">
144 {%if 'N/A' not in user_private_key%}
145 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
146 <td class="value">********<a href="#"></a>
147 <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey" value="dl_pkey" onclick="javascript:document.getElementById('button_value').value='dl_pkey';">
148 <span class="glyphicon glyphicon-download"></span> Download
150 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
151 onclick="javascript:document.getElementById('button_value').value='delete'; return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
154 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
155 <td class="value">********<a href="#"></a>
156 <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey" value="dl_pkey">
157 <span class="glyphicon glyphicon-download"></span> Download
159 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
163 <tr class="even" id="sfi_config_row">
164 <td class="key">sfi_config </td>
165 <td class="value">use sfi_config file with sfi.py package (pip install sfa)<a href="#"></a>
166 <button type="submit" name="dl_sfi_config" class="btn btn-default btn-xs" title="Download your sfi_config" id="dl_sfi_config" value="dl_sfi_config" onclick="javascript:document.getElementById('button_value').value='dl_sfi_config';">
167 <span class="glyphicon glyphicon-download"></span> Download
172 {%if 'N/A' not in user_private_key%}
173 <td class="key">Identity</td>
175 <button type="submit" name="dl_identity" class="btn btn-default btn-xs" title="You will require it to use jfed" id="dl_identity" onclick="javascript:document.getElementById('button_value').value='dl_identity';">
176 <span class="glyphicon glyphicon-download"></span> Download
180 <td class="key">Identity</td>
182 <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_identity">
183 <span class="glyphicon glyphicon-download"></span> Download
192 <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
193 Trade-off between ease-of-use & security</p>
203 <div class="tab-pane row" id="account">
204 <div class="col-md-12">
206 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
207 <table class="table">
210 <th>Account Type</th>
211 <th>Account Delegation</th>
214 <!--<th>Pub Key</th> -->
216 {% for row in principal_acc %}
217 <tr class="border_bottom">
218 <td class="odd"> {{ row.platform_name }} </td>
219 <td class="odd"> {{ row.account_type }} </td>
220 <td class="odd"> {{ row.delegation_type }} </td>
221 <td class="odd"> {{ row.usr_hrn }} </td>
222 <td class="odd"> {{ row.user_status }} </td>
223 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
230 {%if 'Enabled' in user_status %}
231 <div class="col-md-12">
232 <h3>Credentials <small>Delegated to Principal Account</small></h3>
233 <table class="table">
234 <caption><b>Delegated User Credential</b></caption>
236 <th>Expiration Date</th>
239 {% for row in my_users %}
240 <tr class="border_bottom">
241 <td class="odd"> {{ row.cred_exp }} </td>
243 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential" onclick="javascript:document.getElementById('button_value').value='dl_user_cred';">
244 <span class="glyphicon glyphicon-download"></span> Credential
246 <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate" onclick="javascript:document.getElementById('button_value').value='dl_user_cert';">
247 <span class="glyphicon glyphicon-download"></span> Certificate
249 <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12" onclick="javascript:document.getElementById('button_value').value='dl_user_p12';">
250 <span class="glyphicon glyphicon-download"></span> PKCS p12
257 <table class="mytable table table-bordered table-hover">
258 <caption><b>Delegated Slice Credentials</b></caption>
261 <th>Expiration Date</th>
265 {% for row in my_slices %}
266 <tr class="border_bottom">
267 <td class="odd"> {{ row.slice_name }} </td>
268 <td class="odd"> {{ row.cred_exp }} </td>
270 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials" onclick="javascript:document.getElementById('button_value').value='dl_{{row.slice_name}}';">
271 <span class="glyphicon glyphicon-download"></span> Download
275 <button class="btn btn-danger btn-xs" name= "del_{{row.slice_name}}" type="submit" title="Download Slice Credentials" onclick="return confirm('Are you sure? If you do so, the slice will be permanently deleted.'); javascript:document.getElementById('button_value').value='del_{{row.slice_name}}';">
276 <span class="glyphicon glyphicon-remove"></span> Delete
283 <table class="mytable table table-bordered table-hover">
284 <caption><b>Delegated Authority Credentials</b></caption>
286 <th>Authority Name</th>
287 <th>Expiration Date</th>
290 {% for row in my_auths %}
291 <tr class="border_bottom">
292 <td class="odd"> {{ row.auth_name }} </td>
293 <td class="odd"> {{ row.cred_exp }} </td>
295 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials" onclick="javascript:document.getElementById('button_value').value='dl_{{row.auth_name}}';">
296 <span class="glyphicon glyphicon-download"></span> Download
303 {%if '' not in my_users%}
304 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials" onclick="javascript:document.getElementById('button_value').value='clear_cred';">Clear Credentials</button></p>
306 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
312 <div class="tab-pane row" id="access">
313 <div class="col-md-12">
315 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
316 <table class="mytable table table-bordered table-hover">
319 <th>Account Type</th>
320 <th>Reference to</th>
321 <th>Remove Account</th>
323 {% for row in ref_acc %}
324 <tr class="border_bottom">
325 <td class="odd"> {{ row.platform_name }} </td>
326 <td class="odd"> {{ row.account_type }} </td>
327 <td class="odd"> {{ row.account_reference }} </td>
329 <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform" onclick="javascript:document.getElementById('button_value').value='delete_{{row.platform_name}}';">
330 <span class="glyphicon glyphicon-minus"></span>
338 <h3>Add reference account to the following testbeds</h3>
339 <table class="mytable table table-bordered table-hover">
344 {% for platform in platform_list %}
345 <tr class="border_bottom">
346 <td class="odd"> {{ platform.platform_no_access }} </td>
348 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform" onclick="javascript:document.getElementById('button_value').value='add_{{platform.platform_no_access}}';">
349 <span class="glyphicon glyphicon-plus"></span>
362 $(document).ready(function() {
363 {%if 'no_creds' in user_cred or 'creds_expired' in user_cred %}
364 localStorage.clear();
365 $.post("/cache/clear/", function( data ) {
368 $('.nav-tabs a').click(function (e) {
371 id = $(this).attr('href').substr(1);
374 $('button#createslice').click(function() {
375 window.location="/portal/slice_request/";