Commit e19b2a93 authored by Mike Hibler's avatar Mike Hibler

PHP nits.

PHP5 a comin'
parent a29732e8
<?php <?php
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group. # Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
require("defs.php3"); require("defs.php3");
...@@ -291,3 +291,4 @@ else { ...@@ -291,3 +291,4 @@ else {
echo "</div>\n"; echo "</div>\n";
echo "</body></html>"; echo "</body></html>";
} }
?>
...@@ -578,7 +578,7 @@ function TBGetVersionInfo(&$major, &$minor, &$build) ...@@ -578,7 +578,7 @@ function TBGetVersionInfo(&$major, &$minor, &$build)
DBQuery("select value from version_info where name='dbrev'"); DBQuery("select value from version_info where name='dbrev'");
if ($query_result && mysql_num_rows($query_result)) { if ($query_result && mysql_num_rows($query_result)) {
$row = mysql_fetch_row($query_result); $row = mysql_fetch_row($query_result);
list($a,$b) = split('\.', $row[0]); list($a,$b) = preg_split('/\./', $row[0]);
$a = (isset($a) && $a != "" ? $a : "x"); $a = (isset($a) && $a != "" ? $a : "x");
$b = (isset($b) && $b != "" ? $b : "y"); $b = (isset($b) && $b != "" ? $b : "y");
$major = $a; $major = $a;
......
<?php <?php
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2005-2009 University of Utah and the Flux Group. # Copyright (c) 2005-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
include("defs.php3"); include("defs.php3");
...@@ -64,9 +64,9 @@ while ($row = mysql_fetch_array($query_result)) { ...@@ -64,9 +64,9 @@ while ($row = mysql_fetch_array($query_result)) {
} }
# Have to convert the date/time to RFC822 format # Have to convert the date/time to RFC822 format
list($date, $hours) = split(' ', $timestamp); list($date, $hours) = preg_split(' ', $timestamp);
list($year,$month,$day) = split('-',$date); list($year,$month,$day) = preg_split('-',$date);
list($hour,$min,$sec) = split(':',$hours); list($hour,$min,$sec) = preg_split(':',$hours);
$rfc822date = date("r",mktime($hour, $min, $sec, $month, $day, $year)); $rfc822date = date("r",mktime($hour, $min, $sec, $month, $day, $year));
if ($first) { if ($first) {
......
<?php <?php
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2003, 2004, 2006, 2007 University of Utah and the Flux Group. # Copyright (c) 2003-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
include("defs.php3"); include("defs.php3");
...@@ -54,7 +54,7 @@ $nodeversions = array(); ...@@ -54,7 +54,7 @@ $nodeversions = array();
$res = DBQueryFatal("select feature from node_features" . $res = DBQueryFatal("select feature from node_features" .
" where feature like 'plabstatus-%' group by feature"); " where feature like 'plabstatus-%' group by feature");
while ($row = mysql_fetch_row($res)) { while ($row = mysql_fetch_row($res)) {
list($foo,$feature) = split("\-",$row[0]); list($foo,$feature) = preg_split('/\-/',$row[0]);
$nodeversions[] = $feature; $nodeversions[] = $feature;
} }
if (count($nodeversions) == 0) { if (count($nodeversions) == 0) {
......
<?php <?php
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group. # Copyright (c) 2005-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
include("defs.php3"); include("defs.php3");
...@@ -61,7 +61,7 @@ else { ...@@ -61,7 +61,7 @@ else {
$body_str .= "Update last power time for:<br>"; $body_str .= "Update last power time for:<br>";
$body_str .= "<form action='powertime.php3' method=get><br><table>"; $body_str .= "<form action='powertime.php3' method=get><br><table>";
$body_str .= "<tr><th>Update?</th><th>Node ID</th><th>Last Power</th></tr>"; $body_str .= "<tr><th>Update?</th><th>Node ID</th><th>Last Power</th></tr>";
foreach (split(",", $node_id) as $ni) { foreach (preg_split(",", $node_id) as $ni) {
if (!TBvalid_node_id($ni)) { if (!TBvalid_node_id($ni)) {
USERERROR("Invalid node ID: $ni", 1); USERERROR("Invalid node ID: $ni", 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment