1 {% extends "layout.html" %}
7 {% for message in messages %}
8 <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
14 <h1><img src="{{ STATIC_URL }}img/icon_user_small.png" alt="" /> User Account</h1>
18 <ul class="nav nav-tabs">
19 <li class="active"><a class="account-tab" data-panel="user_profile" href="#">User Profile</a></li>
20 <li><a class="account-tab" data-panel="principal_acc" href="#">User Account</a></li>
21 <li><a class="account-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
24 <div class="account-panel" id="user_profile">
25 <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
28 <table class="profile">
31 <div>Platform: Myslice</div>
35 <td class="key">Email</td>
37 <span id="emailval" class="value" >{{ person.email }}</span>
38 <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
39 <span class="glyphicon glyphicon-question-sign"></span> Edit
44 <td class="key">Password</td>
46 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
47 <span class="glyphicon glyphicon-edit"></span> Edit
49 <span id="passval"class="value">******** </span>
50 <span class="hide_this" id="span_pass">
51 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
52 <div style='display:none;' id="pass_form">
53 <input type='hidden' value='' /></div>
54 <table id="edit_password">
56 <td>Enter password: </td>
57 <td class="field"> <input type="password" name="password" id="password" /> </td>
60 <td>Confirm password: </td>
62 <input type="password" name="confirmpassword" id="confirmpassword" />
63 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
71 <td class="key">Full Name</td>
73 <span id="nameval" class="value" >{{ fullname }} </span>
74 <span class="hide_this" id="span_name">
75 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
76 <div style='display:none;'><input type='hidden' name='nameform' /></div>
77 <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
78 <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
79 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
81 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
82 <span class="glyphicon glyphicon-edit"></span> Edit
87 <td class="key">Authority</td>
89 <span id="affval" class="value">{{ authority }}</span>
90 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
91 <span class="glyphicon glyphicon-question-sign"></span> Edit
95 {%if 'Enabled' in user_status %}
97 <td class="key">Generate Keys</td>
99 <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair"
100 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
101 title="It will generate a new key Pair and your current credentials will be overwritten."/>
105 <td class="key">Public Key</td>
107 <span id="keyval" class="value">******** </span>
108 <span class="hide_this" id="span_upload">
109 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
110 <div style='display:none;'>
111 <input type='hidden' name='upload' /></div>
112 <input type="file" name="pubkey" class="required" id="pubkey"/>
113 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
114 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
116 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
117 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
118 <span class="glyphicon glyphicon-download"></span> Download
120 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
121 <span class="glyphicon glyphicon-upload"></span> Upload
125 <tr class="even" id="pkey_row">
126 {%if 'N/A' not in user_private_key%}
127 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
128 <td class="value">********<a href="#">
129 <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
130 <span class="glyphicon glyphicon-download"></span> Download
132 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
133 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
136 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
137 <td class="value">********<a href="#">
138 <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
139 <span class="glyphicon glyphicon-download"></span> Download
141 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
147 <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
148 <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
149 <b>Security:</b> Manual account delegation. Download & Delete private key.
158 <div class="account-panel" id="principal_acc" style="display:none;">
160 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
162 <table class="table">
165 <th>Account Type</th>
166 <th>Account Delegation</th>
169 <!--<th>Pub Key</th> -->
171 {% for row in principal_acc %}
172 <tr class="border_bottom">
173 <td class="odd"> {{ row.platform_name }} </td>
174 <td class="odd"> {{ row.account_type }} </td>
175 <td class="odd"> {{ row.delegation_type }} </td>
176 <td class="odd"> {{ row.usr_hrn }} </td>
177 <td class="odd"> {{ row.user_status }} </td>
178 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
186 {%if 'Enabled' in user_status %}
188 <h3>Credentials <small>Delegated to Principal Account</small></h3>
189 <table class="table">
190 <caption><b>Delegated User Credential</b></caption>
192 <th>Expiration Date</th>
195 {% for row in my_users %}
196 <tr class="border_bottom">
197 <td class="odd"> {{ row.cred_exp }} </td>
199 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
200 <span class="glyphicon glyphicon-download"></span> Download
207 <table class="mytable table table-bordered table-hover">
208 <caption><b>Delegated Slice Credentials</b></caption>
211 <th>Expiration Date</th>
214 {% for row in my_slices %}
215 <tr class="border_bottom">
216 <td class="odd"> {{ row.slice_name }} </td>
217 <td class="odd"> {{ row.cred_exp }} </td>
219 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
220 <span class="glyphicon glyphicon-download"></span> Download
227 <table class="mytable table table-bordered table-hover">
228 <caption><b>Delegated Authority Credentials</b></caption>
230 <th>Authority Name</th>
231 <th>Expiration Date</th>
234 {% for row in my_auths %}
235 <tr class="border_bottom">
236 <td class="odd"> {{ row.auth_name }} </td>
237 <td class="odd"> {{ row.cred_exp }} </td>
239 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
240 <span class="glyphicon glyphicon-download"></span> Download
247 {%if '' not in my_users%}
248 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
250 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
257 <div class="account-panel" id="ref_acc" style="display:none;">
258 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
260 <table class="mytable table table-bordered table-hover">
263 <th>Account Type</th>
264 <th>Reference to</th>
265 <th>Remove Account</th>
267 {% for row in ref_acc %}
268 <tr class="border_bottom">
269 <td class="odd"> {{ row.platform_name }} </td>
270 <td class="odd"> {{ row.account_type }} </td>
271 <td class="odd"> {{ row.account_reference }} </td>
273 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
274 <span class="glyphicon glyphicon-minus"></span>
284 <h3>Add reference account to the following testbeds</h3>
286 <table class="mytable table table-bordered table-hover">
291 {% for platform in platform_list %}
292 <tr class="border_bottom">
293 <td class="odd"> {{ platform.platform_no_access }} </td>
295 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
296 <span class="glyphicon glyphicon-plus"></span>
309 $(document).ready(function() {
310 $('li#nav-account').addClass("active");
312 $('a.account-tab').click(function() {
313 $('ul.nav-tabs li').removeClass('active');
314 $(this).parent().addClass('active');
315 $('div.account-panel').hide();
316 $('div#'+$(this).data('panel')).show();
318 $('button#createslice').click(function() {
319 window.location="/portal/slice_request/";