Commit d498b351 authored by Leigh Stoller's avatar Leigh Stoller

Checkpoint Powder portal changes and files.

parent cd405440
......@@ -186,6 +186,7 @@ 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 isPowder($) { return $_[0]->Brand()->isPowder() ? 1 : 0; }
sub AggregateList($) { return values(%{ $_[0]->{'AGGREGATES'} }); }
sub AggregateHash($) { return $_[0]->{'AGGREGATES'}; }
......
......@@ -580,7 +580,9 @@ sub CreateProfile()
my $portalLogs =
($project->isAPT() ? "aptnet-logs\@flux.utah.edu" :
$project->isCloud() ? "cloudlab-logs\@flux.utah.edu" :
$project->isPNet() ? "phantomnet-logs\@flux.utah.edu" : $TBLOGS);
$project->isPNet() ? "phantomnet-logs\@flux.utah.edu" :
$project->isPowder() ? "powder-logs\@flux.utah.edu" :
$TBLOGS);
$project->SendEmail($portalLogs, "New Profile Created",
"Name: ". $profile->versname() . "\n".
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2005-2016 University of Utah and the Flux Group.
# Copyright (c) 2005-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -62,6 +62,9 @@ sub Create($$)
elsif ($brand =~ /phantomnet/) {
$brand = "phantomnet";
}
elsif ($brand =~ /powder/) {
$brand = "powder";
}
else {
# This means the new Portal interface.
$brand = "emulab";
......@@ -76,6 +79,7 @@ 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 isPowder($) { return $_[0]->brand() eq "powder" ? 1 : 0; }
sub isEmulab($) { return $_[0]->brand() eq "emulab" ? 1 : 0; }
sub isClassic($) { return $_[0]->brand() eq "classic" ? 1 : 0; }
......@@ -86,6 +90,7 @@ sub wwwBase($)
return ($self->isAPT() ? "https://www.aptlab.net" :
$self->isCloud() ? "https://www.cloudlab.us" :
$self->isPNet() ? "https://www.phantomnet.org" :
$self->isPowder() ? "@TBBASE@" . "/portal" :
$self->isEmulab() ? "@TBBASE@" . "/portal" :
"@TBBASE@");
}
......@@ -97,6 +102,7 @@ sub ApprovalEmailAddress($)
return ($self->isAPT() ? "aptlab-approval\@aptlab.net" :
$self->isCloud() ? "cloudlab-approval\@cloudlab.us" :
$self->isPNet() ? "phantomnet-approval\@phantomnet.org" :
$self->isPowder() ? "powder-approval\@powderwireless.net" :
"@TBAPPROVALEMAIL@");
}
......@@ -107,6 +113,7 @@ sub OpsEmailAddress($)
return ($self->isAPT() ? "portal-ops\@aptlab.net" :
$self->isCloud() ? "portal-ops\@cloudlab.us" :
$self->isPNet() ? "portal-ops\@phantomnet.org" :
$self->isPowder() ? "portal-ops\@powderwireless.net" :
$TBOPS);
}
......@@ -117,6 +124,7 @@ sub LogsEmailAddress($)
return ($self->isAPT() ? "apt-logs\@aptlab.net" :
$self->isCloud() ? "cloudlab-logs\@cloudlab.us" :
$self->isPNet() ? "phantomnet-logs\@phantomnet.org" :
$self->isPowder() ? "portal-logs\@portal.org" :
$TBLOGS);
}
......@@ -127,6 +135,7 @@ sub ExtensionsEmailAddress($)
return ($self->isAPT() ? "portal-extensions\@aptlab.net" :
$self->isCloud() ? "portal-extensions\@cloudlab.us" :
$self->isPNet() ? "portal-extensions\@phantomnet.org" :
$self->isPowder() ? "portal-extensions\@powderwireless.net" :
$TBOPS);
}
......@@ -137,6 +146,7 @@ sub EmailTag($)
return ($self->isAPT() ? "aptlab.net" :
$self->isCloud() ? "cloudlab.us" :
$self->isPNet() ? "phantomnet.org" :
$self->isPowder() ? "powderwireless.net" :
"@THISHOMEBASE@");
}
......@@ -147,7 +157,7 @@ sub SignupURL($$)
my $pid = $project->pid();
return ($self->isAPT() || $self->isCloud() ||
$self->isPNet() || $self->isEmulab() ?
$self->isPNet() || $self->isPowder() || $self->isEmulab() ?
"${wwwbase}/signup.php?pid=$pid" :
"${wwwbase}/joinproject.php3?target_pid=$pid");
}
......@@ -159,6 +169,7 @@ sub UsersGroupName($)
return ($self->isAPT() ? "apt-users\@googlegroups.com" :
$self->isCloud() ? "cloudlab-users\@googlegroups.com" :
$self->isPNet() ? "phantomnet-users\@googlegroups.com" :
$self->isPowder() ? "powder-users\@googlegroups.com" :
"emulab-users\@googlegroups.com");
}
......@@ -170,6 +181,7 @@ sub UsersGroupURL($)
return ($self->isAPT() ? "$url/apt-users" :
$self->isCloud() ? "$url/cloudlab-users" :
$self->isPNet() ? "$url/phantomnet-users" :
$self->isPowder() ? "$url/powder-users" :
"$url/emulab-users");
}
......
......@@ -945,7 +945,8 @@ sub SendJoinEmail($$)
"ZIP/Postal Code: $usr_zip\n".
"Country: $usr_country\n";
if ($project->isAPT() || $project->isCloud() || $project->isPNet()) {
if ($project->isAPT() || $project->isCloud() ||
$project->isPNet() || $project->isPowder()) {
my $url = $project->wwwBase() . "/approveuser.php?uid=$uid&pid=$pid";
$message .=
......@@ -1009,7 +1010,8 @@ sub SendApprovalEmail($$$)
"as a member of ";
my $subject = "Membership Approved in '$pid/$gid'";
if ($project->isAPT() || $project->isCloud() || $project->isPNet()) {
if ($project->isAPT() || $project->isCloud() ||
$project->isPNet() || $project->isPowder()) {
my $helpurl = $project->Brand()->UsersGroupURL();
$message .= "project $pid.\n\n";
......
......@@ -160,6 +160,7 @@ 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 isPowder($) { return $_[0]->Brand()->isPowder() ? 1 : 0; }
sub isEmulab($) { return $_[0]->Brand()->isEmulab() ? 1 : 0; }
# These come from the group not the project.
......
......@@ -230,6 +230,7 @@ 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 isPowder($) { return $_[0]->Brand()->isPowder() ? 1 : 0; }
sub isEmulab($) { return $_[0]->Brand()->isEmulab() ? 1 : 0; }
# Branding.
......
<?php
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -135,6 +135,9 @@ elseif ($this_project->isCloud()) {
elseif ($this_project->isPNet()) {
$APPROVAL_MAIL = "phantomnet-approval@phantomnet.org";
}
elseif ($this_project->isPowder()) {
$APPROVAL_MAIL = "powder-approval@powderwireless.net";
}
#
# Well, looks like everything is okay. Change the project approval
......
/*
.navbar-brand > img {
border: 5px solid #708238;
border-radius: 35px;
}
*/
.navbar-nav > li > a.admin-toggle {
margin-top: 15px;
}
.portal-navbar {
margin-bottom: 25px;
}
.navbar {
background-color: #a2d2df;
}
.navbar-inner {
background-color: #a2d2df;
}
#footer {
background-color: #a2d2df;
}
.btn-success {
background-color: #289328;
border-color: #237f23;
}
.btn-primary {
background-color: #2f8ead;
border-color: #2a7e99;
}
.btn-info {
background-color: #2f64ad;
border-color: #2a5899;
}
.btn-warning {
background-color: #8a7626;
border-color: #766520;
}
.btn-danger {
background-color: #9c2a2a;
border-color: #882525;
}
......@@ -638,7 +638,7 @@ function CheckStep2()
{
global $this_user;
global $ajax_args;
global $ISAPT, $ISPNET, $ISCLOUD, $ISEMULAB;
global $ISAPT, $ISPNET, $ISCLOUD, $ISEMULAB, $ISPOWDER;
global $TB_PROJECT_CREATEEXPT;
global $maxduration;
......@@ -695,7 +695,7 @@ function CheckStep2()
}
}
}
elseif ($ISAPT || $ISPNET || $ISEMULAB) {
elseif ($ISAPT || $ISPNET || $ISEMULAB || $ISPOWDER) {
# No choice
;
}
......@@ -876,8 +876,8 @@ function Do_Submit()
{
global $this_user;
global $ajax_args;
global $PORTAL_GENESIS;
global $TBAUTHDOMAIN, $ISAPT, $ISPNET, $ISEMULAB, $DEFAULT_AGGREGATE_URN;
global $PORTAL_GENESIS, $DEFAULT_AGGREGATE_URN;
global $TBAUTHDOMAIN, $ISAPT, $ISPNET, $ISEMULAB, $ISPOWDER;
if (!isset($ajax_args["formfields"])) {
SPITAJAX_ERROR(1, "Missing formfields");
......@@ -956,7 +956,7 @@ function Do_Submit()
}
}
}
elseif ($ISAPT || $ISPNET || $ISEMULAB) {
elseif ($ISAPT || $ISPNET || $ISEMULAB | $ISPOWDER) {
$aggregate_urn = $DEFAULT_AGGREGATE_URN;
}
elseif (isset($formfields["where"])) {
......
......@@ -90,12 +90,13 @@ $(function () {
{
context = localContext;
}
else if (window.ISPNET)
else if (window.ISPNET || window.ISPOWDER)
{
contextUrl = 'https://www.emulab.net/protogeni/jacks-context/phantomnet.json';
}
if (window.ISCLOUD || window.ISPNET || (window.ISEMULAB && window.MAINSITE))
if (window.ISCLOUD || window.ISPNET || window.ISPOWDER ||
(window.ISEMULAB && window.MAINSITE))
{
$('#edit_topo_modal_button').prop('disabled', true);
$.get(contextUrl).then(contextReady, contextFail);
......
......@@ -93,7 +93,7 @@ window.APT_OPTIONS.initialize = function (sup)
$('#loginbutton').click(function (event) {
event.preventDefault();
sup.ShowModal('#quickvm_login_modal');
if (window.ISCLOUD || window.ISPNET) {
if (window.ISCLOUD || window.ISPNET || window.ISPOWDER) {
console.info("Loading geni auth code");
sup.InitGeniLogin(embedded);
$('#quickvm_geni_login_button').removeAttr("disabled");
......
......@@ -13,7 +13,7 @@ $(function ()
// We share code with the modal version of login, and the
// handler for the button is installed in initialize().
// See comment there.
if (window.ISCLOUD || window.ISPNET) {
if (window.ISCLOUD || window.ISPNET || window.ISPOWDER) {
sup.InitGeniLogin(embedded);
}
window.APT_OPTIONS.initialize(sup);
......
<?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
#
......@@ -104,7 +104,7 @@ function SPITFORM($uid, $referrer, $error)
{
global $PORTAL_PASSWORD_HELP;
global $TBDB_UIDLEN, $TBBASE, $refer;
global $ISAPT, $ISCLOUD, $ISPNET, $showguestlogin;
global $ISAPT, $ISCLOUD, $ISPNET, $ISPOWDER, $showguestlogin;
global $adminmode, $cleanmode;
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
......@@ -187,7 +187,7 @@ function SPITFORM($uid, $referrer, $error)
<div class='form-group'>
<div class='col-sm-offset-2 col-sm-10'>
<?php
if ($ISCLOUD || $ISPNET) {
if ($ISCLOUD || $ISPNET || $ISPOWDER) {
?>
<button class='btn btn-info btn-sm pull-left'
type='button'
......@@ -226,7 +226,7 @@ function SPITFORM($uid, $referrer, $error)
</div>
</div>\n";
if ($ISCLOUD || $ISPNET) {
if ($ISCLOUD || $ISPNET || $ISPOWDER) {
echo "<script
src='https://www.emulab.net/protogeni/speaks-for/geni-auth.js'>
</script>\n";
......
......@@ -38,6 +38,7 @@ $ISEMULAB = 1;
$ISAPT = 0;
$ISCLOUD = 0;
$ISPNET = 0;
$ISPOWDER = 0;
$ISVSERVER = 0;
$GOOGLEUA = 'UA-42844769-6';
# See tbauth.php3
......
......@@ -125,4 +125,36 @@ elseif ($ISALTDOMAIN && $_SERVER["SERVER_NAME"] == "www.phantomnet.org") {
$PORTAL_GENESIS = "phantomnet";
$PORTAL_NAME = "PhantomNet";
}
elseif ($_SERVER["SERVER_NAME"] == "www.powderwireless.net") {
$ISVSERVER = 1;
$TBAUTHDOMAIN = ".powderwireless.net";
$COOKDIEDOMAIN= "www.powderwireless.net";
$APTHOST = "www.powderwireless.net";
$WWWHOST = "www.powderwireless.net";
$APTBASE = "https://www.powderwireless.net";
$APTMAIL = "Powder Wireless Operations <powder-ops@powderwireless.net>";
$SUPPORT = "powder-ops@powderwireless.net";
$APTTITLE = "Powder";
$FAVICON = "powder.ico";
$APTLOGO = "powderlogo.png";
$APTSTYLE = "powder.css";
$ISEMULAB = 0;
$ISPOWDER = 1;
#$GOOGLEUA = 'UA-42844769-2';
$TBMAILTAG = "powderwireless.net";
$EXTENSIONS = "portal-extensions@powderwireless.net";
$TBAUTHTIMEOUT= (24 * 3600 * 14);
# For devel trees
if (preg_match("/\/([\w\/]+)$/", $WWW, $matches)) {
$APTBASE .= "/" . $matches[1];
}
$PORTAL_MANUAL = "http://docs.powderwireless.net";
$PORTAL_HELPFORUM = "powder-users";
$PORTAL_PASSWORD_HELP = "powderwireless.net or emulab.net Username";
$PORTAL_NSFNUMBER = "??????";
$DEFAULT_AGGREGATE = "Emulab";
$DEFAULT_AGGREGATE_URN = "urn:publicid:IDN+emulab.net+authority+cm";
$PORTAL_GENESIS = "powder";
$PORTAL_NAME = "Powder";
}
?>
......@@ -50,8 +50,8 @@ 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, $ISCLOUD, $ISPNET, $ISEMULAB, $ISAPT, $PORTAL_HELPFORUM;
global $spatrequired, $TBMAINSITE;
global $drewheader, $ISCLOUD, $ISPNET, $ISEMULAB, $ISAPT, $ISPOWDER;
global $spatrequired, $TBMAINSITE, $PORTAL_HELPFORUM;
if (! $drewheader) {
SPITHEADER();
......@@ -62,6 +62,7 @@ $PAGEERROR_HANDLER = function($msg, $status_code = 0) {
echo " window.ISEMULAB = " . ($ISEMULAB ? "1" : "0") . ";\n";
echo " window.ISCLOUD = " . ($ISCLOUD ? "1" : "0") . ";\n";
echo " window.ISPNET = " . ($ISPNET ? "1" : "0") . ";\n";
echo " window.ISPOWDER = " . ($ISPOWDER ? "1" : "0") . ";\n";
echo " window.ISAPT = " . ($ISAPT ? "1" : "0") . ";\n";
echo " window.MAINSITE = " . ($TBMAINSITE ? "1" : "0") . ";\n";
echo " window.HELPFORUM = " .
......@@ -80,7 +81,8 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
{
global $PORTAL_MANUAL, $PORTAL_HELPFORUM;
global $TBMAINSITE, $APTTITLE, $FAVICON, $APTLOGO, $APTSTYLE, $ISAPT;
global $GOOGLEUA, $ISCLOUD, $ISPNET, $ISEMULAB, $TBBASE, $ISEMULAB;
global $GOOGLEUA, $ISCLOUD, $TBBASE;
global $ISPNET, $ISPOWDER, $ISEMULAB;
global $login_user, $login_status, $SUPPORT;
global $disable_accounts, $page_title, $drewheader, $embedded;
$cleanmode = (isset($_COOKIE['cleanmode']) &&
......@@ -129,6 +131,7 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
echo " window.ISEMULAB = " . ($ISEMULAB ? "1" : "0") . ";\n";
echo " window.ISCLOUD = " . ($ISCLOUD ? "1" : "0") . ";\n";
echo " window.ISPNET = " . ($ISPNET ? "1" : "0") . ";\n";
echo " window.ISPOWDER = " . ($ISPOWDER ? "1" : "0") . ";\n";
echo " window.ISAPT = " . ($ISAPT ? "1" : "0") . ";\n";
echo " window.MAINSITE = " . ($TBMAINSITE ? "1" : "0") . ";\n";
echo " window.MANUAL = '$PORTAL_MANUAL';\n";
......@@ -165,7 +168,7 @@ $PAGEHEADER_FUNCTION = function($thinheader = 0, $ignore1 = NULL,
$navbar_status = "";
$navbar_right = "";
$aptmargin = "";
if (!$ISCLOUD && !$ISPNET && !$ISEMULAB)
if (!$ISCLOUD && !$ISPNET && !$ISEMULAB || $ISPOWDER)
{
$aptmargin = "margin-top: 7px;";
}
......@@ -334,8 +337,9 @@ function SPITHEADER($thinheader = 0,
function SPITNAV($hiddenxs, $navbar_status, $navbar_right, $login_uid)
{
global $PORTAL_MANUAL, $APTLOGO, $login_status, $login_user, $TBMAINSITE, $THISHOMEBASE, $ISEMULAB, $ISPNET;
$hiddenxs = "";
global $PORTAL_MANUAL, $APTLOGO, $login_status, $login_user, $TBMAINSITE;
global $THISHOMEBASE, $ISEMULAB, $ISPNET, $ISPOWDER;
$hiddenxs = "";
echo "
<div class='navbar portal-navbar' role='navigation'>
......@@ -678,7 +682,7 @@ function SpitVerifyModal($id, $label)
function SpitLoginModal($id)
{
global $PORTAL_PASSWORD_HELP;
global $APTTITLE, $ISCLOUD, $ISPNET;
global $APTTITLE, $ISCLOUD, $ISPNET, $ISPOWDER;
$referrer = CleanString($_SERVER['REQUEST_URI']);
?>
<!-- This is the login modal -->
......
......@@ -260,12 +260,14 @@ function SendProjAdminMail($project, $from, $to,
($project->isAPT() ? "aptlab-approval@aptlab.net" :
($project->isCloud() ? "cloudlab-approval@cloudlab.us" :
($project->isPNet() ? "phantomnet-approval@phantomnet.org" :
$TBMAIL_APPROVAL)));
($project->isPowder() ? "powder-approval@powderwireless.net" :
$TBMAIL_APPROVAL))));
$TBMAILTAG =
($project->isAPT() ? "aptlab.net" :
($project->isCloud() ? "cloudlab.us" :
($project->isPNet() ? "phantomnet.org" :
$TBMAILTAG)));
($project->isPowder() ? "powderwireless.net" :
$TBMAILTAG))));
if ($headers) {
$headers .= "\n";
}
......
<?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
#
......@@ -727,7 +727,8 @@ class Group
$url = $project->wwwBase();
if ($project->isEmulab() ||
$project->isAPT() || $project->isCloud() || $project->isPNet()) {
$project->isAPT() || $project->isCloud() ||
$project->isPNet() || $project->isPowder()) {
$url .= "/approveuser.php?uid=$joining_uid&pid=$pid";
$message =
"$usr_name is trying to join your group $gid ".
......
......@@ -170,7 +170,9 @@ class Project
function isCloud() { return ($this->portal() &&
$this->portal() == "cloudlab" ? 1 : 0); }
function isPNet() { return ($this->portal() &&
$this->portal() == "phantomnet" ? 1 : 0);}
$this->portal() == "phantomnet" ? 1 :0);}
function isPowder() { return ($this->portal() &&
$this->portal() == "powder" ? 1 : 0);}
function isEmulab() { return ($this->portal() &&
$this->portal() == "emulab" ? 1 : 0); }
# Not via the Portal interface.
......@@ -186,7 +188,8 @@ class Project
return ($this->isAPT() ? "https://www.aptlab.net" :
($this->isCloud() ? "https://www.cloudlab.us" :
($this->isPNet() ? "https://www.phantomnet.org" :
$TBBASE)));
($this->isPowder() ? $TBBASE :
$TBBASE))));
}
function ApprovalEmailAddress() {
global $TBMAILADDR_APPROVAL;
......@@ -194,7 +197,8 @@ class Project
return ($this->isAPT() ? "aptlab-approval@aptlab.net" :
($this->isCloud() ? "cloudlab-approval@cloudlab.us" :
($this->isPNet() ? "phantomnet-approval@phantomnet.org" :
$TBMAILADDR_APPROVAL)));
($this->isPowder() ? "powder-approval@powderwireless.net" :
$TBMAILADDR_APPROVAL))));
}
function EmailTag() {
global $THISHOMEBASE;
......@@ -202,7 +206,8 @@ class Project
return ($this->isAPT() ? "aptlab.net" :
($this->isCloud() ? "cloudlab.us" :
($this->isPNet() ? "phantomnet.org" :
$THISHOMEBASE)));
($this->isPowder() ? "powderwireless.net" :
$THISHOMEBASE))));
}
function unix_gid() {
......
......@@ -353,7 +353,9 @@ class User
function isCloud() { return ($this->portal() &&
$this->portal() == "cloudlab" ? 1 : 0); }
function isPNet() { return ($this->portal() &&
$this->portal() == "phantomnet" ? 1 : 0);}
$this->portal() == "phantomnet" ? 1 :0);}
function isPowder() { return ($this->portal() &&
$this->portal() == "powder" ? 1 : 0);}
function isEmulab() { return ($this->portal() &&
$this->portal() == "emulab" ? 1 : 0); }
# Not via the Portal interface.
......@@ -390,7 +392,8 @@ class User
($this->isAPT() ? "aptlab-approval@aptlab.net" :
($this->isCloud() ? "cloudlab-approval@cloudlab.us" :
($this->isPNet() ? "phantomnet-approval@phantomnet.org" :
$TBMAIL_APPROVAL)));
($this->isPNet() ? "powder-approval@powderwireless.net" :
$TBMAIL_APPROVAL))));
}
#
......
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