Commit e349a63c authored by Leigh Stoller's avatar Leigh Stoller

Print out URNs instead of hrns when printing protogeni slice info.

parent 3d26e961
......@@ -1111,6 +1111,7 @@ class Experiment
if ($slice) {
$slice_hrn = $slice->hrn();
$slice_urn = $slice->urn();
if (ISADMIN()) {
$url = CreateURL("showslice", "slice_idx",
$slice->idx(), "showtype", "cm");
......@@ -1118,13 +1119,13 @@ class Experiment
echo "<tr>
<td>Geni Slice (CM): </td>
<td class=\"left\">
<a href='$url'>$slice_hrn</a></td>
<a href='$url'>$slice_urn</a></td>
</tr>\n";
}
else {
echo "<tr>
<td>Geni Slice (CM): </td>
<td class=\"left\">$slice_hrn</td>
<td class=\"left\">$slice_urn</td>
</tr>\n";
}
}
......@@ -1133,6 +1134,7 @@ class Experiment
$slice = GeniSlice::LookupByExperiment("geni-sa", $this);
if ($slice) {
$slice_hrn = $slice->hrn();
$slice_urn = $slice->urn();
if (ISADMIN()) {
$url = CreateURL("showslice", "slice_idx",
$slice->idx(), "showtype", "sa");
......@@ -1140,13 +1142,13 @@ class Experiment
echo "<tr>
<td>Geni Slice (SA): </td>
<td class=\"left\">
<a href='$url'>$slice_hrn</a></td>
<a href='$url'>$slice_urn</a></td>
</tr>\n";
}
else {
echo "<tr>
<td>Geni Slice (SA): </td>
<td class=\"left\">$slice_hrn</td>
<td class=\"left\">$slice_urn</td>
</tr>\n";
}
$slice = GeniSlice::Lookup("geni-cm", $slice_hrn);
......@@ -1158,13 +1160,13 @@ class Experiment
echo "<tr>
<td>Geni Slice (CM): </td>
<td class=\"left\">
<a href='$url'>$slice_hrn</a></td>
<a href='$url'>$slice_urn</a></td>
</tr>\n";
}
else {
echo "<tr>
<td>Geni Slice (SA): </td>
<td class=\"left\">$slice_hrn</td>
<td class=\"left\">$slice_urn</td>
</tr>\n";
}
}
......
......@@ -174,6 +174,23 @@ class GeniSlice
}
return null;
}
#
# The urn is stored in the certificate.
#
function urn() {
$slice_uuid = $this->uuid();
$query_result =
DBQueryFatal("select urn from geni_certificates ".
"where uuid='$slice_uuid'",
$this->dblink);
if ($query_result && mysql_num_rows($query_result)) {
$row = mysql_fetch_row($query_result);
return $row[0];
}
return null;
}
}
class GeniUser
......
......@@ -52,6 +52,10 @@ $rows = array();
$rows[] = array("idx" => $slice->idx());
$rows[] = array("hrn" => $slice->hrn());
$urn = $slice->urn();
if ($urn) {
$rows[] = array("urn" => $slice->urn());
}
$rows[] = array("uuid" => $slice->uuid());
$rows[] = array("created" => $slice->created());
$rows[] = array("expires" => $slice->expires());
......
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