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

Do not show the slice logs if not an admin, mere users cannot access them.

parent c48951b5
...@@ -122,7 +122,9 @@ foreach (array($query1_result, $query2_result) as $query_result) { ...@@ -122,7 +122,9 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$instance["creator"] = $creator; $instance["creator"] = $creator;
$instance["created"] = $created; $instance["created"] = $created;
$instance["destroyed"] = $destroyed; $instance["destroyed"] = $destroyed;
$instance["public_url"] = $public_url; if (ISADMIN()) {
$instance["public_url"] = $public_url;
}
$instances[] = $instance; $instances[] = $instance;
} }
} }
...@@ -132,6 +134,7 @@ echo "<div id='activity-body'></div>\n"; ...@@ -132,6 +134,7 @@ echo "<div id='activity-body'></div>\n";
echo "<script type='text/javascript'>\n"; echo "<script type='text/javascript'>\n";
echo " window.AJAXURL = 'server-ajax.php';\n"; echo " window.AJAXURL = 'server-ajax.php';\n";
echo " window.ISADMIN = " . ISADMIN() . ";\n";
echo "</script>\n"; echo "</script>\n";
echo "<script type='text/plain' id='instances-json'>\n"; echo "<script type='text/plain' id='instances-json'>\n";
echo json_encode($instances); echo json_encode($instances);
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<th>Creator</th> <th>Creator</th>
<th>Created</th> <th>Created</th>
<th>Destroyed</th> <th>Destroyed</th>
<th>Logs</th> <% if (window.ISADMIN) { %>
<th>Logs</th>
<% } %>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -28,8 +30,10 @@ ...@@ -28,8 +30,10 @@
<% } else { %> <% } else { %>
<td><%- instance.destroyed %></td> <td><%- instance.destroyed %></td>
<% } %> <% } %>
<td><a href='<%- instance.public_url %>' target="_blank"> <% if (window.ISADMIN) { %>
<span class="glyphicon glyphicon-link"></span></a></td> <td><a href='<%- instance.public_url %>' target="_blank">
<span class="glyphicon glyphicon-link"></span></a></td>
<% } %>
</tr> </tr>
<% }); %> <% }); %>
</tbody> </tbody>
......
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