telemetry.php3 1.49 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005 University of Utah and the Flux Group.
# All rights reserved.
#

include("defs.php3");
include("showstuff.php3");

#
# Make sure they are logged in
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);

#
# Verify page arguments.
#
if (!isset($node) || strcmp($node, "") == 0) {
    USERERROR("You must provide a node ID.", 1);
}

if (!TBvalid_node_id($node)) {
    USERERROR("Invalid node ID.", 1);
}

if (!TBValidNodeName($node)) {
    USERERROR("Invalid node ID.", 1);
}

if (!TBNodeAccessCheck($uid, $node, $TB_NODEACCESS_READINFO)) {
    USERERROR("Not enough permission.", 1);
}

#
# Define a stripped-down view of the web interface - less clutter
#
$view = array(
    'hide_banner' => 1,
    'hide_sidebar' => 1,
    'hide_copyright' => 1
);

#
# Standard Testbed Header now that we have the pid/eid okay.
#
PAGEHEADER("Telemetry for $node", $view);

if (TBNodeStatus($node) == "up") {
    echo "
    <applet code='thinlet.AppletLauncher.class'
            archive='thinlet.jar,oncrpc.jar,mtp.jar,garcia-telemetry.jar'
Timothy Stack's avatar
Timothy Stack committed
54
            width='450' height='400'
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
            alt='You need java to run this applet'>
        <param name='class' value='GarciaTelemetry'>
        <param name='pipeurl' value='servicepipe.php3?node=$node'>
        <param name='uid' value='$uid'>
        <param name='auth' value='$HTTP_COOKIE_VARS[$TBAUTHCOOKIE]'>
    </applet>\n";
}
else {
    USERERROR("Robot is not alive. ". TBNodeStatus($node), 1);
}

#
# Standard Testbed Footer
# 
PAGEFOOTER($view);

?>