aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2018-01-30 11:33:25 -0500
committerBrian Evans <grknight@gentoo.org>2018-01-30 11:33:25 -0500
commit7502757bdae610d26b53d14c01aec68b17e9fbc3 (patch)
treefeb804485e92e1d5db6bc9bc93fd0e5b72ae402e
parentUpdate footer copyright (diff)
downloadbouncer-7502757bdae610d26b53d14c01aec68b17e9fbc3.tar.gz
bouncer-7502757bdae610d26b53d14c01aec68b17e9fbc3.tar.bz2
bouncer-7502757bdae610d26b53d14c01aec68b17e9fbc3.zip
Silence Notices with defaults and reference removals
-rw-r--r--php/admin/index.php1
-rw-r--r--php/admin/locations.php2
-rw-r--r--php/admin/os.php3
-rw-r--r--php/admin/products.php1
-rw-r--r--php/admin/regions.php1
-rw-r--r--php/admin/users.php2
-rw-r--r--php/inc/footer.php3
-rw-r--r--php/lib/forms.php24
-rw-r--r--php/lib/list.php3
-rw-r--r--php/lib/util.php23
10 files changed, 33 insertions, 30 deletions
diff --git a/php/admin/index.php b/php/admin/index.php
index e8feaec..aceae66 100644
--- a/php/admin/index.php
+++ b/php/admin/index.php
@@ -103,6 +103,7 @@ form_end();
echo '<h2>Add a Mirror</h2>';
form_start();
+$posts = ['mirror_name' => '', 'region_id' => '', 'mirror_baseurl' => '', 'mirror_rating' => ''];
include_once(INC.'/forms/mirror.php');
form_submit('add-submit','','button1','Add Mirror');
form_end();
diff --git a/php/admin/locations.php b/php/admin/locations.php
index e868d1a..138cff1 100644
--- a/php/admin/locations.php
+++ b/php/admin/locations.php
@@ -92,9 +92,9 @@ form_end();
echo '<h2>Add a Location</h2>';
form_start();
+$posts = ['product_id' => '','os_id' =>'', 'location_path' => ''];
include_once(INC.'/forms/location.php');
form_submit('add-submit','','button1','Add Location');
form_end();
require_once(FOOTER);
-?>
diff --git a/php/admin/os.php b/php/admin/os.php
index 72bb383..731d405 100644
--- a/php/admin/os.php
+++ b/php/admin/os.php
@@ -92,9 +92,10 @@ form_end();
echo '<h2>Add a OS</h2>';
form_start();
+$posts = ['os_name'=>'', 'os_priority'=>'']; //sane defaults
include_once(INC.'/forms/os.php');
form_submit('add-submit','','button1','Add OS');
form_end();
require_once(FOOTER);
-?>
+
diff --git a/php/admin/products.php b/php/admin/products.php
index cdc20ec..962a3cd 100644
--- a/php/admin/products.php
+++ b/php/admin/products.php
@@ -93,6 +93,7 @@ form_end();
echo '<h2>Add a Product</h2>';
form_start();
+$posts = ['product_name'=>'', 'product_priority'=>'']; //sane defaults
include_once(INC.'/forms/product.php');
form_submit('add-submit','','button1','Add Product');
form_end();
diff --git a/php/admin/regions.php b/php/admin/regions.php
index 0709e43..f2b6b54 100644
--- a/php/admin/regions.php
+++ b/php/admin/regions.php
@@ -93,6 +93,7 @@ form_end();
echo '<h2>Add a Region</h2>';
form_start();
+$posts = ['region_name'=>'', 'region_priority'=>''];
include_once(INC.'/forms/region.php');
form_submit('add-submit','','button1','Add Region');
form_end();
diff --git a/php/admin/users.php b/php/admin/users.php
index 4926117..4814f0d 100644
--- a/php/admin/users.php
+++ b/php/admin/users.php
@@ -96,9 +96,9 @@ form_end();
echo '<h2>Add a User</h2>';
form_start();
+$posts = ['username'=>'', 'user_firstname'=>'', 'user_lastname'=>'', 'user_email'=>'']; //sane defaults
include_once(INC.'/forms/user.php');
form_submit('add-submit','','button1','Add User');
form_end();
require_once(FOOTER);
-?>
diff --git a/php/inc/footer.php b/php/inc/footer.php
index efa17e7..ef9d0fe 100644
--- a/php/inc/footer.php
+++ b/php/inc/footer.php
@@ -14,11 +14,10 @@ if (!empty($nav)) {
}
?>
<div id="footer">
-<p class="copyright">Copyright &copy; 2005 The Gentoo Foundation, portions Copyright &copy; 1998-2004 The Mozilla Organization</p>
+<p class="copyright">Copyright &copy; 2005-2018 The Gentoo Foundation, portions Copyright &copy; 1998-2004 The Mozilla Organization</p>
</div>
</div>
</body>
</html>
<?php
ob_end_flush();
-?>
diff --git a/php/lib/forms.php b/php/lib/forms.php
index e435181..3ef2c5c 100644
--- a/php/lib/forms.php
+++ b/php/lib/forms.php
@@ -11,23 +11,23 @@
* @param bool $slashes default to false, this parameter indicate if stripslashes is desired, usually use for magic qoutes
* @return mixed $str cleaned for HTML
*/
-function clean_out($str, $slashes=FALSE)
-{
+function clean_out($str, $slashes=FALSE)
+{
if (is_array($str))
{
foreach ($str as $key => $val)
{
- $str[$key] =& clean_out($val, $slashes);
+ $str[$key] = clean_out($val, $slashes);
}
}
else
{
if ($slashes)
- $str =& trim(htmlentities(stripslashes($str)));
+ $str = trim(htmlentities(stripslashes($str)));
else
- $str =& trim(htmlentities($str));
+ $str = trim(htmlentities($str));
}
-
+
return $str;
}
@@ -44,18 +44,18 @@ function clean_in($str, $single_quotes=FALSE, $decode=FALSE)
{
foreach ($str as $key => $val)
{
- $str[$key] =& clean_in($val, $single_quotes);
+ $str[$key] = clean_in($val, $single_quotes);
}
}
else
{
if (get_magic_quotes_gpc() === 1)
{
- $str =& trim($str);
+ $str = trim($str);
}
- else
+ else
{
- $str =& addslashes(trim($str));
+ $str = addslashes(trim($str));
}
if ($single_quotes) {
$str = "'" . $str . "'";
@@ -77,9 +77,9 @@ function array_days($month='',$year='')
{
$days = Array();
$num = 1;
-
+
// get total number of days of a particular month if given a month and year
- if (!empty($month) && !empty($year) && is_numeric($month)
+ if (!empty($month) && !empty($year) && is_numeric($month)
&& is_numeric($year) && $month > 0 && $month < 13)
{
$days_inmonth = (int) date("t", strtotime($year."-".$month."-01"));
diff --git a/php/lib/list.php b/php/lib/list.php
index 9f480bc..8424ae3 100644
--- a/php/lib/list.php
+++ b/php/lib/list.php
@@ -109,6 +109,7 @@
*/
function show_list($list,$headers,$type='checkbox',$actions=null,$form_id=null,$sortable=true,$selected=null)
{
+ $count = 0;
if ( is_array($list) && count($list)>0 && is_array($headers) )
{
if ( $type!='simple' && !empty($_GET['sort']) && !empty($_GET['order']) )
@@ -215,7 +216,7 @@ function show_headers($headers,$type,$sortable=true)
if ($type!='simple'&&$count==0)
{
echo "\n".'<th> </th>';
- next;
+ continue;
}
elseif($sortable)
{
diff --git a/php/lib/util.php b/php/lib/util.php
index 8f8e1e4..fa95114 100644
--- a/php/lib/util.php
+++ b/php/lib/util.php
@@ -35,7 +35,7 @@ function set_msg($str=null)
*/
function show_msg($class='msg')
{
- if (is_array($_SESSION['messages']) && count($_SESSION['messages']) > 0)
+ if (isset($_SESSION['messages']) && is_array($_SESSION['messages']) && count($_SESSION['messages']) > 0)
{
echo ($class !== NULL) ? '<div class="'.$class.'">' : '';
echo '<ul>';
@@ -282,31 +282,31 @@ function array_order_by(&$array, $key=null, $order=null, $retain_keys=TRUE, $cas
return $temp_return_arr;
}
-
+
if (empty($array) || is_null($key))
return $array;
-
+
if (!array_key_exists($key, reset($array)))
return $array;
-
- $order =& strtolower($order);
+
+ $order = strtolower($order);
if ($order == '' || ($order != 'asc' && $order != 'desc'))
$order = 'asc';
-
+
// construct an array that will be used to order the keys
foreach($array as $row_key => $row)
{
$x[$row_key] = $row[$key];
}
-
+
if ($case_sensitive)
natsort($x);
else
natcasesort($x);
-
+
if ($order == 'desc')
- $x =& array_reverse($x, TRUE);
-
+ $x = array_reverse($x, TRUE);
+
// now use those keys to order the original array
foreach($x as $row_key => $uselessvalue)
{
@@ -315,8 +315,7 @@ function array_order_by(&$array, $key=null, $order=null, $retain_keys=TRUE, $cas
else
$return_arr[] =& $array[$row_key];
}
-
+
return $return_arr;
}
-?>