1 {% extends "layout.html" %}
5 <div class="col-md-12">
6 <div class="breadcrumbs">
7 Account > <a href="/account">{{ person.email }}</a>
10 {%if 'no_creds' in user_cred %}
11 <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
17 {% for message in messages %}
18 <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
23 <div class="col-md-12">
24 <ul class="nav nav-tabs nav-section">
25 <li class="active"><a href="#profile">User Profile</a></li>
26 <li><a href="#account">Account</a></li>
27 <li><a href="#access">Testbed Access</a></li>
31 <div class="tab-content">
32 <div class="tab-pane active row" id="profile">
34 <div class="col-md-12">
36 <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
38 <table class="profile">
41 <div><h3>Platform: Myslice</h3></div>
45 <td class="key">Email</td>
47 <span id="emailval" class="value" >{{ person.email }}</span>
48 <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
49 <span class="glyphicon glyphicon-question-sign"></span> Edit
54 <td class="key">Password</td>
56 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
57 <span class="glyphicon glyphicon-edit"></span> Edit
59 <span id="passval"class="value">******** </span>
60 <span class="hide_this" id="span_pass">
61 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
62 <div style='display:none;' id="pass_form">
63 <input type='hidden' value='' /></div>
64 <table id="edit_password">
66 <td>Enter password: </td>
67 <td class="field"> <input type="password" name="password" id="password" /> </td>
70 <td>Confirm password: </td>
72 <input type="password" name="confirmpassword" id="confirmpassword" />
73 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
81 <td class="key">Full Name</td>
83 <span id="nameval" class="value" >{{ fullname }} </span>
84 <span class="hide_this" id="span_name">
85 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
86 <div style='display:none;'><input type='hidden' name='nameform' /></div>
87 <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
88 <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
89 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
91 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
92 <span class="glyphicon glyphicon-edit"></span> Edit
97 <td class="key">Authority</td>
99 <span id="affval" class="value">{{ authority }}</span>
100 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
101 <span class="glyphicon glyphicon-question-sign"></span> Edit
105 {%if 'Enabled' in user_status %}
107 <td class="key">Generate Keys</td>
109 <input type="submit" name="generate" class="btn btn-primary" value="Generate a new Key Pair" id="generate_keypair"
110 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
111 title="It will generate a new key Pair and your current credentials will be overwritten."/>
115 <td class="key">Public Key</td>
117 <span id="keyval" class="value">******** </span>
118 <span class="hide_this" id="span_upload">
119 <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
120 <div style='display:none;'>
121 <input type='hidden' name='upload' /></div>
122 <input type="file" name="pubkey" class="required" id="pubkey"/>
123 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
124 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
126 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
127 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
128 <span class="glyphicon glyphicon-download"></span> Download
130 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
131 <span class="glyphicon glyphicon-upload"></span> Upload
135 <tr class="even" id="pkey_row">
136 {%if 'N/A' not in user_private_key%}
137 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
138 <td class="value">********<a href="#"></a>
139 <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey">
140 <span class="glyphicon glyphicon-download"></span> Download
142 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
143 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
146 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
147 <td class="value">********<a href="#"></a>
148 <button type="submit" name="dl_pkey" class="btn btn-default disabled" title="Download your privaye key" id="dl_pkey">
149 <span class="glyphicon glyphicon-download"></span> Download
151 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
157 <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
158 <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
159 <b>Security:</b> Manual account delegation. Download & Delete private key.
169 <div class="tab-pane row" id="account">
170 <div class="col-md-12">
172 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
173 <table class="table">
176 <th>Account Type</th>
177 <th>Account Delegation</th>
180 <!--<th>Pub Key</th> -->
182 {% for row in principal_acc %}
183 <tr class="border_bottom">
184 <td class="odd"> {{ row.platform_name }} </td>
185 <td class="odd"> {{ row.account_type }} </td>
186 <td class="odd"> {{ row.delegation_type }} </td>
187 <td class="odd"> {{ row.usr_hrn }} </td>
188 <td class="odd"> {{ row.user_status }} </td>
189 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
197 {%if 'Enabled' in user_status %}
198 <div class="col-md-12">
199 <h3>Credentials <small>Delegated to Principal Account</small></h3>
200 <table class="table">
201 <caption><b>Delegated User Credential</b></caption>
203 <th>Expiration Date</th>
206 {% for row in my_users %}
207 <tr class="border_bottom">
208 <td class="odd"> {{ row.cred_exp }} </td>
210 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
211 <span class="glyphicon glyphicon-download"></span> Credential
213 <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
214 <span class="glyphicon glyphicon-download"></span> Certificate
216 <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
217 <span class="glyphicon glyphicon-download"></span> PKCS p12
224 <table class="mytable table table-bordered table-hover">
225 <caption><b>Delegated Slice Credentials</b></caption>
228 <th>Expiration Date</th>
231 {% for row in my_slices %}
232 <tr class="border_bottom">
233 <td class="odd"> {{ row.slice_name }} </td>
234 <td class="odd"> {{ row.cred_exp }} </td>
236 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
237 <span class="glyphicon glyphicon-download"></span> Download
244 <table class="mytable table table-bordered table-hover">
245 <caption><b>Delegated Authority Credentials</b></caption>
247 <th>Authority Name</th>
248 <th>Expiration Date</th>
251 {% for row in my_auths %}
252 <tr class="border_bottom">
253 <td class="odd"> {{ row.auth_name }} </td>
254 <td class="odd"> {{ row.cred_exp }} </td>
256 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
257 <span class="glyphicon glyphicon-download"></span> Download
264 {%if '' not in my_users%}
265 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
267 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
271 <!-- Modal- No credentials -->
272 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
273 <div class="modal-dialog">
274 <div class="modal-content">
275 <div class="modal-header">
276 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
277 <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4>
279 <div class="modal-body">
280 <p>You may get this message for several reasons.</p>
281 <h3>Account Delegation: Automatic</h3>
283 <li>If your account is not yet validated</li>
284 <li>If you press the "Clear Credentials" button</li>
285 <li>If you "Generate a new key pair"</li>
286 <li>If a new slice is added to your account</li>
288 <p>In all the above mentioned cases, it is sufficient to refresh the page or go back to home page. The portal will regenrate your credentials.
289 In some cases it may take more time than usual. If nothing works, then please logout and login again to the portal.</p>
290 <h3>Account Delegation: Manual</h3>
291 <p>First of all your account needs to be validated by the manager of your organization.</p>
292 <p>As you have uploaded your own public key, the portal can no longer generate your credentials automatically.</p>
293 <p>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to
294 <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a>
296 <h5>Contact support</h5>
297 <p>If you don't have the above mentioned cases and still have this message, please <a href="/contact/" target="_blank">contact us</a>.</p>
299 <div class="modal-footer">
300 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
307 <div class="tab-pane row" id="access">
308 <div class="col-md-12">
310 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
311 <table class="mytable table table-bordered table-hover">
314 <th>Account Type</th>
315 <th>Reference to</th>
316 <th>Remove Account</th>
318 {% for row in ref_acc %}
319 <tr class="border_bottom">
320 <td class="odd"> {{ row.platform_name }} </td>
321 <td class="odd"> {{ row.account_type }} </td>
322 <td class="odd"> {{ row.account_reference }} </td>
324 <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
325 <span class="glyphicon glyphicon-minus"></span>
333 <h3>Add reference account to the following testbeds</h3>
334 <table class="mytable table table-bordered table-hover">
339 {% for platform in platform_list %}
340 <tr class="border_bottom">
341 <td class="odd"> {{ platform.platform_no_access }} </td>
343 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
344 <span class="glyphicon glyphicon-plus"></span>
357 $(document).ready(function() {
358 $('.nav-tabs a').click(function (e) {
361 id = $(this).attr('href').substr(1);
365 $('button#createslice').click(function() {
366 window.location="/portal/slice_request/";