Commit fb547073 authored by Leigh B Stoller's avatar Leigh B Stoller

Tweak ssh keys for nonlocal users; not editable, remind them to use their

own portal.
parent fb01244f
......@@ -10,17 +10,20 @@ function (_, sup, sshkeysString, oopsString, waitwaitString)
'use strict';
var embedded = 0;
var target_uid = "";
var nonlocal = false;
var sshkeysTemplate = _.template(sshkeysString);
function initialize()
{
window.APT_OPTIONS.initialize(sup);
embedded = window.EMBEDDED;
nonlocal = window.NONLOCAL;
target_uid = window.TARGET_UID;
var pubkeys = JSON.parse(_.unescape($('#sshkey-list')[0].textContent));
var html = sshkeysTemplate({
pubkeys: pubkeys,
nonlocal: nonlocal,
});
$('#page-body').html(html);
$('#oops_div').html(oopsString);
......
......@@ -44,6 +44,7 @@ if (!isset($target_user)) {
}
$target_uid = $target_user->uid();
$target_idx = $target_user->idx();
$nonlocal = ($target_user->IsNonLocal() ? "true" : "false");
if (! ($target_user->SameUser($this_user) ||
$target_user->AccessCheck($this_user, $TB_USERINFO_READINFO))) {
......@@ -70,6 +71,7 @@ echo "<div id='page-body'></div>\n";
echo "<script type='text/javascript'>\n";
echo " window.AJAXURL = 'server-ajax.php';\n";
echo " window.TARGET_UID = '$target_uid';\n";
echo " window.NONLOCAL = $nonlocal;\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
......
......@@ -3,6 +3,24 @@
col-md-12 col-md-offset-0
col-sm-12 col-sm-offset-0
col-xs-12 col-xs-offset-0'>
<% if (nonlocal) { %>
<div class='row'>
<div class='col-lg-8 col-lg-offset-2
col-md-8 col-md-offset-2
col-sm-10 col-sm-offset-1
col-xs-10 col-xs-offset-1'>
<div class='panel panel-info'>
<div class='panel-body bg-warning style='padding: 5px;'>
<div>
GENI Users; be sure to add ssh keys at <b>your</b> portal if
you want to log in from your desktop. Keys at your portal will be
reflected in the list below.
</div>
</div>
</div>
</div>
</div>
<% } %>
<div class='row'>
<div class='col-lg-10 col-lg-offset-1
col-md-10 col-md-offset-1
......@@ -17,17 +35,19 @@
%>
<div class="panel panel-info" id='<%- panel_id %>'>
<div class="panel-heading clearfix">
<% if (!nonlocal) { %>
<div class='button-group pull-right'>
<a class='btn btn-danger btn-sm delete_pubkey_button'
type='button'
data-key='<%- pubkey.index %>'>Delete</a>
</div>
<% } %>
<div style='padding-top: 7.5px;'>
<a data-toggle="collapse"
href='#<%- key_href %>'>
<span class="glyphicon glyphicon-chevron-right pull-left"
style='padding-right: 10px;'></span>
<h4 class='panel-title'><%- key_title %></h5></a>
<h4 class='panel-title'><%- key_title %></h4></a>
</div>
</div>
<div id='<%- key_href %>' class="panel-collapse collapse">
......@@ -39,6 +59,7 @@
<% }); %>
</div>
</div>
<% if (!nonlocal) { %>
<div class='row'>
<div class='col-lg-10 col-lg-offset-1
col-md-10 col-md-offset-1
......@@ -97,6 +118,7 @@
</div>
</div>
</div>
<% } %>
</div>
</div>
<div id='waitwait_div'></div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment