All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 3f4ac33b authored by Leigh B Stoller's avatar Leigh B Stoller

Minor tweaks to previous revision.

parent 7ab4d9b4
......@@ -279,7 +279,7 @@ class Aggregate
#
# Return the list of allowed aggregates based on the portal in use.
#
function DefaultAggregateList() {
function DefaultAggregateList($user = null) {
global $PORTAL_GENESIS, $PORTAL_HEALTH;
$genesis = $PORTAL_GENESIS;
if ($PORTAL_HEALTH)
......@@ -334,7 +334,9 @@ class Aggregate
}
}
}
$am_array[$urn] = $aggregate;
if ($allowed) {
$am_array[$urn] = $aggregate;
}
}
return $am_array;
}
......
<?php
#
# Copyright (c) 2006-2018 University of Utah and the Flux Group.
# Copyright (c) 2006-2019 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -429,8 +429,8 @@ class Instance
#
# Return aggregate based on the current user.
#
function DefaultAggregateList() {
return Aggregate::DefaultAggregateList();
function DefaultAggregateList($user = null) {
return Aggregate::DefaultAggregateList($user);
}
# helper
......@@ -1220,9 +1220,9 @@ class ExtensionInfo
# $amlist, $fedlist, and $status are all output arrays
function CalculateAggregateStatus(&$amlist, &$fedlist, &$status,
$extended = false) {
$extended = false, $user = null) {
global $TBMAINSITE, $DEFAULT_AGGREGATE_URN, $CHECKLOGIN_USER;
$am_array = Instance::DefaultAggregateList();
$am_array = Instance::DefaultAggregateList($user);
#
# If not the Cloudlab Portal then we get local status only.
......@@ -1331,11 +1331,11 @@ function CalculateWirelessStatus(&$result) {
$result["controlled"] = $controlled1 + $controlled2;
}
function SpitAggregateStatus($extended = false) {
function SpitAggregateStatus($extended = false, $user = null) {
$amlist = array();
$fedlist = array();
$status = array();
CalculateAggregateStatus($amlist, $fedlist, $status, $extended);
CalculateAggregateStatus($amlist, $fedlist, $status, $extended, $user);
echo "<script type='text/plain' id='amlist-json'>\n";
echo htmlentities(json_encode($amlist));
echo "</script>\n";
......
......@@ -381,7 +381,7 @@ function SPITFORM($formfields, $newuser, $errors)
echo htmlentities(json_encode($projlist));
echo "</script>\n";
}
SpitAggregateStatus(true);
SpitAggregateStatus(true, $this_user);
SpitOopsModal("oops");
echo "<script type='text/javascript'>\n";
......
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