Commit a6a4f64a authored by Leigh Stoller's avatar Leigh Stoller

Do not show Portal/Geni experiments to mere users in the classic

interface, there is no good that come of that. For admins, remove all
options, none of them make sense. Instead, provide a link to the Portal
status page.
parent 3483c427
<?php
#
# Copyright (c) 2006-2016 University of Utah and the Flux Group.
# Copyright (c) 2006-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -354,6 +354,7 @@ class Experiment
function paniced() { return $this->field('paniced'); }
function panic_date() { return $this->field('panic_date'); }
function geniflags() { return $this->field('geniflags'); }
function nonlocal_id() { return $this->field('nonlocal_id'); }
function virtnode_count() { return $this->field('virtnode_count'); }
#
......@@ -1080,14 +1081,16 @@ class Experiment
</tr>\n";
}
$lockflip = ($lockdown ? 0 : 1);
$lockval = ($lockdown ? "Yes" : "No");
echo "<tr>
if (ISADMIN()) {
$lockflip = ($lockdown ? 0 : 1);
$lockval = ($lockdown ? "Yes" : "No");
echo "<tr>
<td>Locked Down:</td>
<td>$lockval (<a href='toggle.php?pid=$pid&eid=$eid".
"&type=lockdown&value=$lockflip'>Toggle</a>)
"&type=lockdown&value=$lockflip'>Toggle</a>)
</td>
</tr>\n";
</tr>\n";
}
if (ISADMIN() || STUDLY() || OPSGUY()) {
$thisflip = ($skipvlans ? 0 : 1);
......@@ -1613,6 +1616,14 @@ function ShowExperimentList_internal($templates_only,
if (! ($experiment = Experiment::LookupByPidEid($pid, $eid))) {
TBERROR("Could not map $pid/$eid to its object", 1);
}
#
# No long show Geni experiments here, going to be bad news for
# mere users.
#
if ($experiment->geniflags() && !ISADMIN()) {
continue;
}
$idlehours = $experiment->IdleTime();
$stale = $experiment->IdleStale();
......
<?php
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -26,6 +26,9 @@ require("Sajax.php");
include("showstuff.php3");
include_once("node_defs.php");
include_once("template_defs.php");
chdir("apt");
include_once("instance_defs.php");
chdir("..");
sajax_init();
sajax_export("GetExpState", "Show", "ModifyAnno", "FreeNodeHtml");
......@@ -347,10 +350,21 @@ while ($row = mysql_fetch_array($query_result)) {
}
}
if ($geniflags) {
# We would not see this unless it was an active experiment.
$aptinstance = Instance::LookupBySlice($experiment_stats->slice_uuid());
}
SUBPAGESTART();
SUBMENUSTART("$tag Options");
if (isset($aptinstance)) {
WRITESUBMENUBUTTON("Go to Portal Page",
"$TBBASE/portal/status.php?uuid=" .
$aptinstance->uuid());
}
else {
if ($expstate && !$geniflags) {
if ($experiment->logfile() && $experiment->logfile() != "") {
WRITESUBMENUBUTTON("View Activity Logfile",
......@@ -488,7 +502,8 @@ if (!$geniflags && $expstate == $TB_EXPTSTATE_ACTIVE) {
}
}
if (($expstate == $TB_EXPTSTATE_ACTIVE ||
if (!$geniflags &&
($expstate == $TB_EXPTSTATE_ACTIVE ||
$expstate == $TB_EXPTSTATE_ACTIVATING ||
$expstate == $TB_EXPTSTATE_MODIFY_RESWAP) &&
(STUDLY() || $EXPOSELINKTEST)) {
......@@ -498,7 +513,7 @@ if (($expstate == $TB_EXPTSTATE_ACTIVE ||
($linktest_running ? "&kill=1" : ""));
}
if ($expstate == $TB_EXPTSTATE_ACTIVE) {
if (!$geniflags && $expstate == $TB_EXPTSTATE_ACTIVE) {
if (!$geniflags && STUDLY() && isset($classes['pcvm'])) {
WRITESUBMENUBUTTON("Record Feedback Data",
CreateURL("feedback", $experiment) .
......@@ -528,7 +543,7 @@ if ($wireless) {
WRITESUBMENUDIVIDER();
# History
if (! $instance) {
if (! ($instance || $geniflags)) {
WRITESUBMENUBUTTON("Show History",
"showstats.php3?showby=expt&exptidx=$expindex");
}
......@@ -597,7 +612,7 @@ if ($isadmin) {
SUBMENUSECTIONEND();
}
}
}
SUBMENUEND_2A();
echo "<br>\n";
......
<?php
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -597,6 +597,14 @@ if ($thumb && !$idle) {
}
$stale = $experiment->IdleStale();
#
# No longer show Geni experiments here, going to be bad news for
# mere users.
#
if ($nonlocal_id && !$isadmin) {
continue;
}
if ($state == "active" && isset($sidx)) {
if (! ($user = User::Lookup($sidx))) {
TBERROR("Could not lookup object for user $sidx", 1);
......
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