Commit e349a63c authored by Leigh B Stoller's avatar Leigh B Stoller

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

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