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 privaye key" id="dl_sfi_config">
164 <span class="glyphicon glyphicon-download"></span> Download
172 <a href="#" style="color:green" data-toggle="modal" data-target="#tradeoffmodal">Automatic vs. Manual delegation of credentials:</a>
173 Trade-off between ease-of-use & security</p>
183 <div class="tab-pane row" id="account">
184 <div class="col-md-12">
186 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
187 <table class="table">
190 <th>Account Type</th>
191 <th>Account Delegation</th>
194 <!--<th>Pub Key</th> -->
196 {% for row in principal_acc %}
197 <tr class="border_bottom">
198 <td class="odd"> {{ row.platform_name }} </td>
199 <td class="odd"> {{ row.account_type }} </td>
200 <td class="odd"> {{ row.delegation_type }} </td>
201 <td class="odd"> {{ row.usr_hrn }} </td>
202 <td class="odd"> {{ row.user_status }} </td>
203 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
211 {%if 'Enabled' in user_status %}
212 <div class="col-md-12">
213 <h3>Credentials <small>Delegated to Principal Account</small></h3>
214 <table class="table">
215 <caption><b>Delegated User Credential</b></caption>
217 <th>Expiration Date</th>
220 {% for row in my_users %}
221 <tr class="border_bottom">
222 <td class="odd"> {{ row.cred_exp }} </td>
224 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
225 <span class="glyphicon glyphicon-download"></span> Credential
227 <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
228 <span class="glyphicon glyphicon-download"></span> Certificate
230 <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
231 <span class="glyphicon glyphicon-download"></span> PKCS p12
238 <table class="mytable table table-bordered table-hover">
239 <caption><b>Delegated Slice Credentials</b></caption>
242 <th>Expiration Date</th>
245 {% for row in my_slices %}
246 <tr class="border_bottom">
247 <td class="odd"> {{ row.slice_name }} </td>
248 <td class="odd"> {{ row.cred_exp }} </td>
250 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
251 <span class="glyphicon glyphicon-download"></span> Download
258 <table class="mytable table table-bordered table-hover">
259 <caption><b>Delegated Authority Credentials</b></caption>
261 <th>Authority Name</th>
262 <th>Expiration Date</th>
265 {% for row in my_auths %}
266 <tr class="border_bottom">
267 <td class="odd"> {{ row.auth_name }} </td>
268 <td class="odd"> {{ row.cred_exp }} </td>
270 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
271 <span class="glyphicon glyphicon-download"></span> Download
278 {%if '' not in my_users%}
279 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
281 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
286 <div class="tab-pane row" id="access">
287 <div class="col-md-12">
289 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
290 <table class="mytable table table-bordered table-hover">
293 <th>Account Type</th>
294 <th>Reference to</th>
295 <th>Remove Account</th>
297 {% for row in ref_acc %}
298 <tr class="border_bottom">
299 <td class="odd"> {{ row.platform_name }} </td>
300 <td class="odd"> {{ row.account_type }} </td>
301 <td class="odd"> {{ row.account_reference }} </td>
303 <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
304 <span class="glyphicon glyphicon-minus"></span>
312 <h3>Add reference account to the following testbeds</h3>
313 <table class="mytable table table-bordered table-hover">
318 {% for platform in platform_list %}
319 <tr class="border_bottom">
320 <td class="odd"> {{ platform.platform_no_access }} </td>
322 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
323 <span class="glyphicon glyphicon-plus"></span>
336 $(document).ready(function() {
337 $('.nav-tabs a').click(function (e) {
340 id = $(this).attr('href').substr(1);
344 $('button#createslice').click(function() {
345 window.location="/portal/slice_request/";