X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PlanetLabConf%2Fntp.conf.php;h=586e27ba0031f0bb64b5739189ec19fcdb97ed92;hb=6552abf59a332977e10520772dab68fe31f0c95c;hp=ea3ce63cdf276a04c7efa25c3ebf1ccb0f5e8754;hpb=e9b0065a02763ed6ba0d6499c8d4fc723eb3a410;p=nodeconfig.git diff --git a/PlanetLabConf/ntp.conf.php b/PlanetLabConf/ntp.conf.php index ea3ce63..586e27b 100755 --- a/PlanetLabConf/ntp.conf.php +++ b/PlanetLabConf/ntp.conf.php @@ -5,8 +5,6 @@ // Marc Fiuczynski // Copyright (C) 2006 The Trustees of Princeton University // -// $Id$ -// // Get admin API handle require_once 'plc_api.php'; @@ -18,7 +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)) { @@ -42,6 +42,10 @@ if (!empty($sites)) { $site_name= $sites[0]['name']; $mylat= $sites[0]['latitude']; $mylong= $sites[0]['longitude']; +} else { + $site_name= "Unknown"; + $mylat= 0; + $mylong= 0; } /* typical NTP settings */