X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PlanetLabConf%2Fblacklist.php;h=33a04f979af1b13fce74cd6dffbef44ab3275832;hb=0e9b854b9b78a212fdbd2d653c865cd0cca1c381;hp=622e6ce559dd77133ef3f04e72dbe7d922285034;hpb=e9b0065a02763ed6ba0d6499c8d4fc723eb3a410;p=nodeconfig.git diff --git a/PlanetLabConf/blacklist.php b/PlanetLabConf/blacklist.php index 622e6ce..33a04f9 100755 --- a/PlanetLabConf/blacklist.php +++ b/PlanetLabConf/blacklist.php @@ -21,8 +21,18 @@ require_once 'plc_api.php'; global $adm; +// backwards compatibility with the old 4.2 API +global $__PLC_API_VERSION; +if ( ! method_exists ($adm,"GetInterfaces")) + $__PLC_API_VERSION = 4.2; +else + $__PLC_API_VERSION = 4.3; + // Look up the node -$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR'])); +if ($__PLC_API_VERSION==4.2) + $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR'])); +else + $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR'])); if (!empty($interfaces)) { $nodes = $adm->GetNodes(array($interfaces[0]['node_id'])); if (!empty($nodes)) {