Commit 808596a0 authored by Leigh Stoller's avatar Leigh Stoller

Cheesy hack to redirect to the correct portal (instead of Emulab

Portal) that the experiment was created on.
parent 5a71702e
...@@ -90,6 +90,26 @@ if (! (ISADMIN() || ISFOREIGN_ADMIN() || $record->CanView($this_user))) { ...@@ -90,6 +90,26 @@ if (! (ISADMIN() || ISFOREIGN_ADMIN() || $record->CanView($this_user))) {
PAGEERROR("You do not have permission to look at this experiment!"); PAGEERROR("You do not have permission to look at this experiment!");
} }
if ($TBMAINSITE && $record->servername() != $_SERVER['SERVER_NAME']) {
if ($record->servername() == "www.aptlab.net") {
$url = "https://www.aptlab.net";
}
elseif ($record->servername() == "www.cloudlab.us") {
$url = "https://www.cloudlab.us";
}
elseif ($record->servername() == "www.phantomnet.org") {
$url = "https://www.phantomnet.org";
}
elseif ($record->servername() == "www.powderwireless.net") {
$url = "https://www.powderwireless.net";
}
if (isset($url)) {
$url = $url . str_replace("/portal/", "/", $_SERVER['REQUEST_URI']);
header("Location: $url");
return;
}
}
SPITHEADER(1); SPITHEADER(1);
......
...@@ -93,6 +93,36 @@ if (!$instance) { ...@@ -93,6 +93,36 @@ if (!$instance) {
PAGEREPLACE("landing.php"); PAGEREPLACE("landing.php");
return; return;
} }
#
# When coming her via the slice_uuid, we want to flip over to the
# correct portal. Hacky.
#
error_log($instance->servername());
error_log($_SERVER['SERVER_NAME']);
if ($TBMAINSITE && isset($slice_uuid) &&
$instance->servername() != $_SERVER['SERVER_NAME']) {
if ($instance->servername() == "www.aptlab.net") {
$url = "https://www.aptlab.net";
}
elseif ($instance->servername() == "www.cloudlab.us") {
$url = "https://www.cloudlab.us";
}
elseif ($instance->servername() == "www.phantomnet.org") {
$url = "https://www.phantomnet.org";
}
elseif ($instance->servername() == "www.powderwireless.net") {
$url = "https://www.powderwireless.net";
}
error_log($url);
if (isset($url)) {
$url = $url . str_replace("/portal/", "/", $_SERVER['REQUEST_URI']);
header("Location: $url");
return;
}
}
$uuid = $instance->uuid();
$creator = GeniUser::Lookup("sa", $instance->creator_uuid()); $creator = GeniUser::Lookup("sa", $instance->creator_uuid());
if (! $creator) { if (! $creator) {
$creator = User::LookupByUUID($instance->creator_uuid()); $creator = User::LookupByUUID($instance->creator_uuid());
......
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