git://git.onelab.eu
/
nodeconfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
backwards compatibility with 4.2
[nodeconfig.git]
/
PlanetLabConf
/
blacklist.php
diff --git
a/PlanetLabConf/blacklist.php
b/PlanetLabConf/blacklist.php
index
622e6ce
..
33a04f9
100755
(executable)
--- a/
PlanetLabConf/blacklist.php
+++ b/
PlanetLabConf/blacklist.php
@@
-21,8
+21,18
@@
require_once 'plc_api.php';
global $adm;
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
// 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)) {
if (!empty($interfaces)) {
$nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
if (!empty($nodes)) {