From: Thierry Parmentelat Date: Wed, 25 Sep 2013 17:00:34 +0000 (+0200) Subject: use GET['node_id'] to figure the node instead of from the incoming IP - thanks Thomas X-Git-Tag: nodeconfig-5.2-3~1 X-Git-Url: http://git.onelab.eu/?p=nodeconfig.git;a=commitdiff_plain;h=7164151d1ef862940830925fe7775527489e37e0 use GET['node_id'] to figure the node instead of from the incoming IP - thanks Thomas --- diff --git a/PlanetLabConf/ntp.conf.php b/PlanetLabConf/ntp.conf.php index 586e27b..4945fb0 100755 --- a/PlanetLabConf/ntp.conf.php +++ b/PlanetLabConf/ntp.conf.php @@ -16,14 +16,9 @@ $default_name = "default"; $file_name = $config_directory . $file_prefix . $default_name; // Look up the node - -$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR'])); - -if (!empty($interfaces)) { - $nodes = $adm->GetNodes(array($interfaces[0]['node_id'])); - if (!empty($nodes)) { - $node = $nodes[0]; - } +$nodes = $adm->GetNodes(array('node_id' => (int)$_GET['node_id'])); +if (!empty($nodes)) { + $node = $nodes[0]; } if (!isset($node)) { @@ -31,6 +26,7 @@ if (!isset($node)) { exit(); } + $problem_models = array("Dell Precision 340", "Unknown"); $hostname= trim($node['hostname']);