Commit 620cc664 authored by Leigh B Stoller's avatar Leigh B Stoller

Show button to get the public_url of the sliver, to admins only.

parent 62be32f9
......@@ -45,11 +45,13 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
var template_args = {
uuid: uuid,
profileName: window.APT_OPTIONS.profileName,
profileUUID: window.APT_OPTIONS.profileUUID,
sliceURN: window.APT_OPTIONS.sliceURN,
sliceExpires: window.APT_OPTIONS.sliceExpires,
sliceExpiresText: window.APT_OPTIONS.sliceExpiresText,
creatorUid: window.APT_OPTIONS.creatorUid,
creatorEmail: window.APT_OPTIONS.creatorEmail,
publicURL: window.APT_OPTIONS.publicURL,
registered: window.APT_OPTIONS.registered,
isadmin: window.APT_OPTIONS.isadmin,
// The status panel starts out collapsed.
......
......@@ -37,6 +37,9 @@ $ajax_request = 0;
# Get current user.
#
$this_user = CheckLogin($check_status);
if (isset($this_user)) {
CheckLoginOrDie();
}
#
# Verify page arguments.
......@@ -110,6 +113,7 @@ $creator_email = $creator->email();
$profile = Profile::Lookup($instance->profile_id(),
$instance->profile_version());
$profile_name = $profile->name();
$profile_uuid = $profile->uuid();
if ($slice) {
$slice_urn = $slice->urn();
$slice_expires = DateStringGMT($slice->expires());
......@@ -132,6 +136,8 @@ $canclone = (($profile->published() && isset($this_user) &&
$snapping = 0;
$oneonly = (isset($oneonly) && $oneonly ? 1 : 0);
$isadmin = (ISADMIN() ? 1 : 0);
$public_url = ($instance->public_url() ?
"'" . $instance->public_url() . "'" : "null");
#
# We give ssh to the creator (real user or guest user).
......@@ -167,6 +173,7 @@ echo "<script type='text/javascript'>\n";
echo " window.APT_OPTIONS.uuid = '" . $uuid . "';\n";
echo " window.APT_OPTIONS.instanceStatus = '" . $instance_status . "';\n";
echo " window.APT_OPTIONS.profileName = '" . $profile_name . "';\n";
echo " window.APT_OPTIONS.profileUUID = '" . $profile_uuid . "';\n";
echo " window.APT_OPTIONS.profilePublic = " . $profile_public . ";\n";
echo " window.APT_OPTIONS.sliceURN = '" . $slice_urn . "';\n";
echo " window.APT_OPTIONS.sliceExpires = '" . $slice_expires . "';\n";
......@@ -180,6 +187,7 @@ echo " window.APT_OPTIONS.canclone = $canclone;\n";
echo " window.APT_OPTIONS.snapping = $snapping;\n";
echo " window.APT_OPTIONS.oneonly = $oneonly;\n";
echo " window.APT_OPTIONS.dossh = $dossh;\n";
echo " window.APT_OPTIONS.publicURL = $public_url;\n";
echo " window.APT_OPTIONS.AJAXURL = 'server-ajax.php';\n";
if (isset($extend) && $extend != "") {
echo " window.APT_OPTIONS.extend = $extend;\n";
......
......@@ -45,7 +45,9 @@
</tr>
<tr>
<td class='border-none'>Profile:</td>
<td class='border-none'><%- profileName %></td>
<td class='border-none'>
<a target=_blank href='show-profile.php?uuid=<%- profileUUID %>'>
<%- profileName %></a></td>
</tr>
<tr>
<td class='border-none'>Expires:</td>
......@@ -55,12 +57,15 @@
</td>
</tr>
</table>
<!--
<% if (isadmin && publicURL) { %>
<div class='pull-left'>
<span class='glyphicon glyphicon-question-sign'
style='font-size:24px'></span>
<a class='btn btn-info btn-xs pull-left'
style='margin-right: 10px;'
href='<%= publicURL %>'
type='button'>Sliver
</a>
</div>
-->
<% } %>
<div class='pull-right'>
<% if (registered) { %>
<button class='btn btn-xs btn-primary hidden' disabled
......
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