From 6c1095ffda370e3d66004cfd23926f91fc85ecb1 Mon Sep 17 00:00:00 2001 From: David Johnson Date: Tue, 13 Jan 2009 00:03:35 +0000 Subject: [PATCH] Don't do anything if not PLABSUPPORT, and detect the fact that there are no plab-style node_types, and add msgs to those effects. Prompted by Mike Blodgett at WAIL. --- www/plabmetrics.php3 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/www/plabmetrics.php3 b/www/plabmetrics.php3 index 5f654bda7..eea84c783 100644 --- a/www/plabmetrics.php3 +++ b/www/plabmetrics.php3 @@ -26,6 +26,14 @@ $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); +if (!$PLABSUPPORT) { + PAGEHEADER("PlanetLab Metrics"); + echo "

This site does not have PlanetLab support configured.

"; + echo "

Email $TBMAILADDR_OPS if this confuses you!

"; + PAGEFOOTER(); + exit(0); +} + # # Hacks -- unset $pid and $eid vars if they are '' before we check args! # (needed so we can let users drop a previous pid/eid filter). @@ -710,6 +718,13 @@ while ($row = mysql_fetch_array($qres)) { array_push($basenodetypes,$row['type']); } +if (empty($basenodetypes)) { + echo "

This site has not added any PlanetLab-style node types.

"; + echo "

Email $TBMAILADDR_OPS if this confuses you!

"; + PAGEFOOTER(); + exit(0); +} + # # Next, build query: # -- GitLab