Merge branch 'master' of ssh://git.onelab.eu/git/plewww
[plewww.git] / planetlab / nodes / comon.php
index 3524eb9..743ee02 100644 (file)
@@ -14,7 +14,7 @@ require_once 'plc_functions.php';
 // http://summer.cs.princeton.edu/
 // "138.96.250.12"
 function plc_ip_to_int ($ip) {
-  $bytes=array_map("intval",split("[.]",$ip));
+  $bytes=array_map("intval",explode(".",$ip));
   $res=0;
   foreach (range(0,3) as $i) {
     $res=256*$res+$bytes[$i];
@@ -93,8 +93,6 @@ foreach ($nns as $nn) {
   $local_ips[] = $nn['ip'];
 }
 
-//plc_debug('locals',$local_ips);
-
 // for foreign hosts we're left with dns resolving them
 $remote_ips=array();
 foreach ($hostnames as $hostname) {
@@ -106,17 +104,13 @@ foreach ($hostnames as $hostname) {
   }
 }
 
-//plc_debug('remote ips',$remote_ips);
-
-
 // add both lists
 $all_ips=$local_ips+$remote_ips;
 // compute comon URL
 $url = plc_comon_url_from_ips("http://comon.cs.princeton.edu",$all_ips);
 
-//plc_debug('url',$url);
 
 // redirect to comon
-header("Location: " . $url);
+plc_redirect($url);
 
 ?>