From: Thierry Parmentelat Date: Fri, 29 Apr 2022 16:38:35 +0000 (+0200) Subject: fix remaining glitches for php8 X-Git-Tag: plewww-5.3-0~3 X-Git-Url: http://git.onelab.eu/?p=plewww.git;a=commitdiff_plain;h=f67658afd159c12165a0ca7375399c5a035ac931 fix remaining glitches for php8 --- diff --git a/planetlab/events/index.php b/planetlab/events/index.php index 6727914..c8db071 100644 --- a/planetlab/events/index.php +++ b/planetlab/events/index.php @@ -4,6 +4,7 @@ // Require login require_once 'plc_login.php'; +require_once 'plekit-utils.php'; // the choser form is expected to set _GET['type'] among other stuff if (get_array($_GET, 'type')) require ('events.php') ; diff --git a/planetlab/peers/index.php b/planetlab/peers/index.php index aef4e59..004fcd6 100644 --- a/planetlab/peers/index.php +++ b/planetlab/peers/index.php @@ -4,6 +4,7 @@ // Require login require_once 'plc_login.php'; +require_once 'plekit-utils.php'; if (get_array($_GET, 'id')) require ('peer.php') ; else require ('peers.php'); diff --git a/planetlab/slices/slice.php b/planetlab/slices/slice.php index 40ec4f2..d4bdc76 100644 --- a/planetlab/slices/slice.php +++ b/planetlab/slices/slice.php @@ -31,7 +31,7 @@ drupal_set_html_head(' $profiling=false; -if ($get_array($_GET, 'profiling')) $profiling=true; +if (get_array($_GET, 'profiling')) $profiling=true; if ($profiling) plc_debug_prof_start(); diff --git a/planetlab/slices/slice_add.php b/planetlab/slices/slice_add.php index fec117a..6f93c01 100644 --- a/planetlab/slices/slice_add.php +++ b/planetlab/slices/slice_add.php @@ -12,7 +12,7 @@ require_once 'plc_functions.php'; require_once 'details.php'; require_once 'table.php'; require_once 'toggle.php'; - + //plc_debug('POST',$_POST); // if not a PI or admin then redirect to slice index @@ -25,7 +25,7 @@ if ( ! $has_privileges ) { // find out which site the slice should be added to // without site_id set in GET, we use the first site that this user is in -if (get_array($_GET['site_id'])) { +if (get_array($_GET, 'site_id')) { $site_id=intval($_GET['site_id']); } else if (get_array($_POST, 'site_id')) { $site_id=intval($_POST['site_id']); @@ -67,22 +67,22 @@ if ( $_POST['add-slice'] ) { $check=false; } } - + if ( ($url == "http://") || ( $url=="" ) ) { drupal_set_error("You must enter a URL for your slice's info"); $check=false; } - + if( $description == "" ) { drupal_set_error("Your must enter a description for you slice."); $check=false; } - + // if no errors then add if ( $check ) { - $fields= array( "url" => $url, - "instantiation" => $instantiation, - "name" => $name, + $fields= array( "url" => $url, + "instantiation" => $instantiation, + "name" => $name, "description" => $description ); // add it! $slice_id= $api->AddSlice( $fields ); @@ -115,7 +115,7 @@ if ( $_POST['add-slice'] ) { $counter++; } } - if ($success) + if ($success) drupal_set_message ("Added $counter person(s)"); else drupal_set_error ("Could not add all selected persons, only $counter were added"); @@ -137,10 +137,10 @@ include 'plc_header.php'; $sites=$api->GetSites(array($site_id)); $site=$sites[0]; $sitename=$site['name']; -if ( ! $_POST['name']) +if ( ! $_POST['name']) $base= $site['login_base'] ."_"; -// propose to add all 'reachable' persons +// propose to add all 'reachable' persons $site_person_ids=$site['person_ids']; $persons_filter=array("person_id"=>$site_person_ids, "enabled"=>true); @@ -155,10 +155,10 @@ if( !$url ) $url= "http://"; // check for errors and set error styles if( $error['name'] ) $name_error= " class='plc-warning'"; - + if( $error['url'] ) $url_error= " class='plc-warning'"; - + if( $error['description'] ) $desc_error= " class='plc-warning'"; @@ -193,10 +193,10 @@ if ($multiple_sites) { $site_form->end(); print ""; } - + print <<< EOF
-

Important: Please provide a short description, as well as a +

Important: Please provide a short description, as well as a link to a project website, before creating your slice.

PlanetLab's security model requires that anyone who is concerned about a slice's activity be able to immediately learn about that slice. The details that you provide are your public explanation about why the slice behaves as it does. Be sure to describe the kind of traffic that your slice generates, and how it handles material that is under copyright, if relevant. @@ -204,11 +204,11 @@ PlanetLab's security model requires that anyone who is concerned about a slice's The PlanetLab Operations Centres regularly respond to concerns raised by third parties about site behaviour. Most incidents are resolved rapidly based upon the publicly posted slice details. However, when these details are not sufficiently clear or accurate, and we cannot immediately reach the slice owner, we must delete the slice.

NOTE: All PlanetLab users are strongly - encouraged to join the PlanetLab -Users -mailing list. Most questions about running software on PlanetLab can be answered by -posting to this list. -
Site administrators often use this list to post announcements about service outages. + encouraged to join the PlanetLab +Users +mailing list. Most questions about running software on PlanetLab can be answered by +posting to this list. +
Site administrators often use this list to post announcements about service outages. New software releases and available services are announced here as well.

@@ -250,7 +250,7 @@ if (isset($_POST['omf-control'])) { } else { $omf_options=array(); } -// 2018 feb 15 - turning off omf slices creation +// 2018 feb 15 - turning off omf slices creation // $details->th_td("OMF friendly", // $form->checkbox_html('omf-control','yes',$omf_options)); @@ -263,12 +263,12 @@ $instantiation_text = <<< EOF
  • Controller creates a slice on all nodes to manipulate Delegated slices.
  • None allows you to reserve a slice name; you may instantiate the slice later.
  • -

    PLC instantiated slices can be defined as OMF friendly, -in which case slivers come with the OMF Resource Controller pre-installed and pre-configured. +

    PLC instantiated slices can be defined as OMF friendly, +in which case slivers come with the OMF Resource Controller pre-installed and pre-configured. Such slivers can then be easily managed through a centralized tool, the OMF Experiment Controller. -Using these OMF tools, a user can describe, instrument, +Using these OMF tools, a user can describe, instrument, and automatically execute their experiments across many slivers. -Please refer to the OMF User Guide +Please refer to the OMF User Guide to learn more on how to use this feature.

    @@ -284,7 +284,7 @@ if ($persons) { $toggle=new PlekitToggle ('create-slice-persons',$title, array('visible'=>get_arg('show_persons'))); $toggle->start(); - + $headers = array(); $headers['email']='string'; $headers['first']='string'; diff --git a/planetlab/tags/index.php b/planetlab/tags/index.php index 1d2b02e..17a490b 100644 --- a/planetlab/tags/index.php +++ b/planetlab/tags/index.php @@ -4,6 +4,7 @@ // Require login require_once 'plc_login.php'; +require_once 'plekit-utils.php'; if (get_array($_GET, 'id')) require ('tag.php') ; else require ('tags.php'); diff --git a/plekit/php/table.php b/plekit/php/table.php index 14f4f14..2257d88 100644 --- a/plekit/php/table.php +++ b/plekit/php/table.php @@ -285,15 +285,22 @@ EOF; $text = "n/a"; $html = ""; $html .= "columns() . "'"; - $option = get_array($options, 'align'); - if ($option) $html .= " style='text-align:$option'"; + // xxx this should not happen, but we see it sometimes - ignoring for now + if ($options && ! is_array($options)) { + //print_r("
    options="); + //var_dump($options); + } + if ($options && is_array($options)) { + $option = get_array($options, 'class'); + if ($option) + $html .= " class='$option'"; + $option = get_array($options, 'columns'); + if ($option) $html .= " colspan='$option'"; + $option = get_array($options, 'hfill'); + if ($option) $html .= " colspan='" . $this->columns() . "'"; + $option = get_array($options, 'align'); + if ($option) $html .= " style='text-align:$option'"; + } $html .= ">$text"; return $html; }