telemetry.php3 1.38 KB
Newer Older
1 2 3
<?php
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
5 6 7 8 9 10 11 12
# All rights reserved.
#

include("defs.php3");

#
# Make sure they are logged in
#
13 14 15
$this_user = CheckLoginOrDie();
$uid       = $this_user->uid();
$isadmin   = ISADMIN();
16 17 18 19

#
# Verify page arguments.
#
20
$reqargs = RequiredPageArguments("node", PAGEARG_NODE);
21

22
if (!$node->AccessCheck($this_user, $TB_NODEACCESS_READINFO)) {
23 24
    USERERROR("Not enough permission.", 1);
}
25 26
$node_id = $node->node_id();
$status  = $node->NodeStatus();
27 28 29 30 31 32 33 34 35 36 37 38 39

#
# 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.
#
40
PAGEHEADER("Telemetry for $node_id", $view);
41

42
if ($status == "up") {
43 44 45
    echo "
    <applet code='thinlet.AppletLauncher.class'
            archive='thinlet.jar,oncrpc.jar,mtp.jar,garcia-telemetry.jar'
46
            width='300' height='400'
47 48
            alt='You need java to run this applet'>
        <param name='class' value='GarciaTelemetry'>
49
        <param name='pipeurl' value='servicepipe.php3?node_id=$node_id'>
50 51 52 53 54
        <param name='uid' value='$uid'>
        <param name='auth' value='$HTTP_COOKIE_VARS[$TBAUTHCOOKIE]'>
    </applet>\n";
}
else {
55
    USERERROR("Robot is not alive: $status", 1);
56 57 58 59 60 61 62 63
}

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

?>