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 <div class="col-md-12">
29 <ul class="nav nav-tabs nav-section">
30 <li class="active"><a href="#profile">User Profile</a></li>
31 <li><a href="#account">Account</a></li>
32 <li><a href="#access">Testbed Access</a></li>
36 <div class="tab-content">
37 <div class="tab-pane active row" id="profile">
39 <div class="col-md-12">
41 <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
43 <table class="profile">
46 <div><h3>Platform: Myslice</h3></div>
50 <td class="key">Email</td>
52 <span id="emailval" class="value" >{{ person.email }}</span>
53 <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
54 <span class="glyphicon glyphicon-question-sign"></span> Edit
59 <td class="key">Password</td>
61 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
62 <span class="glyphicon glyphicon-edit"></span> Edit
64 <span id="passval"class="value">******** </span>
65 <span class="hide_this" id="span_pass">
66 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
67 <div style='display:none;' id="pass_form">
68 <input type='hidden' value='' /></div>
69 <table id="edit_password">
71 <td>Enter password: </td>
72 <td class="field"> <input type="password" name="password" id="password" /> </td>
75 <td>Confirm password: </td>
77 <input type="password" name="confirmpassword" id="confirmpassword" />
78 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
86 <td class="key">Full Name</td>
88 <span id="nameval" class="value" >{{ fullname }} </span>
89 <span class="hide_this" id="span_name">
90 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
91 <div style='display:none;'><input type='hidden' name='nameform' /></div>
92 <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
93 <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
94 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
96 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
97 <span class="glyphicon glyphicon-edit"></span> Edit
102 <td class="key">Authority</td>
104 <span id="affval" class="value">{{ authority }}</span>
105 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
106 <span class="glyphicon glyphicon-question-sign"></span> Edit
110 {%if 'Enabled' in user_status %}
112 <td class="key">Generate Keys</td>
114 <input type="submit" name="generate" class="btn btn-primary" value="Generate a new Key Pair" id="generate_keypair"
115 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
116 title="It will generate a new key Pair and your current credentials will be overwritten."/>
120 <td class="key">Public Key</td>
122 <span id="keyval" class="value">******** </span>
123 <span class="hide_this" id="span_upload">
124 <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
125 <div style='display:none;'>
126 <input type='hidden' name='upload' /></div>
127 <input type="file" name="pubkey" class="required" id="pubkey"/>
128 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
129 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
131 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
132 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
133 <span class="glyphicon glyphicon-download"></span> Download
135 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
136 <span class="glyphicon glyphicon-upload"></span> Upload
140 <tr class="even" id="pkey_row">
141 {%if 'N/A' not in user_private_key%}
142 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
143 <td class="value">********<a href="#"></a>
144 <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey">
145 <span class="glyphicon glyphicon-download"></span> Download
147 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
148 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
151 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
152 <td class="value">********<a href="#"></a>
153 <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey">
154 <span class="glyphicon glyphicon-download"></span> Download
156 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
160 <tr class="even" id="sfi_config_row">
161 <td class="key">sfi_config </td>
162 <td class="value">use sfi_config file with sfi.py package (pip install sfa)<a href="#"></a>
163 <button type="submit" name="dl_sfi_config" class="btn btn-default btn-xs" title="Download your sfi_config" id="dl_sfi_config">
164 <span class="glyphicon glyphicon-download"></span> Download
169 {%if 'N/A' not in user_private_key%}
170 <td class="key">Identity</td>
172 <button type="submit" name="dl_identity" class="btn btn-default btn-xs" title="You will require it to use jfed" id="dl_identity">
173 <span class="glyphicon glyphicon-download"></span> Download
177 <td class="key">Identity</td>
179 <button type="submit" name="dl_identity" class="btn btn-default btn-xs disabled" title="You will require it to use jfed" id="dl_identity">
180 <span class="glyphicon glyphicon-download"></span> Download
189 <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
190 Trade-off between ease-of-use & security</p>
200 <div class="tab-pane row" id="account">
201 <div class="col-md-12">
203 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
204 <table class="table">
207 <th>Account Type</th>
208 <th>Account Delegation</th>
211 <!--<th>Pub Key</th> -->
213 {% for row in principal_acc %}
214 <tr class="border_bottom">
215 <td class="odd"> {{ row.platform_name }} </td>
216 <td class="odd"> {{ row.account_type }} </td>
217 <td class="odd"> {{ row.delegation_type }} </td>
218 <td class="odd"> {{ row.usr_hrn }} </td>
219 <td class="odd"> {{ row.user_status }} </td>
220 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
227 {%if 'Enabled' in user_status %}
228 <div class="col-md-12">
229 <h3>Credentials <small>Delegated to Principal Account</small></h3>
230 <table class="table">
231 <caption><b>Delegated User Credential</b></caption>
233 <th>Expiration Date</th>
236 {% for row in my_users %}
237 <tr class="border_bottom">
238 <td class="odd"> {{ row.cred_exp }} </td>
240 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
241 <span class="glyphicon glyphicon-download"></span> Credential
243 <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
244 <span class="glyphicon glyphicon-download"></span> Certificate
246 <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
247 <span class="glyphicon glyphicon-download"></span> PKCS p12
254 <table class="mytable table table-bordered table-hover">
255 <caption><b>Delegated Slice Credentials</b></caption>
258 <th>Expiration Date</th>
261 {% for row in my_slices %}
262 <tr class="border_bottom">
263 <td class="odd"> {{ row.slice_name }} </td>
264 <td class="odd"> {{ row.cred_exp }} </td>
266 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
267 <span class="glyphicon glyphicon-download"></span> Download
274 <table class="mytable table table-bordered table-hover">
275 <caption><b>Delegated Authority Credentials</b></caption>
277 <th>Authority Name</th>
278 <th>Expiration Date</th>
281 {% for row in my_auths %}
282 <tr class="border_bottom">
283 <td class="odd"> {{ row.auth_name }} </td>
284 <td class="odd"> {{ row.cred_exp }} </td>
286 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
287 <span class="glyphicon glyphicon-download"></span> Download
294 {%if '' not in my_users%}
295 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
297 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
303 <div class="tab-pane row" id="access">
304 <div class="col-md-12">
306 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
307 <table class="mytable table table-bordered table-hover">
310 <th>Account Type</th>
311 <th>Reference to</th>
312 <th>Remove Account</th>
314 {% for row in ref_acc %}
315 <tr class="border_bottom">
316 <td class="odd"> {{ row.platform_name }} </td>
317 <td class="odd"> {{ row.account_type }} </td>
318 <td class="odd"> {{ row.account_reference }} </td>
320 <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
321 <span class="glyphicon glyphicon-minus"></span>
329 <h3>Add reference account to the following testbeds</h3>
330 <table class="mytable table table-bordered table-hover">
335 {% for platform in platform_list %}
336 <tr class="border_bottom">
337 <td class="odd"> {{ platform.platform_no_access }} </td>
339 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
340 <span class="glyphicon glyphicon-plus"></span>
353 $(document).ready(function() {
354 $('.nav-tabs a').click(function (e) {
357 id = $(this).attr('href').substr(1);
360 $('button#createslice').click(function() {
361 window.location="/portal/slice_request/";