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 {
sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 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 AggregateHash($) { return $_[0]->{'AGGREGATES'}; }
......
......@@ -592,7 +592,8 @@ if (defined($instance)) {
my $portalLogs =
($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",
"Name: ". $profile->versname() . "\n".
......
......@@ -55,6 +55,9 @@ sub Create($$)
elsif ($brand =~ /cloudlab/) {
$brand = "cloudlab";
}
elsif ($brand =~ /phantomnet/) {
$brand = "phantomnet";
}
else {
$brand = "emulab";
}
......@@ -67,6 +70,7 @@ sub Create($$)
sub brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->brand() eq "aptlab" ? 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 wwwBase($)
......@@ -75,6 +79,7 @@ sub wwwBase($)
return ($self->isAPT() ? "https://www.aptlab.net" :
$self->isCloud() ? "https://www.cloudlab.us" :
$self->isPNet() ? "https://www.phantomnet.org" :
"@TBBASE@");
}
......@@ -84,6 +89,7 @@ sub ApprovalEmailAddress($)
return ($self->isAPT() ? "aptlab-approval\@aptlab.net" :
$self->isCloud() ? "cloudlab-approval\@cloudlab.us" :
$self->isPNet() ? "phantomnet-approval\@phantomnet.org" :
"@TBAPPROVALEMAIL@");
}
......@@ -93,6 +99,7 @@ sub OpsEmailAddress($)
return ($self->isAPT() ? "portal-ops\@aptlab.net" :
$self->isCloud() ? "portal-ops\@cloudlab.us" :
$self->isPNet() ? "portal-ops\@phantomnet.org" :
$TBOPS);
}
......@@ -102,6 +109,7 @@ sub LogsEmailAddress($)
return ($self->isAPT() ? "apt-logs\@aptlab.net" :
$self->isCloud() ? "cloudlab-logs\@cloudlab.us" :
$self->isPNet() ? "phantomnet-logs\@phantomnet.org" :
$TBLOGS);
}
......@@ -110,7 +118,9 @@ sub EmailTag($)
my ($self) = @_;
return ($self->isAPT() ? "aptlab.net" :
$self->isCloud() ? "cloudlab.us" : "@THISHOMEBASE@");
$self->isCloud() ? "cloudlab.us" :
$self->isPNet() ? "phantomnet.org" :
"@THISHOMEBASE@");
}
sub SignupURL($$)
......@@ -119,7 +129,7 @@ sub SignupURL($$)
my $wwwbase = $self->wwwBase();
my $pid = $project->pid();
return ($self->isAPT() || $self->isCloud() ?
return ($self->isAPT() || $self->isCloud() || $self->isPNet() ?
"${wwwbase}/signup.php?pid=$pid" :
"${wwwbase}/joinproject.php3?target_pid=$pid");
}
......@@ -128,9 +138,10 @@ sub UsersGroupName($)
{
my ($self) = @_;
return ($self->isAPT() ?
"apt-users\@googlegroups.com" :
"cloudlab-users\@googlegroups.com");
return ($self->isAPT() ? "apt-users\@googlegroups.com" :
$self->isCloud() ? "cloudlab-users\@googlegroups.com" :
$self->isPNet() ? "phantomnet-users\@googlegroups.com" :
"emulab-users\@googlegroups.com");
}
sub UsersGroupURL($)
......@@ -138,8 +149,10 @@ sub UsersGroupURL($)
my ($self) = @_;
my $url = 'https://groups.google.com/forum/#!forum';
return ($self->isAPT() ?
"$url/apt-users" : "$url/cloudlab-users");
return ($self->isAPT() ? "$url/apt-users" :
$self->isCloud() ? "$url/cloudlab-users" :
$self->isPNet() ? "$url/phantomnet-users" :
"$url/emulab-users");
}
# So we can localize MAILTAG variable.
......
......@@ -944,7 +944,7 @@ sub SendJoinEmail($$)
"ZIP/Postal Code: $usr_zip\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";
$message .=
......@@ -1008,7 +1008,7 @@ sub SendApprovalEmail($$$)
"as a member of ";
my $subject = "Membership Approved in '$pid/$gid'";
if ($project->isAPT() || $project->isCloud()) {
if ($project->isAPT() || $project->isCloud() || $project->isPNet()) {
my $helpurl = $project->Brand()->UsersGroupURL();
$message .= "project $pid.\n\n";
......
......@@ -150,6 +150,7 @@ sub genesis($) { return field($_[0], "genesis"); }
sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 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; }
# These come from the group not the project.
......
......@@ -220,6 +220,7 @@ sub genesis($) { return field($_[0], "genesis"); }
sub Brand($) { return $_[0]->{'BRAND'}; }
sub isAPT($) { return $_[0]->Brand()->isAPT() ? 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; }
# Branding.
......
......@@ -132,6 +132,9 @@ if ($this_project->isAPT()) {
elseif ($this_project->isCloud()) {
$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
......
.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 @@
#
#
if ($ISCLOUD) {
if ($ISAPT) {
$DEFAULT_AGGREGATE = "Utah APT";
}
elseif ($ISCLOUD) {
$DEFAULT_AGGREGATE = "Utah Cloudlab";
}
else {
$DEFAULT_AGGREGATE = "Utah APT";
elseif ($ISPNET) {
$DEFAULT_AGGREGATE = "Emulab";
}
$urn_mapping =
......@@ -159,6 +162,9 @@ class Instance
function IsCloud() {
return preg_match('/cloudlab/', $this->servername());
}
function IsPNet() {
return preg_match('/phantomnet/', $this->servername());
}
function aggregate_name() {
global $urn_mapping;
return $urn_mapping[$this->aggregate_urn()];
......@@ -352,8 +358,20 @@ class Instance
# Return aggregate based on the current user.
#
function DefaultAggregateList() {
global $ISCLOUD;
if ($ISCLOUD) {
global $ISAPT, $ISCLOUD, $ISPNET;
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(
'Cloudlab Utah' =>
"urn:publicid:IDN+utah.cloudlab.us+authority+cm",
......@@ -374,14 +392,9 @@ class Instance
$am_array["UKY Emulab"] =
"urn:publicid:IDN+uky.emulab.net+authority+cm";
}
} else {
}
elseif ($ISPNET) {
$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"
);
......
......@@ -611,7 +611,7 @@ function CheckStep2()
{
global $this_user;
global $ajax_args;
global $ISAPT, $ISCLOUD;
global $ISAPT, $ISPNET, $ISCLOUD;
if (!isset($ajax_args["formfields"])) {
SPITAJAX_ERROR(-1, "Missing formfields");
......@@ -659,7 +659,7 @@ function CheckStep2()
}
}
}
elseif ($ISAPT) {
elseif ($ISAPT || $ISPNET) {
# No choice
;
}
......@@ -714,7 +714,7 @@ function Do_Submit()
{
global $this_user;
global $ajax_args;
global $TBAUTHDOMAIN, $ISAPT;
global $TBAUTHDOMAIN, $ISAPT, $ISPNET;
if (!isset($ajax_args["formfields"])) {
SPITAJAX_ERROR(1, "Missing formfields");
......@@ -761,6 +761,9 @@ function Do_Submit()
if ($ISAPT) {
$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"])) {
while (list($siteid, $am) = each($formfields["sites"])) {
if (array_key_exists($am, $am_array)) {
......
......@@ -44,7 +44,7 @@ $this_user = CheckLogin($check_status);
if (isset($this_user)) {
CheckLoginOrDie(CHECKLOGIN_NONLOCAL|CHECKLOGIN_WEBONLY);
}
elseif ($ISCLOUD) {
elseif ($ISCLOUD || $ISPNET) {
RedirectLoginPage();
}
......@@ -105,6 +105,10 @@ if ($ISCLOUD) {
$profile_default = "OpenStack";
$profile_default_pid = "emulab-ops";
}
elseif ($ISPNET) {
$profile_default = "OneVM";
$profile_default_pid = $TBOPSPID;
}
else {
$profile_default = "OneVM";
$profile_default_pid = $TBOPSPID;
......@@ -296,11 +300,11 @@ $profile_array = $tmp_array;
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 $projlist;
$amlist = array();
$showabout = (!$ISCLOUD && !$this_user ? 1 : 0);
$showabout = ($ISAPT && !$this_user ? 1 : 0);
$registered = (isset($this_user) ? "true" : "false");
# We use webonly to mark users that have no project membership
# at the Geni portal.
......@@ -308,7 +312,7 @@ function SPITFORM($formfields, $newuser, $errors)
$this_user->webonly() ? "true" : "false");
$cancopy = (isset($this_user) && !$this_user->webonly() ? 1 : 0);
$nopprspec = (!isset($this_user) ? "true" : "false");
$cluster = ($ISCLOUD ? "Cloudlab" : "APT");
$cluster = ($ISCLOUD ? "Cloudlab" : ($ISPNET ? "PhantomNet" : "APT"));
$portal = "";
$showpicker = (isset($profile) ? 0 : 1);
if (isset($profilename)) {
......
......@@ -40,8 +40,17 @@ function (_, editModalString, editInlineString)
var waitingInstances = [];
var contextFetched = false;
var contextUrl = 'https://www.emulab.net/protogeni/jacks-context/cloudlab-utah.json';
var contextUrl = "";
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);
$.get(contextUrl).then(contextReady, contextFail);
......
......@@ -56,7 +56,8 @@ function (_, sup, moment, mainString, helpString)
embedded: window.EMBEDDED,
editing: editing,
isadmin: isadmin,
sitename: (window.ISCLOUD ? "CloudLab" : "APT"),
sitename: (window.ISCLOUD ? "CloudLab" :
(window.ISPNET ? "PhantomNet" : "APT")),
});
html = formatter(html, errors).html();
$('#main-body').html(html);
......
......@@ -4,11 +4,12 @@ require(window.APT_OPTIONS.configObject,
'js/lib/text!template/instantiate.html',
'js/lib/text!template/aboutapt.html',
'js/lib/text!template/aboutcloudlab.html',
'js/lib/text!template/aboutpnet.html',
'js/lib/text!template/waitwait-modal.html',
'js/lib/text!template/rspectextview-modal.html',
'formhelpers', 'filestyle', 'marked', 'jacks', 'jquery-steps'],
function (_, Constraints, sup, ppstart, JacksEditor, wt,
instantiateString, aboutaptString, aboutcloudString,
instantiateString, aboutaptString, aboutcloudString, aboutpnetString,
waitwaitString, rspecviewString)
{
'use strict';
......@@ -82,7 +83,8 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
profilevers: window.PROFILEVERS,
showpicker: showpicker,
cancopy: window.CANCOPY,
clustername: (window.ISCLOUD ? "CloudLab" : "APT"),
clustername: (window.ISCLOUD ? "CloudLab" :
(window.ISPNET ? "PhantomNet" : "APT")),
});
$('#main-body').html(html);
......@@ -99,8 +101,9 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
$('#rspecview_div').html(rspecviewString);
// The about panel.
if (window.SHOWABOUT) {
$('#about_div').html(window.ISCLOUD ?
aboutcloudString : aboutaptString);
$('#about_div').html(window.ISCLOUD ? aboutcloudString :
(window.ISPNET ? aboutpnetString :
aboutaptString));
}
$('#stepsContainer').steps({
headerTag: "h3",
......
......@@ -112,6 +112,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
snapuuid: (window.SNAPUUID || null),
general_error: (errors.error || ''),
iscloud: window.ISCLOUD,
ispnet: window.ISPNET,
disabled: window.DISABLED,
versions: versions,
withpublishing: window.WITHPUBLISHING,
......
......@@ -20,11 +20,13 @@ function (_, sup,
var projectTemplate = _.template(projectString);
var signupTemplate = _.template(signupString);
var ISCLOUD = 0;
var ISPNET = 0;
function initialize()
{
window.APT_OPTIONS.initialize(sup);
ISCLOUD = window.ISCLOUD;
ISPNET = window.ISPNET;
$('#toomany_div').html(toomanyString);
var fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
......@@ -77,7 +79,7 @@ function (_, sup,
var signup = signupTemplate({
button_label: buttonLabel,
general_error: (errors.error || ''),
about_account: (ISCLOUD || thisUser ? null : about),
about_account: (ISCLOUD || ISPNET || thisUser ? null : about),
this_user: thisUser,
promoting: promoting,
joinproject: joinproject,
......
......@@ -60,7 +60,9 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
var instanceStatus = window.APT_OPTIONS.instanceStatus;
var errorURL = (window.ISCLOUD ?
"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.
var template_args = {
......
......@@ -33,7 +33,7 @@ include_once("instance_defs.php");
#
RedirectSecure();
$this_user = CheckLogin($check_status);
if ($ISCLOUD) {
if ($ISCLOUD || $ISPNET) {
if (! ($CHECKLOGIN_STATUS & CHECKLOGIN_LOGGEDIN)) {
header("Location: login.php");
return;
......
......@@ -88,8 +88,10 @@ if (NOLOGINS()) {
function SPITFORM($uid, $referrer, $error)
{
global $TBDB_UIDLEN, $TBBASE, $refer;
global $ISAPT, $ISCLOUD, $showguestlogin;
$pwlab = ($ISAPT ? "Aptlab.net" : "CloudLab.us") .
global $ISAPT, $ISCLOUD, $ISPNET, $showguestlogin;
$pwlab = ($ISAPT ? "Aptlab.net" :
($ISCLOUD ? "CloudLab.us" :
($ISPNET ? "PhantomNet.org" : ""))) .
" or Emulab.net Username";
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
......
......@@ -58,7 +58,8 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING,
function SPITFORM($formfields, $errors)
{
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;
$viewing = 0;
$candelete = 0;
......@@ -199,6 +200,11 @@ function SPITFORM($formfields, $errors)
} else {
echo " window.ISCLOUD = false;\n";
}
if ($ISPNET) {
echo " window.ISPNET = true;";
} else {
echo " window.ISPNET = false;";
}
if (isset($copyuuid)) {
echo " window.COPYUUID = '$copyuuid';\n";
}
......
......@@ -238,11 +238,11 @@ class Profile
# URL. To the specific version of the profile.
#
function URL() {
global $APTBASE, $ISVSERVER, $ISCLOUD;
global $APTBASE, $ISVSERVER, $ISCLOUD, $ISPNET;
$uuid = $this->uuid();
if ($this->ispublic() || ($ISCLOUD && $this->shared())) {
if ($this->ispublic() || (($ISCLOUD || $ISPNET) && $this->shared())) {
$pid = $this->pid();
$name = $this->name();
$vers = $this->version();
......@@ -259,11 +259,11 @@ class Profile
}
# And the URL of the profile itself.
function ProfileURL() {
global $APTBASE, $ISVSERVER, $ISCLOUD;
global $APTBASE, $ISVSERVER, $ISCLOUD, $ISPNET;
$uuid = $this->profile_uuid();
if ($this->ispublic() || ($ISCLOUD && $this->shared())) {
if ($this->ispublic() || (($ISCLOUD || $ISPNET) && $this->shared())) {
$pid = $this->pid();
$name = $this->name();
if ($ISVSERVER)
......
......@@ -34,6 +34,7 @@ $APTLOGO = "aptlogo.png";
$APTSTYLE = "apt.css";
$ISAPT = 1;
$ISCLOUD = 0;
$ISPNET = 0;
$ISVSERVER = 0;
$GOOGLEUA = 'UA-45161989-1';
# See tbauth.php3
......@@ -109,6 +110,30 @@ elseif (0 || ($TBMAINSITE && $_SERVER["SERVER_NAME"] == "www.cloudlab.us")) {
$APTBASE .= "/" . $matches[1];
}
}
elseif ($TBMAINSITE && $_SERVER["SERVER_NAME"] == "www.phantomnet.org") {
$ISVSERVER = 1;
$TBAUTHDOMAIN = ".phantomnet.org";
$COOKDIEDOMAIN= "www.phantomnet.org";
$APTHOST = "www.phantomnet.org";
$WWWHOST = "www.phantomnet.org";
$APTBASE = "https://www.phantomnet.org";
$APTMAIL = "PhantomNet Operations <portal-ops@phantomnet.org>";
$APTTITLE = "PhantomNet";
$FAVICON = "phantomnet.ico";
$APTLOGO = "phantomlogo.png";
$APTSTYLE = "phantomnet.css";
$ISAPT = 0;
$ISPNET = 1;
#$GOOGLEUA = 'UA-42844769-2';
$TBMAILTAG = "phantomnet.org";
$EXTENSIONS = "portal-extensions@phantomnet.org";
$TBAUTHTIMEOUT= (24 * 3600 * 14);
# For devel trees
if (preg_match("/\/([\w\/]+)$/", $WWW, $matches)) {
$APTBASE .= "/" . $matches[1];
}
}
# For backend scripts to know how they were invoked.
if (isset($_SERVER['SERVER_NAME'])) {
putenv("SERVER_NAME=" . $_SERVER['SERVER_NAME']);
......@@ -118,14 +143,15 @@ if (isset($_SERVER['SERVER_NAME'])) {
# Redefine this so APT errors are styled properly. Called by PAGEERROR();.
#
$PAGEERROR_HANDLER = function($msg, $status_code = 0) {
global $drewheader, $ISAPT, $spatrequired;
global $drewheader, $ISCLOUD, $ISPNET, $spatrequired;
if (! $drewheader) {
SPITHEADER();
}
echo $msg;
echo "<script type='text/javascript'>\n";
echo " window.ISCLOUD = " . ($ISAPT ? "0" : "1") . ";\n";
echo " window.ISCLOUD = " . ($ISCLOUD ? "1" : "0") . ";\n";
echo " window.ISPNET = " . ($ISPNET ? "1" : "0") . ";\n";
echo "</script>\n";
if (!$spatrequired) {
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
......@@ -141,7 +167,7 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
$ignore2 = NULL, $ignore3 = NULL)
{
global $TBMAINSITE, $APTTITLE, $FAVICON, $APTLOGO, $APTSTYLE, $ISAPT;
global $GOOGLEUA, $ISCLOUD;
global $GOOGLEUA, $ISCLOUD, $ISPNET;
global $login_user, $login_status;
global $disable_accounts, $page_title, $drewheader, $embedded;
$title = $APTTITLE;
......@@ -175,9 +201,12 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
</head>
<body style='display: none;'>\n";
$manual = ($ISAPT ? "http://docs.aptlab.net" : "http://docs.cloudlab.us");
$manual = ($ISAPT ? "http://docs.aptlab.net" :
($ISCLOUD ? "http://docs.cloudlab.us" :
($ISPNET ? "http://wiki.phantomnet.org" : "")));
echo "<script type='text/javascript'>\n";
echo " window.ISCLOUD = " . ($ISAPT ? "0" : "1") . ";\n";
echo " window.ISCLOUD = " . ($ISCLOUD ? "1" : "0") . ";\n";
echo " window.ISPNET = " . ($ISPNET ? "1" : "0") . ";\n";
echo " window.MANUAL = '$manual';\n";
echo " window.EMBEDDED = $embedded;\n";
echo "</script>\n";
......@@ -268,10 +297,14 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
echo " <li class='apt-left'><form><a class='btn btn-quickvm-home navbar-btn'
href='http://docs.aptlab.net' target='_blank'>Manual</a></form></li>\n";
}
if ($ISCLOUD) {
elseif ($ISCLOUD) {
echo " <li class='apt-left'><form><a class='btn btn-quickvm-home navbar-btn'
href='http://docs.cloudlab.us' target='_blank'>Manual</a></form></li>\n";
}
elseif ($ISPNET) {
echo " <li class='apt-left'><form><a class='btn btn-quickvm-home navbar-btn'
href='http://wiki.phantomnet.org' target='_blank'>Wiki</a></form></li>\n";
}
if ($login_user && !($login_status & CHECKLOGIN_WEBONLY)) {
echo " <li id='quickvm_actions_menu' class='dropdown apt-left'> ".
"<a href='#' class='dropdown-toggle' data-toggle='dropdown'>
......@@ -318,12 +351,15 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
# Put the special message, if any, right below the header. Note that the
# negative margin is to put it flush below the navbar without having to
# permanently remove the bottom margin on the navbar
if ($ISCLOUD) {
$message = TBGetSiteVar("cloudlab/message");
}
else {
if ($ISAPT) {
$message = TBGetSiteVar("aptlab/message");
}
elseif ($ISCLOUD) {
$message = TBGetSiteVar("cloudlab/message");
}
elseif ($ISPNET) {
$message = TBGetSiteVar("phantomnet/message");
}
if ($message != "") {
echo "<div class='alert alert-warning alert-dismissible'
role='alert' style='margin-top: -10px'>
......@@ -381,8 +417,10 @@ function SPITHEADER($thinheader = 0,
}
$PAGEFOOTER_FUNCTION = function($ignored = NULL) {
global $ISAPT, $embedded;
$groupname = ($ISAPT ? "apt-users" : "cloudlab-users");
global $ISAPT, $ISCLOUD, $ISPNET, $embedded;
$groupname = ($ISAPT ? "apt-users" :
($ISCLOUD ? "cloudlab-users" :
($ISPNET ? "phantomnet-users" : "")));
echo "</div>
</div>\n";
......@@ -516,8 +554,10 @@ function SpitVerifyModal($id, $label)
#
function SpitLoginModal($id)
{
global $APTTITLE, $ISAPT, $ISCLOUD;
$pwlab = ($ISAPT ? "Aptlab.net" : "CloudLab.us") .
global $APTTITLE, $ISAPT, $ISCLOUD, $ISPNET;
$pwlab = ($ISAPT ? "Aptlab.net" :
($ISCLOUD ? "CloudLab.us" :
($ISPNET ? "PhantomNet.org" : ""))) .
" or Emulab.net Username";
$pwlab = "$pwlab";
$referrer = CleanString($_SERVER['REQUEST_URI']);
......@@ -633,8 +673,10 @@ function SpitOopsModal($id)
function SpitNSFModal()
{
global $ISAPT;
$nsfnumber = ($ISAPT ? "CNS-1338155" : "CNS-1302688");
global $ISAPT, $ISCLOUD, $ISPNET;
$nsfnumber = ($ISAPT ? "CNS-1338155" :
($ISCLOUD ? "CNS-1302688" :
($ISPNET ? "CNS-XXXXXXX" : "")));
echo "<!-- This is the NSF Supported modal -->
<div id='nsf_supported_modal' class='modal fade'>
......
......@@ -419,7 +419,9 @@ if (!$this_user) {
# Force initial SSL cert generation.
$args["passphrase"] = $formfields["password1"];
# Flag to the backend.
$args["genesis"] = ($ISAPT ? "aptlab" : "cloudlab");
$args["genesis"] = ($ISAPT ? "aptlab" :
($ISPNET ? "phantomnet" :
"cloudlab"));
#
# Backend verifies pubkey and returns error. We first look for a
......@@ -515,9 +517,9 @@ $args["linkedtous"] = 1;
$args["plab"] = 0;
$args["ron"] = 0;
$args["funders"] = "None";
$args["whynotpublic"] = ($ISAPT ? "aptlab" : "cloudlab");
$args["whynotpublic"] = ($ISAPT ? "aptlab" : ($ISPNET ? "phantomnet" : "cloudlab"));
# Flag to the backend.
$args["genesis"] = ($ISAPT ? "aptlab" : "cloudlab");
$args["genesis"] = ($ISAPT ? "aptlab" : ($ISPNET ? "phantomnet" : "cloudlab"));
if (! ($project = Project::NewNewProject($args, $error))) {
$errors["error"] = $error;
......
<center>
<a href="http://www.phantomnet.org">
<h4>What is PhantomNet?</h4><a>
</h5>
</center>
......@@ -324,7 +324,7 @@
<% if (formfields.profile_who == "public") {
<