########## sync
# 2 forms are supported
# (*) if your plc root context has direct ssh access:
-# make sync PLC=private.one-lab.org
+# make sync PLC=boot.planet-lab.eu
# (*) otherwise, entering through the root context
-# make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
+# make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr
+
+PLCHOST ?= testplc.onelab.eu
ifdef GUEST
-ifdef PLCHOST
SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
endif
-endif
ifdef PLC
SSHURL:=root@$(PLC):/
SSHCOMMAND:=ssh root@$(PLC)
sync:
ifeq (,$(SSHURL))
@echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
- @echo " e.g. make sync PLC=private.one-lab.org"
- @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
+ @echo " e.g. make sync PLC=boot.planet-lab.eu"
+ @echo " or make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr"
@exit 1
else
+$(RSYNC) planetlab plekit modules $(SSHURL)/var/www/html/
if (isset($_GET['pattern'])) { $pattern=$_GET['pattern']; }
if (isset($_POST['pattern'])) { $pattern=$_POST['pattern']; }
-$tokens=split(" ",$pattern);
+$tokens=explode(" ",$pattern);
function token_filter ($t) { $t = trim($t); if (empty($t)) return false; return true; }
$tokens=array_filter($tokens, "token_filter");
} else {
// user-provided string
- list ($year,$month,$day) = split ('[/.-]',$user_date);
+ list ($year,$month,$day) = preg_split ('/[\/\.\-]/',$user_date);
$date=sprintf("%s %s %s",$day,$month,$year);
$time=strtotime($date);
//if the flag is set, we add 23h59'59'', so the 'until' date is inclusive
case 'Site': return l_site_t ($id,$mess);
case 'Person': return l_person_t ($id,$mess);
case 'Slice': return l_slice_t ($id,$mess);
- case 'Role': case 'Key': case 'PCU': case 'Interface': case 'NodeGroup': case "Address":
+ case 'Interface': return l_interface_t ($id, $mess);
+ case 'Role': case 'Key': case 'PCU': case 'NodeGroup': case "Address":
return "$mess";
default: return "Unknown $type" . "-" . $id;
}
$title="Events [ $from_string - $until_string]";
$title .= " type=$object_type";
$title .= " id(s)=";
- foreach ( split(",",$user_input) as $user_desc) {
+ foreach ( explode(",",$user_input) as $user_desc) {
# numeric
if (my_is_int($user_desc)) {
$obj_check = call_user_func(array($api,$method),array(intval($user_desc)),array($primary_key));
return $exploded[0];
}
-// with php-5.3 on f12, ereg is marked deprecated, using PCRE instead
-// looks unused
-function is_valid_email_addr ($email) {
- if (preg_match("/^.+@.+\\..+$/", $email) ) {
- return true;
- } else {
- return false;
- }
-}
-
-// looks unused
-function is_valid_url ($url) {
- if (preg_match("/^(http|https):\/\/.+\..+$/", strtolower($url) ) ) {
- return true;
- } else {
- return false;
- }
-}
+//// with php-5.3 on f12, ereg is marked deprecated, using PCRE instead
+//// looks unused
+// function is_valid_email_addr ($email) {
+// if (preg_match("/^.+@.+\\..+$/", $email) ) {
+// return true;
+// } else {
+// return false;
+// }
+//}
+//
+//// looks unused
+//function is_valid_url ($url) {
+// if (preg_match("/^(http|https):\/\/.+\..+$/", strtolower($url) ) ) {
+// return true;
+// } else {
+// return false;
+// }
+//}
function is_valid_ip ($ip) {
if (preg_match("/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/", $ip ) ) {
$column['type']='string';
$column['description']=$tag_type['description'];
// split category and parse any setting
- $category_tokens=split('/',$tag_type['category']);
+ $category_tokens=explode('/',$tag_type['category']);
foreach ($category_tokens as $token) {
- $assign=split('=',$token);
+ $assign=explode('=',$token);
if (count($assign)==2)
$column[$assign[0]]=$assign[1];
}
// 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];
// checks proper syntax
$email = $_REQUEST['email'];
if (preg_match("/^[a-zA-Z0-9_\.-]+@[a-zA-Z0-9\.-]+$/", $email)) {
- list($username, $domain) = split('@', $email);
+ list($username, $domain) = explode('@', $email);
// prevent default domain from being appended
$domain .= ".";
// check if the domain has MX records, or is at least resolvable
// fill with values form the form
foreach ($form as $fullname => $item) {
- list($objname,$field) = split(":",$fullname);
+ list($objname,$field) = explode(":",$fullname);
$raw_input=$request[$fullname];
if (!empty($raw_input)) {
$empty_form = FALSE;
function form_check_required ($form, $input) {
$missing = array();
foreach ($form as $fullname => $item) {
- list($objname,$field) = split(":",$fullname);
+ list($objname,$field) = explode(":",$fullname);
if ($item['required'] && empty($input[$objname][$field])) {
$missing[] = $item['title'];
}
foreach ($site_form as $fullname => $item) {
- list($objname,$field) = split(":",$fullname);
+ list($objname,$field) = explode(":",$fullname);
// render the comment field
if ( ! empty($item['comment'])) {