Commit c00661c9 authored by Leigh Stoller's avatar Leigh Stoller

Add Wisconsin when red-dot (for now).

parent d288b5f5
......@@ -23,15 +23,6 @@
#
#
$am_array = array('Utah APT' =>
"urn:publicid:IDN+apt.emulab.net+authority+cm",
'Utah Cloudlab' =>
"urn:publicid:IDN+utah.cloudlab.us+authority+cm",
'Utah DDC' =>
"urn:publicid:IDN+utahddc.geniracks.net+authority+cm",
'Utah PG' =>
"urn:publicid:IDN+emulab.net+authority+cm");
if ($ISCLOUD) {
$DEFAULT_AGGREGATE = "Utah Cloudlab";
}
......@@ -250,5 +241,25 @@ class Instance
$row = mysql_fetch_row($query_result);
return $row[0];
}
#
# Return aggregate based on the current user.
#
function DefaultAggregateList() {
$am_array = array('Utah APT' =>
"urn:publicid:IDN+apt.emulab.net+authority+cm",
'Utah Cloudlab' =>
"urn:publicid:IDN+utah.cloudlab.us+authority+cm",
'Utah DDC' =>
"urn:publicid:IDN+utahddc.geniracks.net+authority+cm",
'Utah PG' =>
"urn:publicid:IDN+emulab.net+authority+cm");
if (ISADMIN()) {
$am_array["Wisc Cloudlab"] =
"urn:publicid:IDN+wisc.cloudlab.us+authority+cm";
}
return $am_array;
}
}
?>
......@@ -109,8 +109,9 @@ function Do_GetParameters()
#
function Do_Instantiate()
{
global $this_user, $am_array, $DEFAULT_AGGREGATE, $ISCLOUD;
global $this_user, $DEFAULT_AGGREGATE, $ISCLOUD;
global $ajax_args;
$am_array = Instance::DefaultAggregateList();
if (!isset($ajax_args["uuid"])) {
SPITAJAX_ERROR(1, "Missing profile uuid");
......
......@@ -89,7 +89,8 @@ else {
$profile_default = "OneVM";
$profile_default_pid = $TBOPSPID;
}
$profile_array = array();
$profile_array = array();
$am_array = Instance::DefaultAggregateList();
#
# if using the super secret URL, make sure the profile exists, and
......@@ -398,9 +399,14 @@ function SPITFORM($formfields, $newuser, $errors)
echo "<div class='panel-footer'>";
if (isset($this_user)) {
echo "<button class='btn btn-default btn-sm pull-left'
type='button' id='profile_copy_button'>
type='button' id='profile_copy_button'
style='margin-right: 10px;'>
Copy Profile
</button>";
echo "<button class='btn btn-default btn-sm pull-left'
type='button' id='profile_show_button'>
Show Profile
</button>";
}
echo "<button id='profile' class='btn btn-primary btn-sm pull-right'
type='button' name='profile_button'>
......
......@@ -182,6 +182,8 @@ function SPITFORM($formfields, $errors)
SPITFOOTER();
}
$am_array = Instance::DefaultAggregateList();
#
# See what projects the user can do this in.
#
......
<?php
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -49,6 +49,7 @@ if (!$profile) {
if (!$profile->CanInstantiate($this_user)) {
PAGEERROR("Not enough permission to instantiate profile");
}
$am_array = Instance::DefaultAggregateList();
#
# Spit the form
......
<?php
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -59,13 +59,16 @@ if (!$profile->CanView($this_user) && !ISADMIN()) {
$profile_uuid = $profile->profile_uuid();
$version_uuid = $profile->uuid();
$ispp = ($profile->isParameterized() ? 1 : 0);
$history = ($profile->HasHistory() ? 1 : 0);
$defaults = array();
$defaults["profile_name"] = $profile->name();
$defaults["profile_rspec"] = $profile->rspec();
$defaults["profile_version"] = $profile->version();
$defaults["profile_creator"] = $profile->creator();
$defaults["profile_pid"] = $profile->pid();
$defaults["profile_created"] = DateStringGMT($profile->created());
$defaults["profile_published"] = DateStringGMT($profile->published());
$defaults["profile_version_url"] = $profile->URL();
$defaults["profile_profile_url"] = $profile->ProfileURL();
if ($profile->script() && $profile->script() != "") {
......@@ -87,7 +90,7 @@ echo "</script>\n";
$amlist = array();
$amdefault = "";
if (($ISCLOUD || ISADMIN() || STUDLY())) {
while (list($am) = each($am_array)) {
while (list($am) = each(Instance::DefaultAggregateList())) {
$amlist[] = $am;
}
$amdefault = $DEFAULT_AGGREGATE;
......@@ -105,6 +108,7 @@ echo " window.PROFILE_UUID = '$profile_uuid';\n";
echo " window.VERSION_UUID = '$version_uuid';\n";
echo " window.AJAXURL = 'server-ajax.php';\n";
echo " window.ISADMIN = $isadmin;\n";
echo " window.HISTORY = $history;\n";
echo " window.ISPPPROFILE = $ispp;\n";
echo "</script>\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