Commit ba49a457 authored by Kirk Webb's avatar Kirk Webb

Batch of changes that creates a PhantomNet portal branding.

Also includes some PhantomNet-specific restrictions (e.g. only
allows use of the main Utah Emulab testbed  aggregate).

This excercise stretched the limits of what we can reasonably do
before introducing real per-testbed branding/policy mechanisms to
the php/web front-end.  My changes ain't exactly pretty...

Please take care when adding any testbed-specific changes to the
code.  There are three flavors now to consider in the logic.
parent ae566f87
...@@ -148,6 +148,7 @@ AUTOLOAD { ...@@ -148,6 +148,7 @@ AUTOLOAD {
sub Brand($) { return $_[0]->{'BRAND'}; } sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; } sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; }
sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; } sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; }
sub isPNet($) { return $_[0]->Brand()->isPNet() ? 1 : 0; }
sub AggregateList($) { return values(%{ $_[0]->{'AGGREGATES'} }); } sub AggregateList($) { return values(%{ $_[0]->{'AGGREGATES'} }); }
sub AggregateHash($) { return $_[0]->{'AGGREGATES'}; } sub AggregateHash($) { return $_[0]->{'AGGREGATES'}; }
......
...@@ -592,7 +592,8 @@ if (defined($instance)) { ...@@ -592,7 +592,8 @@ if (defined($instance)) {
my $portalLogs = my $portalLogs =
($project->isAPT() ? "aptnet-logs\@flux.utah.edu" : ($project->isAPT() ? "aptnet-logs\@flux.utah.edu" :
$project->isCloud() ? "cloudlab-logs\@flux.utah.edu" : $TBLOGS); $project->isCloud() ? "cloudlab-logs\@flux.utah.edu" :
$project->isPNet() ? "phantomnet-logs\@flux.utah.edu" : $TBLOGS);
$project->SendEmail($portalLogs, "New Profile Created", $project->SendEmail($portalLogs, "New Profile Created",
"Name: ". $profile->versname() . "\n". "Name: ". $profile->versname() . "\n".
......
...@@ -55,6 +55,9 @@ sub Create($$) ...@@ -55,6 +55,9 @@ sub Create($$)
elsif ($brand =~ /cloudlab/) { elsif ($brand =~ /cloudlab/) {
$brand = "cloudlab"; $brand = "cloudlab";
} }
elsif ($brand =~ /phantomnet/) {
$brand = "phantomnet";
}
else { else {
$brand = "emulab"; $brand = "emulab";
} }
...@@ -67,6 +70,7 @@ sub Create($$) ...@@ -67,6 +70,7 @@ sub Create($$)
sub brand($) { return $_[0]->{'BRAND'}; } sub brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->brand() eq "aptlab" ? 1 : 0; } sub isAPT($) { return $_[0]->brand() eq "aptlab" ? 1 : 0; }
sub isCloud($) { return $_[0]->brand() eq "cloudlab" ? 1 : 0; } sub isCloud($) { return $_[0]->brand() eq "cloudlab" ? 1 : 0; }
sub isPNet($) { return $_[0]->brand() eq "phantomnet" ? 1 : 0; }
sub isEmulab($) { return $_[0]->brand() eq "emulab" ? 1 : 0; } sub isEmulab($) { return $_[0]->brand() eq "emulab" ? 1 : 0; }
sub wwwBase($) sub wwwBase($)
...@@ -75,6 +79,7 @@ sub wwwBase($) ...@@ -75,6 +79,7 @@ sub wwwBase($)
return ($self->isAPT() ? "https://www.aptlab.net" : return ($self->isAPT() ? "https://www.aptlab.net" :
$self->isCloud() ? "https://www.cloudlab.us" : $self->isCloud() ? "https://www.cloudlab.us" :
$self->isPNet() ? "https://www.phantomnet.org" :
"@TBBASE@"); "@TBBASE@");
} }
...@@ -84,6 +89,7 @@ sub ApprovalEmailAddress($) ...@@ -84,6 +89,7 @@ sub ApprovalEmailAddress($)
return ($self->isAPT() ? "aptlab-approval\@aptlab.net" : return ($self->isAPT() ? "aptlab-approval\@aptlab.net" :
$self->isCloud() ? "cloudlab-approval\@cloudlab.us" : $self->isCloud() ? "cloudlab-approval\@cloudlab.us" :
$self->isPNet() ? "phantomnet-approval\@phantomnet.org" :
"@TBAPPROVALEMAIL@"); "@TBAPPROVALEMAIL@");
} }
...@@ -93,6 +99,7 @@ sub OpsEmailAddress($) ...@@ -93,6 +99,7 @@ sub OpsEmailAddress($)
return ($self->isAPT() ? "portal-ops\@aptlab.net" : return ($self->isAPT() ? "portal-ops\@aptlab.net" :
$self->isCloud() ? "portal-ops\@cloudlab.us" : $self->isCloud() ? "portal-ops\@cloudlab.us" :
$self->isPNet() ? "portal-ops\@phantomnet.org" :
$TBOPS); $TBOPS);
} }
...@@ -102,6 +109,7 @@ sub LogsEmailAddress($) ...@@ -102,6 +109,7 @@ sub LogsEmailAddress($)
return ($self->isAPT() ? "apt-logs\@aptlab.net" : return ($self->isAPT() ? "apt-logs\@aptlab.net" :
$self->isCloud() ? "cloudlab-logs\@cloudlab.us" : $self->isCloud() ? "cloudlab-logs\@cloudlab.us" :
$self->isPNet() ? "phantomnet-logs\@phantomnet.org" :
$TBLOGS); $TBLOGS);
} }
...@@ -110,7 +118,9 @@ sub EmailTag($) ...@@ -110,7 +118,9 @@ sub EmailTag($)
my ($self) = @_; my ($self) = @_;
return ($self->isAPT() ? "aptlab.net" : return ($self->isAPT() ? "aptlab.net" :
$self->isCloud() ? "cloudlab.us" : "@THISHOMEBASE@"); $self->isCloud() ? "cloudlab.us" :
$self->isPNet() ? "phantomnet.org" :
"@THISHOMEBASE@");
} }
sub SignupURL($$) sub SignupURL($$)
...@@ -119,7 +129,7 @@ sub SignupURL($$) ...@@ -119,7 +129,7 @@ sub SignupURL($$)
my $wwwbase = $self->wwwBase(); my $wwwbase = $self->wwwBase();
my $pid = $project->pid(); my $pid = $project->pid();
return ($self->isAPT() || $self->isCloud() ? return ($self->isAPT() || $self->isCloud() || $self->isPNet() ?
"${wwwbase}/signup.php?pid=$pid" : "${wwwbase}/signup.php?pid=$pid" :
"${wwwbase}/joinproject.php3?target_pid=$pid"); "${wwwbase}/joinproject.php3?target_pid=$pid");
} }
...@@ -128,9 +138,10 @@ sub UsersGroupName($) ...@@ -128,9 +138,10 @@ sub UsersGroupName($)
{ {
my ($self) = @_; my ($self) = @_;
return ($self->isAPT() ? return ($self->isAPT() ? "apt-users\@googlegroups.com" :
"apt-users\@googlegroups.com" : $self->isCloud() ? "cloudlab-users\@googlegroups.com" :
"cloudlab-users\@googlegroups.com"); $self->isPNet() ? "phantomnet-users\@googlegroups.com" :
"emulab-users\@googlegroups.com");
} }
sub UsersGroupURL($) sub UsersGroupURL($)
...@@ -138,8 +149,10 @@ sub UsersGroupURL($) ...@@ -138,8 +149,10 @@ sub UsersGroupURL($)
my ($self) = @_; my ($self) = @_;
my $url = 'https://groups.google.com/forum/#!forum'; my $url = 'https://groups.google.com/forum/#!forum';
return ($self->isAPT() ? return ($self->isAPT() ? "$url/apt-users" :
"$url/apt-users" : "$url/cloudlab-users"); $self->isCloud() ? "$url/cloudlab-users" :
$self->isPNet() ? "$url/phantomnet-users" :
"$url/emulab-users");
} }
# So we can localize MAILTAG variable. # So we can localize MAILTAG variable.
......
...@@ -944,7 +944,7 @@ sub SendJoinEmail($$) ...@@ -944,7 +944,7 @@ sub SendJoinEmail($$)
"ZIP/Postal Code: $usr_zip\n". "ZIP/Postal Code: $usr_zip\n".
"Country: $usr_country\n"; "Country: $usr_country\n";
if ($project->isAPT() || $project->isCloud()) { if ($project->isAPT() || $project->isCloud() || $project->isPNet()) {
my $url = $project->wwwBase() . "/approveuser.php?uid=$uid&pid=$pid"; my $url = $project->wwwBase() . "/approveuser.php?uid=$uid&pid=$pid";
$message .= $message .=
...@@ -1008,7 +1008,7 @@ sub SendApprovalEmail($$$) ...@@ -1008,7 +1008,7 @@ sub SendApprovalEmail($$$)
"as a member of "; "as a member of ";
my $subject = "Membership Approved in '$pid/$gid'"; my $subject = "Membership Approved in '$pid/$gid'";
if ($project->isAPT() || $project->isCloud()) { if ($project->isAPT() || $project->isCloud() || $project->isPNet()) {
my $helpurl = $project->Brand()->UsersGroupURL(); my $helpurl = $project->Brand()->UsersGroupURL();
$message .= "project $pid.\n\n"; $message .= "project $pid.\n\n";
......
...@@ -150,6 +150,7 @@ sub genesis($) { return field($_[0], "genesis"); } ...@@ -150,6 +150,7 @@ sub genesis($) { return field($_[0], "genesis"); }
sub Brand($) { return $_[0]->{'BRAND'}; } sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; } sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; }
sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; } sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; }
sub isPNet($) { return $_[0]->Brand()->isPNet() ? 1 : 0; }
sub isEmulab($) { return $_[0]->Brand()->isEmulab() ? 1 : 0; } sub isEmulab($) { return $_[0]->Brand()->isEmulab() ? 1 : 0; }
# These come from the group not the project. # These come from the group not the project.
......
...@@ -220,6 +220,7 @@ sub genesis($) { return field($_[0], "genesis"); } ...@@ -220,6 +220,7 @@ sub genesis($) { return field($_[0], "genesis"); }
sub Brand($) { return $_[0]->{'BRAND'}; } sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; } sub isAPT($) { return $_[0]->Brand()->isAPT() ? 1 : 0; }
sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; } sub isCloud($) { return $_[0]->Brand()->isCloud() ? 1 : 0; }
sub isPNet($) { return $_[0]->Brand()->isPNet() ? 1 : 0; }
sub isEmulab($) { return $_[0]->Brand()->isEmulab() ? 1 : 0; } sub isEmulab($) { return $_[0]->Brand()->isEmulab() ? 1 : 0; }
# Branding. # Branding.
......
...@@ -132,6 +132,9 @@ if ($this_project->isAPT()) { ...@@ -132,6 +132,9 @@ if ($this_project->isAPT()) {
elseif ($this_project->isCloud()) { elseif ($this_project->isCloud()) {
$APPROVAL_MAIL = "cloudlab-approval@cloudlab.us"; $APPROVAL_MAIL = "cloudlab-approval@cloudlab.us";
} }
elseif ($this_project->isPNet()) {
$APPROVAL_MAIL = "phantomnet-approval@phantomnet.org";
}
# #
# Well, looks like everything is okay. Change the project approval # Well, looks like everything is okay. Change the project approval
......
.navbar img {
margin: 5 auto;
height: 65px;
}
.navbar-static-top {
background-color: #cc0000;
}
.navbar-inner {
background-color: #cc0000;
}
#footer {
background-color: #cc0000;
}
.btn-quickvm-home, .btn-quickvm-home:hover {
background-color: #e8eeef
}
.btn-success {
background-color: #289328;
border-color: #237f23;
}
.btn-primary {
background-color: #660000;
border-color: #b30000;
}
.btn-info {
background-color: #2f64ad;
border-color: #2a5899;
}
.btn-warning {
background-color: #8a7626;
border-color: #766520;
}
.btn-danger {
background-color: #9c2a2a;
border-color: #882525;
}
...@@ -23,11 +23,14 @@ ...@@ -23,11 +23,14 @@
# #
# #
if ($ISCLOUD) { if ($ISAPT) {
$DEFAULT_AGGREGATE = "Utah APT";
}
elseif ($ISCLOUD) {
$DEFAULT_AGGREGATE = "Utah Cloudlab"; $DEFAULT_AGGREGATE = "Utah Cloudlab";
} }
else { elseif ($ISPNET) {
$DEFAULT_AGGREGATE = "Utah APT"; $DEFAULT_AGGREGATE = "Emulab";
} }
$urn_mapping = $urn_mapping =
...@@ -159,6 +162,9 @@ class Instance ...@@ -159,6 +162,9 @@ class Instance
function IsCloud() { function IsCloud() {
return preg_match('/cloudlab/', $this->servername()); return preg_match('/cloudlab/', $this->servername());
} }
function IsPNet() {
return preg_match('/phantomnet/', $this->servername());
}
function aggregate_name() { function aggregate_name() {
global $urn_mapping; global $urn_mapping;
return $urn_mapping[$this->aggregate_urn()]; return $urn_mapping[$this->aggregate_urn()];
...@@ -352,8 +358,20 @@ class Instance ...@@ -352,8 +358,20 @@ class Instance
# Return aggregate based on the current user. # Return aggregate based on the current user.
# #
function DefaultAggregateList() { function DefaultAggregateList() {
global $ISCLOUD; global $ISAPT, $ISCLOUD, $ISPNET;
if ($ISCLOUD) { if ($ISAPT) {
$am_array = array(
'Cloudlab Utah' =>
"urn:publicid:IDN+utah.cloudlab.us+authority+cm",
'APT Utah' =>
"urn:publicid:IDN+apt.emulab.net+authority+cm",
'IG UtahDDC' =>
"urn:publicid:IDN+utahddc.geniracks.net+authority+cm",
'Emulab' =>
"urn:publicid:IDN+emulab.net+authority+cm"
);
}
elseif ($ISCLOUD) {
$am_array = array( $am_array = array(
'Cloudlab Utah' => 'Cloudlab Utah' =>
"urn:publicid:IDN+utah.cloudlab.us+authority+cm", "urn:publicid:IDN+utah.cloudlab.us+authority+cm",
...@@ -374,14 +392,9 @@ class Instance ...@@ -374,14 +392,9 @@ class Instance
$am_array["UKY Emulab"] = $am_array["UKY Emulab"] =
"urn:publicid:IDN+uky.emulab.net+authority+cm"; "urn:publicid:IDN+uky.emulab.net+authority+cm";
} }
} else { }
elseif ($ISPNET) {
$am_array = array( $am_array = array(
'Cloudlab Utah' =>
"urn:publicid:IDN+utah.cloudlab.us+authority+cm",
'APT Utah' =>
"urn:publicid:IDN+apt.emulab.net+authority+cm",
'IG UtahDDC' =>
"urn:publicid:IDN+utahddc.geniracks.net+authority+cm",
'Emulab' => 'Emulab' =>
"urn:publicid:IDN+emulab.net+authority+cm" "urn:publicid:IDN+emulab.net+authority+cm"
); );
......
...@@ -611,7 +611,7 @@ function CheckStep2() ...@@ -611,7 +611,7 @@ function CheckStep2()
{ {
global $this_user; global $this_user;
global $ajax_args; global $ajax_args;
global $ISAPT, $ISCLOUD; global $ISAPT, $ISPNET, $ISCLOUD;
if (!isset($ajax_args["formfields"])) { if (!isset($ajax_args["formfields"])) {
SPITAJAX_ERROR(-1, "Missing formfields"); SPITAJAX_ERROR(-1, "Missing formfields");
...@@ -659,7 +659,7 @@ function CheckStep2() ...@@ -659,7 +659,7 @@ function CheckStep2()
} }
} }
} }
elseif ($ISAPT) { elseif ($ISAPT || $ISPNET) {
# No choice # No choice
; ;
} }
...@@ -714,7 +714,7 @@ function Do_Submit() ...@@ -714,7 +714,7 @@ function Do_Submit()
{ {
global $this_user; global $this_user;
global $ajax_args; global $ajax_args;
global $TBAUTHDOMAIN, $ISAPT; global $TBAUTHDOMAIN, $ISAPT, $ISPNET;
if (!isset($ajax_args["formfields"])) { if (!isset($ajax_args["formfields"])) {
SPITAJAX_ERROR(1, "Missing formfields"); SPITAJAX_ERROR(1, "Missing formfields");
...@@ -761,6 +761,9 @@ function Do_Submit() ...@@ -761,6 +761,9 @@ function Do_Submit()
if ($ISAPT) { if ($ISAPT) {
$aggregate_urn = "urn:publicid:IDN+apt.emulab.net+authority+cm"; $aggregate_urn = "urn:publicid:IDN+apt.emulab.net+authority+cm";
} }
elseif ($ISPNET) {
$aggregate_urn = "urn:publicid:IDN+emulab.net+authority+cm";
}
elseif (isset($formfields["sites"]) && is_array($formfields["sites"])) { elseif (isset($formfields["sites"]) && is_array($formfields["sites"])) {
while (list($siteid, $am) = each($formfields["sites"])) { while (list($siteid, $am) = each($formfields["sites"])) {
if (array_key_exists($am, $am_array)) { if (array_key_exists($am, $am_array)) {
......
...@@ -44,7 +44,7 @@ $this_user = CheckLogin($check_status); ...@@ -44,7 +44,7 @@ $this_user = CheckLogin($check_status);
if (isset($this_user)) { if (isset($this_user)) {
CheckLoginOrDie(CHECKLOGIN_NONLOCAL|CHECKLOGIN_WEBONLY); CheckLoginOrDie(CHECKLOGIN_NONLOCAL|CHECKLOGIN_WEBONLY);
} }
elseif ($ISCLOUD) { elseif ($ISCLOUD || $ISPNET) {
RedirectLoginPage(); RedirectLoginPage();
} }
...@@ -105,6 +105,10 @@ if ($ISCLOUD) { ...@@ -105,6 +105,10 @@ if ($ISCLOUD) {
$profile_default = "OpenStack"; $profile_default = "OpenStack";
$profile_default_pid = "emulab-ops"; $profile_default_pid = "emulab-ops";
} }
elseif ($ISPNET) {
$profile_default = "OneVM";
$profile_default_pid = $TBOPSPID;
}
else { else {
$profile_default = "OneVM"; $profile_default = "OneVM";
$profile_default_pid = $TBOPSPID; $profile_default_pid = $TBOPSPID;
...@@ -296,11 +300,11 @@ $profile_array = $tmp_array; ...@@ -296,11 +300,11 @@ $profile_array = $tmp_array;
function SPITFORM($formfields, $newuser, $errors) function SPITFORM($formfields, $newuser, $errors)
{ {
global $TBBASE, $APTMAIL, $ISCLOUD; global $TBBASE, $APTMAIL, $ISAPT, $ISCLOUD, $ISPNET;
global $profile_array, $this_user, $profilename, $profile, $am_array; global $profile_array, $this_user, $profilename, $profile, $am_array;
global $projlist; global $projlist;
$amlist = array(); $amlist = array();
$showabout = (!$ISCLOUD && !$this_user ? 1 : 0); $showabout = ($ISAPT && !$this_user ? 1 : 0);
$registered = (isset($this_user) ? "true" : "false"); $registered = (isset($this_user) ? "true" : "false");
# We use webonly to mark users that have no project membership # We use webonly to mark users that have no project membership
# at the Geni portal. # at the Geni portal.
...@@ -308,7 +312,7 @@ function SPITFORM($formfields, $newuser, $errors) ...@@ -308,7 +312,7 @@ function SPITFORM($formfields, $newuser, $errors)
$this_user->webonly() ? "true" : "false"); $this_user->webonly() ? "true" : "false");
$cancopy = (isset($this_user) && !$this_user->webonly() ? 1 : 0); $cancopy = (isset($this_user) && !$this_user->webonly() ? 1 : 0);
$nopprspec = (!isset($this_user) ? "true" : "false"); $nopprspec = (!isset($this_user) ? "true" : "false");
$cluster = ($ISCLOUD ? "Cloudlab" : "APT"); $cluster = ($ISCLOUD ? "Cloudlab" : ($ISPNET ? "PhantomNet" : "APT"));
$portal = ""; $portal = "";
$showpicker = (isset($profile) ? 0 : 1); $showpicker = (isset($profile) ? 0 : 1);
if (isset($profilename)) { if (isset($profilename)) {
......
...@@ -40,8 +40,17 @@ function (_, editModalString, editInlineString) ...@@ -40,8 +40,17 @@ function (_, editModalString, editInlineString)
var waitingInstances = []; var waitingInstances = [];
var contextFetched = false; var contextFetched = false;
var contextUrl = 'https://www.emulab.net/protogeni/jacks-context/cloudlab-utah.json'; var contextUrl = "";
if (window.ISCLOUD) if (window.ISCLOUD)
{
contextUrl = 'https://www.emulab.net/protogeni/jacks-context/cloudlab-utah.json';
}
else if (window.ISPNET)
{
contextUrl = 'https://www.emulab.net/protogeni/jacks-context/phantomnet.json';
}
if (window.ISCLOUD || window.ISPNET)
{ {
$('#edit_topo_modal_button').prop('disabled', true); $('#edit_topo_modal_button').prop('disabled', true);
$.get(contextUrl).then(contextReady, contextFail); $.get(contextUrl).then(contextReady, contextFail);
......
...@@ -56,7 +56,8 @@ function (_, sup, moment, mainString, helpString) ...@@ -56,7 +56,8 @@ function (_, sup, moment, mainString, helpString)
embedded: window.EMBEDDED, embedded: window.EMBEDDED,
editing: editing, editing: editing,
isadmin: isadmin, isadmin: isadmin,
sitename: (window.ISCLOUD ? "CloudLab" : "APT"), sitename: (window.ISCLOUD ? "CloudLab" :
(window.ISPNET ? "PhantomNet" : "APT")),
}); });
html = formatter(html, errors).html(); html = formatter(html, errors).html();
$('#main-body').html(html); $('#main-body').html(html);
......
...@@ -4,11 +4,12 @@ require(window.APT_OPTIONS.configObject, ...@@ -4,11 +4,12 @@ require(window.APT_OPTIONS.configObject,
'js/lib/text!template/instantiate.html', 'js/lib/text!template/instantiate.html',
'js/lib/text!template/aboutapt.html', 'js/lib/text!template/aboutapt.html',
'js/lib/text!template/aboutcloudlab.html', 'js/lib/text!template/aboutcloudlab.html',
'js/lib/text!template/aboutpnet.html',
'js/lib/text!template/waitwait-modal.html', 'js/lib/text!template/waitwait-modal.html',
'js/lib/text!template/rspectextview-modal.html', 'js/lib/text!template/rspectextview-modal.html',
'formhelpers', 'filestyle', 'marked', 'jacks', 'jquery-steps'], 'formhelpers', 'filestyle', 'marked', 'jacks', 'jquery-steps'],
function (_, Constraints, sup, ppstart, JacksEditor, wt, function (_, Constraints, sup, ppstart, JacksEditor, wt,
instantiateString, aboutaptString, aboutcloudString, instantiateString, aboutaptString, aboutcloudString, aboutpnetString,
waitwaitString, rspecviewString) waitwaitString, rspecviewString)
{ {
'use strict'; 'use strict';
...@@ -82,7 +83,8 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt, ...@@ -82,7 +83,8 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
profilevers: window.PROFILEVERS, profilevers: window.PROFILEVERS,
showpicker: showpicker, showpicker: showpicker,
cancopy: window.CANCOPY, cancopy: window.CANCOPY,
clustername: (window.ISCLOUD ? "CloudLab" : "APT"), clustername: (window.ISCLOUD ? "CloudLab" :
(window.ISPNET ? "PhantomNet" : "APT")),
}); });
$('#main-body').html(html); $('#main-body').html(html);
...@@ -99,8 +101,9 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt, ...@@ -99,8 +101,9 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
$('#rspecview_div').html(rspecviewString); $('#rspecview_div').html(rspecviewString);
// The about panel. // The about panel.
if (window.SHOWABOUT) { if (window.SHOWABOUT) {
$('#about_div').html(window.ISCLOUD ? $('#about_div').html(window.ISCLOUD ? aboutcloudString :
aboutcloudString : aboutaptString); (window.ISPNET ? aboutpnetString :
aboutaptString));
} }
$('#stepsContainer').steps({ $('#stepsContainer').steps({
headerTag: "h3", headerTag: "h3",
......
...@@ -112,6 +112,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart, ...@@ -112,6 +112,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
snapuuid: (window.SNAPUUID || null), snapuuid: (window.SNAPUUID || null),
general_error: (errors.error || ''), general_error: (errors.error || ''),
iscloud: window.ISCLOUD, iscloud: window.ISCLOUD,
ispnet: window.ISPNET,
disabled: window.DISABLED, disabled: window.DISABLED,
versions: versions, versions: versions,
withpublishing: window.WITHPUBLISHING, withpublishing: window.WITHPUBLISHING,
......
...@@ -20,11 +20,13 @@ function (_, sup, ...@@ -20,11 +20,13 @@ function (_, sup,
var projectTemplate = _.template(projectString); var projectTemplate = _.template(projectString);
var signupTemplate = _.template(signupString); var signupTemplate = _.template(signupString);
var ISCLOUD = 0; var ISCLOUD = 0;
var ISPNET = 0;
function initialize() function initialize()
{ {
window.APT_OPTIONS.initialize(sup); window.APT_OPTIONS.initialize(sup);
ISCLOUD = window.ISCLOUD; ISCLOUD = window.ISCLOUD;
ISPNET = window.ISPNET;
$('#toomany_div').html(toomanyString); $('#toomany_div').html(toomanyString);
var fields = JSON.parse(_.unescape($('#form-json')[0].textContent)); var fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
...@@ -77,7 +79,7 @@ function (_, sup, ...@@ -77,7 +79,7 @@ function (_, sup,
var signup = signupTemplate({ var signup = signupTemplate({
button_label: buttonLabel, button_label: buttonLabel,
general_error: (errors.error || ''), general_error: (errors.error || ''),
about_account: (ISCLOUD || thisUser ? null : about), about_account: (ISCLOUD || ISPNET || thisUser ? null : about),
this_user: thisUser, this_user: thisUser,
promoting: promoting, promoting: promoting,
joinproject: joinproject, joinproject: joinproject,
......
...@@ -60,7 +60,9 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal, ...@@ -60,7 +60,9 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
var instanceStatus = window.APT_OPTIONS.instanceStatus; var instanceStatus = window.APT_OPTIONS.instanceStatus;
var errorURL = (window.ISCLOUD ? var errorURL = (window.ISCLOUD ?
"https://groups.google.com/d/forum/cloudlab-users" : "https://groups.google.com/d/forum/cloudlab-users" :
"https://groups.google.com/d/forum/apt-users"); (windwow.ISPNET ?
"https://groups.google.com/d/forum/phantomnet-users" :
"https://groups.google.com/d/forum/apt-users"));
// Generate the templates. // Generate the templates.
var template_args = { var template_args = {
......
...@@ -33,7 +33,7 @@ include_once("instance_defs.php"); ...@@ -33,7 +33,7 @@ include_once("instance_defs.php");
# #
RedirectSecure(); RedirectSecure();
$this_user = CheckLogin($check_status); $this_user = CheckLogin($check_status);
if ($ISCLOUD) { if ($ISCLOUD || $ISPNET) {
if (! ($CHECKLOGIN_STATUS & CHECKLOGIN_LOGGEDIN)) { if (! ($CHECKLOGIN_STATUS & CHECKLOGIN_LOGGEDIN)) {
header("Location: login.php"); header("Location: login.php");
return; return;
......
...@@ -88,8 +88,10 @@ if (NOLOGINS()) { ...@@ -88,8 +88,10 @@ if (NOLOGINS()) {
function SPITFORM($uid, $referrer, $error) function SPITFORM($uid, $referrer, $error)
{ {
global $TBDB_UIDLEN, $TBBASE, $refer; global $TBDB_UIDLEN, $TBBASE, $refer;
global $ISAPT, $ISCLOUD, $showguestlogin; global $ISAPT, $ISCLOUD, $ISPNET, $showguestlogin;
$pwlab = ($ISAPT ? "Aptlab.net" : "CloudLab.us") . $pwlab = ($ISAPT ? "Aptlab.net" :
($ISCLOUD ? "CloudLab.us" :
($ISPNET ? "PhantomNet.org" : ""))) .
" or Emulab.net Username"; " or Emulab.net Username";
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
......
...@@ -58,7 +58,8 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING, ...@@ -58,7 +58,8 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING,
function SPITFORM($formfields, $errors) function SPITFORM($formfields, $errors)
{ {
global $this_user, $projlist, $action, $profile, $DEFAULT_AGGREGATE; global $this_user, $projlist, $action, $profile, $DEFAULT_AGGREGATE;
global $notifyupdate, $notifyclone, $copyuuid, $snapuuid, $am_array, $ISCLOUD; global $notifyupdate, $notifyclone, $copyuuid, $snapuuid, $am_array;
global $ISCLOUD, $ISPNET;
global $version_array, $WITHPUBLISHING; global $version_array, $WITHPUBLISHING;
$viewing = 0; $viewing = 0;
$candelete = 0; $candelete = 0;
...@@ -199,6 +200,11 @@ function SPITFORM($formfields, $errors) ...@@ -199,6 +200,11 @@ function SPITFORM($formfields, $errors)
} else { } else {
echo " window.ISCLOUD = false;\n"; echo " window.ISCLOUD = false;\n";
} }
if ($ISPNET) {
echo " window.ISPNET = true;";
} else {
echo " window.ISPNET = false;";
}
if (isset($copyuuid)) { if (isset($copyuuid)) {
echo " window.COPYUUID = '$copyuuid';\n"; echo " window.COPYUUID = '$copyuuid';\n";
} }
......
...@@ -238,11 +238,11 @@ class Profile ...@@ -238,11 +238,11 @@ class Profile
# URL. To the specific version of the profile.