Commit 75c8443a authored by Kirk Webb's avatar Kirk Webb

Merge branch 'pnet-www'

parents 1a4cf6a7 aa333e81
<?php
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
# Alternate domain def structures. The first element of the outermost
# array is the regex pattern to match against $_SERVER['SERVER_NAME'].
# The second element is another array that contains key-value pairs
# for various top-level variable overrides. See SetDomainDefs() in
# defs.php3 for more info.
#
# PhantomNet view declaration
#
$PNET_DOMVIEW = array('hide_sidebar' => 0, 'hide_banner' => 0,
'hide_copyright' => 0, 'show_pnet' => 1,
'css-override' => 1, 'hide_elab' => 1);
$ALTERNATE_DOMAINS[] =
array('/phantom/',
array('THISHOMEBASE' => 'PhantomNet',
'WIKINODE' => 'wiki.phantomnet.org',
'FORUMURL' => 'http://groups.google.com/group/phantomnet-users',
'DOMVIEW' => $PNET_DOMVIEW
));
?>
\ No newline at end of file
......@@ -65,6 +65,7 @@ $MAILMANURL = "http://${USERNODE}/mailman";
$OPSCVSURL = "http://${USERNODE}/cvsweb/cvsweb.cgi";
$OPSJETIURL = "http://${USERNODE}/jabber/jeti.php";
$WIKIDOCURL = "http://${WIKINODE}/wikidocs/wiki";
$FORUMURL = "http://groups.google.com/group/emulab-users";
$MIN_UNIX_UID = @MIN_UNIX_UID@;
$MIN_UNIX_GID = @MIN_UNIX_GID@;
$EXPOSELINKTEST = 1;
......@@ -73,6 +74,7 @@ $EXPOSEARCHIVE = 0;
$EXPOSETEMPLATES= 0;
$USERSELECTUIDS = 1;
$REMOTEWIKIDOCS = @REMOTEWIKIDOCS@;
$FLAVOR = "Emulab";
$GMAP_API_KEY = "@GMAP_API_KEY@";
$NONAMEDSETUP = @DISABLE_NAMED_SETUP@;
$OPS_VM = @OPSVM_ENABLE@;
......@@ -176,6 +178,22 @@ $RSS_HEADER_PGENINEWS =
"<link rel=\"alternate\" type=\"application/rss+xml\" " .
"title=\"ProtoGeni News\" href=\"$TBDOCBASE/news-rss.php3?protogeni=1\"/>";
$RSS_HEADER_PNNEWS =
"<link rel=\"alternate\" type=\"application/rss+xml\" " .
"title=\"PhantomNet News\" href=\"$TBDOCBASE/news-rss.php3?phantomnet=1\"/>";
#
# See if we should override any of the global web variables based on the
# virtual domain. We include a site-dependent definitions file.
#
$ALTERNATE_DOMAINS = array();
$DOMVIEW = NULL;
$altdomfile = strtolower("alternate_domains_${OURDOMAIN}.php");
if (file_exists($altdomfile)) {
include($altdomfile);
}
SetDomainDefs();
#
# Database constants and the like.
#
......@@ -609,6 +627,97 @@ function YesNo($bool) {
return ($bool ? "Yes" : "No");
}
#
# See if someone is logged in, and if they need to be redirected.
#
function CheckRedirect() {
global $stayhome;
if (($this_user = CheckLogin($check_status))) {
$check_status = $check_status & CHECKLOGIN_STATUSMASK;
if ($check_status == CHECKLOGIN_MAYBEVALID) {
# Maybe the reason was because they where not using HTTPS ...
RedirectHTTPS();
}
if (($firstinitstate = TBGetFirstInitState())) {
unset($stayhome);
}
if (!isset($stayhome)) {
if ($check_status == CHECKLOGIN_LOGGEDIN) {
if ($firstinitstate == "createproject") {
# Zap to NewProject Page,
header("Location: $TBBASE/newproject.php3");
}
else {
# Zap to My Emulab page.
header("Location: $TBBASE/".
CreateURL("showuser", $this_user));
}
exit;
}
}
}
}
#
# Loop over the $ALTERNATE_DOMAINS global array and see if the incoming
# request asked for a virtual domain for which we have an alternate set
# of definitions and/or view.
#
# Return 1 if a domain in the array matched, 0 otherwise. Has MAJOR
# side effects: updates/overrides many top-level variables.
#
function SetDomainDefs()
{
global $WWWHOST, $OURDOMAIN, $WWW, $THISHOMEBASE, $TBAUTHDOMAIN, $TBBASE;
global $TBDOCBASE, $TBWWW, $WIKINODE, $WIKIDOCURL, $TBMAINSITE, $FORUMURL;
global $ALTERNATE_DOMAINS, $FLAVOR, $DOMVIEW;
foreach ($ALTERNATE_DOMAINS as $altdom) {
list($dpat, $ovr) = $altdom;
if (preg_match($dpat, $_SERVER['SERVER_NAME']) == 1) {
# Replacement defs derived from the virtual domain itself.
$WWWHOST = $_SERVER['SERVER_NAME'];
$OURDOMAIN = implode(".", array_slice(explode(".",$WWWHOST),1));
$WWW = $WWWHOST;
$TBAUTHDOMAIN = ".$OURDOMAIN";
$TBBASE = "https://$WWWHOST";
$TBDOCBASE = "http://$WWWHOST";
$TBWWW = "<$TBBASE/>";
# Defs that may be overriden in the domain's configuration array
if (isset($ovr['THISHOMEBASE'])) {
$THISHOMEBASE = $ovr['THISHOMEBASE'];
$FLAVOR = $THISHOMEBASE;
}
if (isset($ovr['WIKINODE'])) {
$WIKINODE = $ovr['WIKINODE'];
} else {
$WIKINODE = "wiki.$OURDOMAIN";
}
if (isset($ovr['WIKIDOCURL'])) {
$WIKIDOCURL = $ovr['WIKIDOCURL'];
} else {
$WIKIDOCURL = "http://${WIKINODE}/wikidocs/wiki";
}
if (isset($ovr['FORUMURL'])) {
$FORUMURL = $ovr['FORUMURL'];
}
if (isset($ovr['DOMVIEW'])) {
$DOMVIEW = $ovr['DOMVIEW'];
}
# Given that this is an alternate domain, clear TBMAINSITE
$TBMAINSITE = 0;
# Bail after the first domain match.
return 1;
}
}
return 0;
}
#
# If the page was accessed via http redirect to https and exit
# otherwise do nothing
......
......@@ -29,9 +29,13 @@ include("defs.php3");
PAGEHEADER("Contact Us");
echo "
To ask questions about using Emulab or to report bugs, please
join the <a href='http://groups.google.com/group/emulab-users'>
Help Forum</a>.
To ask questions about using $FLAVOR or to report bugs, please
join the <a href='$FORUMURL'>
Help Forum</a>.";
$view = GETDOMVIEW();
if (!VIEWSET($view, 'hide_elab')) {
echo "
<br>
<br>
If you are interested in creating your own Emulab, please take a look
......@@ -41,6 +45,7 @@ echo "
For additional information on creating your own Emulab, send email
to $TBMAILADDR
\n";
}
#
# Standard Testbed Footer
......
<!--
Copyright (c) 2014 University of Utah and the Flux Group.
{{{EMULAB-LICENSE
This file is part of the Emulab network testbed software.
This file is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This file is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
You should have received a copy of the GNU Affero General Public License
along with this file. If not, see <http://www.gnu.org/licenses/>.
}}}
-->
<img class="centerimage" src="epc-diagram.png" width="600" height="390" />
<p>
<em>PhantomNet</em> is a mobility testbed, providing researchers with
a set of hardware and software resources that they can use to
develop, debug, and evaluate their mobility designs.
Resources available in <em>PhantomNet</em> include EPC/EPS software
(OpenEPC), hardware access points (ip.access enodeb), PC nodes with
mobile radios (HUAWEI cellular modems), and a large set of commodity
bare metal nodes, virtual nodes and other resouces inherited from
the main Emulab site.
In addition to raw resources, <em>PhantomNet</em> provides configuration
directives and scripts to assist researchers in setting up their
mobility experiments.
Users specify their experiment via Emulab NS file templates augmented with
PhantomNet-specific functionality.
In complement to these template NS files,
PhantomNet does the work of configuring the EPC software components
to operate within the underlying <em>Emulab</em> environment.
</p>
<p>
Some helpful links:<br>
<ul>
<li><a href="http://wiki.phantomnet.org">PhantomNet Wiki</a></li>
<li><a href="http://wiki.phantomnet.org/oepc-tutorial">OpenEPC Tutorial (registration/approval required)</a></li>
</ul>
</p>
<p>
The PhantomNet facility is built on top of
<a href="http://www.emulab.net">Emulab</a> and is run by the
<a href="http://www.flux.utah.edu">Flux Group</a>, part of the
<a href="http://www.cs.utah.edu">School of Computing</a> at the
<a href="http://www.utah.edu">University of Utah</a>.
</p>
This diff is collapsed.
/*
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
* This file is part of the Emulab network testbed software.
*
* This file is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* This file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this file. If not, see <http://www.gnu.org/licenses/>.
*
* }}}
*/
td, th {
background-color: #ADD6FF;
}
th {
background-color: #ADD6FF;
}
th.center {
background-color: #ADD6FF;
}
table {
background-color: #FFFFFF;
}
table.nogrid { border-color: #000; background-color:#ADD6FF; }
#fancybannercell {
background-image: url("pnet-background.png");
}
div.topcell {
background-image: none;
}
#contentheader {
background-color: #1975FF;
color: #FFF;
}
.submenuheader {
border: solid 2px black;
background-color: #1975FF;
color: #FFF;
text-align: center;
}
ul.submenu {
border-top: solid 0px black;
border-right: solid 1px black;
border-left: solid 1px black;
border-bottom: solid 1px black;
}
.rightcontenttitle {
background-color: #1975FF;
color: #FFF;
}
.menuheader {
background-color: #1975FF;
color: #FFF;
text-align: center;
}
ul.navmenu {
background-color: #FFF;
}
.leftcell {
background-color: #FFF;
padding-bottom: 5px;
}
#searchrow form, #searchrow table, #searchrow table td {
background-color: #FFF;
}
img.centerimage {
display: block;
border: solid 0px #000000;
margin-left: auto;
margin-right: auto;
}
<?php
#
# Copyright (c) 2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
require("defs.php3");
$optargs = OptionalPageArguments("stayhome", PAGEARG_BOOLEAN);
#
# The point of this is to redirect logged in users to their My Emulab
# page.
#
CheckRedirect();
PAGEHEADER("PhantomNet - Mobility Testbed", NULL, $RSS_HEADER_PNNEWS);
#
# Show special banner message, if set.
#
$message = TBGetSiteVar("web/banner");
if ($message != "") {
echo "<center><font color=Red size=+1>\n";
echo "$message\n";
echo "</font></center><br>\n";
}
#
# PhantomNet front page content.
#
readfile("index-phantomnet.html");
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
<?php
#
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
include("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Request a New PhantomNet Account");
echo "<center><font size=+1>
If you already have a PhantomNet account,
<a href=login.php3>
<font color=red>please log on first!</font></a>
<br><br>
<a href=joinproject.php3>Join an Existing Project</a>.
<br>
or
<br>
<a href=newproject.php3>Start a New Project</a>.
<br>
<font size=-1>
If you are a <font color=red>student (undergrad or graduate)</font>,
please do not try to start a project!<br> Your advisor must do it.
</font>
</font></center><br>\n";
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
......@@ -77,10 +77,10 @@ if ($yourpcs) {
# Standard Testbed Header, now that we know what we want to say.
#
if (! $this_user->SameUser($target_user)) {
PAGEHEADER("${target_uid}'s Emulab", null, null, $notice);
PAGEHEADER("${target_uid}'s $FLAVOR", null, null, $notice);
}
else {
PAGEHEADER("My Emulab", null, null, $notice);
PAGEHEADER("My $FLAVOR", null, null, $notice);
}
$html_groups = null;
......
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