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>
39 <div class="tab-content">
40 <div class="tab-pane active row" id="profile">
42 <div class="col-md-12">
45 <table class="profile">
48 <div><h3>Platform: Myslice</h3></div>
52 <td class="key">Email</td>
54 <span id="emailval" class="value" >{{ person.email }}</span>
55 <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
56 <span class="glyphicon glyphicon-question-sign"></span> Edit
61 <td class="key">Password</td>
63 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
64 <span class="glyphicon glyphicon-edit"></span> Edit
66 <span id="passval"class="value">******** </span>
67 <span class="hide_this" id="span_pass">
68 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
69 <div style='display:none;' id="pass_form">
70 <input type='hidden' value='' /></div>
71 <table id="edit_password">
73 <td>Enter password: </td>
74 <td class="field"> <input type="password" name="password" id="password" /> </td>
77 <td>Confirm password: </td>
79 <input type="password" name="confirmpassword" id="confirmpassword" />
80 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
88 <td class="key">Full Name</td>
90 <span id="nameval" class="value" >{{ fullname }} </span>
91 <span class="hide_this" id="span_name">
92 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
93 <div style='display:none;'><input type='hidden' name='nameform' /></div>
94 <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
95 <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
96 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
98 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
99 <span class="glyphicon glyphicon-edit"></span> Edit
104 <td class="key">Authority</td>
106 <span id="affval" class="value">{{ authority }}</span>
107 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
108 <span class="glyphicon glyphicon-question-sign"></span> Edit
112 {%if 'Enabled' in user_status %}
114 <td class="key">Generate Keys</td>
116 <input type="submit" name="generate" class="btn btn-primary" value="Generate a new Key Pair" id="generate_keypair"
117 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
118 title="It will generate a new key Pair and your current credentials will be overwritten."/>
122 <td class="key">Public Key</td>
124 <span id="keyval" class="value">******** </span>
125 <span class="hide_this" id="span_upload">
126 <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
127 <div style='display:none;'>
128 <input type='hidden' name='upload' /></div>
129 <input type="file" name="pubkey" class="required" id="pubkey"/>
130 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
131 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
133 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
134 <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';">
135 <span class="glyphicon glyphicon-download"></span> Download
137 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
138 <span class="glyphicon glyphicon-upload"></span> Upload
142 <tr class="even" id="pkey_row">
143 {%if 'N/A' not in user_private_key%}
144 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
145 <td class="value">********<a href="#"></a>
146 <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';">
147 <span class="glyphicon glyphicon-download"></span> Download
149 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
150 onclick="javascript:document.getElementById('button_value').value='delete'; return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
153 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
154 <td class="value">********<a href="#"></a>
155 <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey" value="dl_pkey">
156 <span class="glyphicon glyphicon-download"></span> Download
158 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
162 <tr class="even" id="sfi_config_row">
163 <td class="key">sfi_config </td>
164 <td class="value">use sfi_config file with sfi.py package (pip install sfa)<a href="#"></a>
165 <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';">
166 <span class="glyphicon glyphicon-download"></span> Download
171 {%if 'N/A' not in user_private_key%}
172 <td class="key">Identity</td>
174 <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';">
175 <span class="glyphicon glyphicon-download"></span> Download
179 <td class="key">Identity</td>
181 <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_identity">
182 <span class="glyphicon glyphicon-download"></span> Download
191 <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
192 Trade-off between ease-of-use & security</p>
202 <div class="tab-pane row" id="account">
203 <div class="col-md-12">
205 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
206 <table class="table">
209 <th>Account Type</th>
210 <th>Account Delegation</th>
213 <!--<th>Pub Key</th> -->
215 {% for row in principal_acc %}
216 <tr class="border_bottom">
217 <td class="odd"> {{ row.platform_name }} </td>
218 <td class="odd"> {{ row.account_type }} </td>
219 <td class="odd"> {{ row.delegation_type }} </td>
220 <td class="odd"> {{ row.usr_hrn }} </td>
221 <td class="odd"> {{ row.user_status }} </td>
222 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
229 {%if 'Enabled' in user_status %}
230 <div class="col-md-12">
231 <h3>Credentials <small>Delegated to Principal Account</small></h3>
232 <table class="table">
233 <caption><b>Delegated User Credential</b></caption>
235 <th>Expiration Date</th>
238 {% for row in my_users %}
239 <tr class="border_bottom">
240 <td class="odd"> {{ row.cred_exp }} </td>
242 <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';">
243 <span class="glyphicon glyphicon-download"></span> Credential
245 <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';">
246 <span class="glyphicon glyphicon-download"></span> Certificate
248 <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';">
249 <span class="glyphicon glyphicon-download"></span> PKCS p12
256 <table class="mytable table table-bordered table-hover">
257 <caption><b>Delegated Slice Credentials</b></caption>
260 <th>Expiration Date</th>
263 {% for row in my_slices %}
264 <tr class="border_bottom">
265 <td class="odd"> {{ row.slice_name }} </td>
266 <td class="odd"> {{ row.cred_exp }} </td>
268 <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}}';">
269 <span class="glyphicon glyphicon-download"></span> Download
276 <table class="mytable table table-bordered table-hover">
277 <caption><b>Delegated Authority Credentials</b></caption>
279 <th>Authority Name</th>
280 <th>Expiration Date</th>
283 {% for row in my_auths %}
284 <tr class="border_bottom">
285 <td class="odd"> {{ row.auth_name }} </td>
286 <td class="odd"> {{ row.cred_exp }} </td>
288 <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}}';">
289 <span class="glyphicon glyphicon-download"></span> Download
296 {%if '' not in my_users%}
297 <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>
299 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
308 $(document).ready(function() {
309 {%if 'no_creds' in user_cred or 'creds_expired' in user_cred %}
310 localStorage.clear();
311 $.post("/cache/clear/", function( data ) {
314 $('.nav-tabs a').click(function (e) {
317 id = $(this).attr('href').substr(1);
320 $('button#createslice').click(function() {
321 window.location="/portal/slice_request/";