1 {% extends "layout.html" %}
5 <div class="col-md-12">
6 <div class="breadcrumbs">
7 Account > <a href="/account">{{ person.email }}</a>
13 {% for message in messages %}
14 <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
19 <div class="col-md-12">
20 <ul class="nav nav-tabs nav-section">
21 <li class="active"><a href="#profile">User Profile</a></li>
22 <li><a href="#account">Account</a></li>
23 <li><a href="#access">Testbed Access</a></li>
27 <div class="tab-content">
28 <div class="tab-pane active row" id="profile">
30 <div class="col-md-12">
32 <form id="editForm" method="post" action="account_process" enctype="multipart/form-data">
34 <table class="profile">
37 <div><h3>Platform: Myslice</h3></div>
41 <td class="key">Email</td>
43 <span id="emailval" class="value" >{{ person.email }}</span>
44 <button class="btn btn-default" type="button" id="edit_email" onclick="editAlert();" title="To change your affiliation please contact the administrator">
45 <span class="glyphicon glyphicon-question-sign"></span> Edit
50 <td class="key">Password</td>
52 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
53 <span class="glyphicon glyphicon-edit"></span> Edit
55 <span id="passval"class="value">******** </span>
56 <span class="hide_this" id="span_pass">
57 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
58 <div style='display:none;' id="pass_form">
59 <input type='hidden' value='' /></div>
60 <table id="edit_password">
62 <td>Enter password: </td>
63 <td class="field"> <input type="password" name="password" id="password" /> </td>
66 <td>Confirm password: </td>
68 <input type="password" name="confirmpassword" id="confirmpassword" />
69 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
77 <td class="key">Full Name</td>
79 <span id="nameval" class="value" >{{ fullname }} </span>
80 <span class="hide_this" id="span_name">
81 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button>
82 <div style='display:none;'><input type='hidden' name='nameform' /></div>
83 <input id="fname" type="text" name="fname" class="required" maxlength="200" value="{{firstname}}" />
84 <input id="lname" type="text" name="lname" class="required" maxlength="200" value="{{lastname}}" />
85 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
87 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
88 <span class="glyphicon glyphicon-edit"></span> Edit
93 <td class="key">Authority</td>
95 <span id="affval" class="value">{{ authority }}</span>
96 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
97 <span class="glyphicon glyphicon-question-sign"></span> Edit
101 {%if 'Enabled' in user_status %}
103 <td class="key">Generate Keys</td>
105 <input type="submit" name="generate" class="btn btn-primary" value="Generate a new Key Pair" id="generate_keypair"
106 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
107 title="It will generate a new key Pair and your current credentials will be overwritten."/>
111 <td class="key">Public Key</td>
113 <span id="keyval" class="value">******** </span>
114 <span class="hide_this" id="span_upload">
115 <button type="button" class="btn btn-default" title="Cancel" id="cancel_upload"> Cancel </button>
116 <div style='display:none;'>
117 <input type='hidden' name='upload' /></div>
118 <input type="file" name="pubkey" class="required" id="pubkey"/>
119 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
120 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
122 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
123 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
124 <span class="glyphicon glyphicon-download"></span> Download
126 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
127 <span class="glyphicon glyphicon-upload"></span> Upload
131 <tr class="even" id="pkey_row">
132 {%if 'N/A' not in user_private_key%}
133 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
134 <td class="value">********<a href="#"></a>
135 <button type="submit" name="dl_pkey" class="btn btn-default" title="Download your privaye key" id="dl_pkey">
136 <span class="glyphicon glyphicon-download"></span> Download
138 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
139 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
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 disabled" title="Download your privaye key" id="dl_pkey">
145 <span class="glyphicon glyphicon-download"></span> Download
147 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key" value="Delete" />
153 <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
154 <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
155 <b>Security:</b> Manual account delegation. Download & Delete private key.
165 <div class="tab-pane row" id="account">
166 <div class="col-md-12">
168 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
169 <table class="table">
172 <th>Account Type</th>
173 <th>Account Delegation</th>
176 <!--<th>Pub Key</th> -->
178 {% for row in principal_acc %}
179 <tr class="border_bottom">
180 <td class="odd"> {{ row.platform_name }} </td>
181 <td class="odd"> {{ row.account_type }} </td>
182 <td class="odd"> {{ row.delegation_type }} </td>
183 <td class="odd"> {{ row.usr_hrn }} </td>
184 <td class="odd"> {{ row.user_status }} </td>
185 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
193 {%if 'Enabled' in user_status %}
194 <div class="col-md-12">
195 <h3>Credentials <small>Delegated to Principal Account</small></h3>
196 <table class="table">
197 {%if 'no_creds' in user_cred %}
198 <p><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
200 <caption><b>Delegated User Credential</b></caption>
202 <th>Expiration Date</th>
205 {% for row in my_users %}
206 <tr class="border_bottom">
207 <td class="odd"> {{ row.cred_exp }} </td>
209 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
210 <span class="glyphicon glyphicon-download"></span> Credential
212 <button class="btn btn-default btn-xs" name= "dl_user_cert" type="submit" title="Download User Certificate">
213 <span class="glyphicon glyphicon-download"></span> Certificate
215 <button class="btn btn-default btn-xs" name= "dl_user_p12" type="submit" title="Download User PKCS12">
216 <span class="glyphicon glyphicon-download"></span> PKCS p12
223 <table class="mytable table table-bordered table-hover">
224 <caption><b>Delegated Slice Credentials</b></caption>
227 <th>Expiration Date</th>
230 {% for row in my_slices %}
231 <tr class="border_bottom">
232 <td class="odd"> {{ row.slice_name }} </td>
233 <td class="odd"> {{ row.cred_exp }} </td>
235 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
236 <span class="glyphicon glyphicon-download"></span> Download
243 <table class="mytable table table-bordered table-hover">
244 <caption><b>Delegated Authority Credentials</b></caption>
246 <th>Authority Name</th>
247 <th>Expiration Date</th>
250 {% for row in my_auths %}
251 <tr class="border_bottom">
252 <td class="odd"> {{ row.auth_name }} </td>
253 <td class="odd"> {{ row.cred_exp }} </td>
255 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
256 <span class="glyphicon glyphicon-download"></span> Download
263 {%if '' not in my_users%}
264 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
266 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
270 <!-- Modal- No credentials -->
271 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
272 <div class="modal-dialog">
273 <div class="modal-content">
274 <div class="modal-header">
275 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
276 <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4>
278 <div class="modal-body">
279 <p>You may get this message for several reasons.</p>
280 <h3>Account Delegation: Automatic</h3>
282 <li>If you press the "Clear Credentials" button</li>
283 <li>If you "Generate a new key pair"</li>
284 <li>If a new slice is added to your account</li>
286 <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.
287 In some cases it may take more time than usual. If nothing works, then please logout and login again to the portal.</p>
288 <h3>Account Delegation: Manual</h3>
289 <p>As you have uploaded your own public key, the portal can no longer generate your credentials automatically.</p>
290 <p>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to
291 <a href="http://trac.myslice.info/wiki/InstallSfa" target="_blank">delegate your credentials to the portal.</a>
293 <h5>Contact support</h5>
294 <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>
296 <div class="modal-footer">
297 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
304 <div class="tab-pane row" id="access">
305 <div class="col-md-12">
307 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
308 <table class="mytable table table-bordered table-hover">
311 <th>Account Type</th>
312 <th>Reference to</th>
313 <th>Remove Account</th>
315 {% for row in ref_acc %}
316 <tr class="border_bottom">
317 <td class="odd"> {{ row.platform_name }} </td>
318 <td class="odd"> {{ row.account_type }} </td>
319 <td class="odd"> {{ row.account_reference }} </td>
321 <button class="btn btn-danger" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
322 <span class="glyphicon glyphicon-minus"></span>
330 <h3>Add reference account to the following testbeds</h3>
331 <table class="mytable table table-bordered table-hover">
336 {% for platform in platform_list %}
337 <tr class="border_bottom">
338 <td class="odd"> {{ platform.platform_no_access }} </td>
340 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
341 <span class="glyphicon glyphicon-plus"></span>
354 $(document).ready(function() {
355 $('.nav-tabs a').click(function (e) {
358 id = $(this).attr('href').substr(1);
362 $('button#createslice').click(function() {
363 window.location="/portal/slice_request/";