Skip to content

Commit

Permalink
[#431] Fix PHP warnings in customer management page.
Browse files Browse the repository at this point in the history
Fixes:
* Undefined index: sid, uid, active, login, order
* Undefined variable: string
  • Loading branch information
jaragunde committed Jan 25, 2022
1 parent 04bd184 commit 06a1e57
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 32 deletions.
7 changes: 1 addition & 6 deletions web/services/createCustomersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@

} while ($parser->read());

//var_dump($createCustomers);


if (count($createCustomers) >= 1)
foreach((array)$createCustomers as $createCustomer)
{
Expand All @@ -149,9 +146,7 @@

}



if (!$string)
if (!isset($string))
{

$string = "<return service='createCustomers'><ok>Operation Success!</ok><customers>";
Expand Down
7 changes: 1 addition & 6 deletions web/services/deleteCustomersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@

} while ($parser->read());

//var_dump($deleteCustomers);


if (count($deleteCustomers) >= 1)
foreach((array)$deleteCustomers as $deleteCustomer)
{
Expand All @@ -122,9 +119,7 @@

}



if (!$string)
if (!isset($string))
$string = "<return service='deleteCustomers'><ok>Operation Success!</ok></return>";

} while (false);
Expand Down
2 changes: 1 addition & 1 deletion web/services/getAllSectorsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
include_once(PHPREPORT_ROOT . '/model/facade/CustomersFacade.php');
include_once(PHPREPORT_ROOT . '/model/vo/SectorVO.php');

$sid = $_GET['sid'];
$sid = $_GET['sid'] ?? NULL;

do {
/* We check authentication and authorization */
Expand Down
18 changes: 5 additions & 13 deletions web/services/getUserCustomersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,15 @@
include_once(PHPREPORT_ROOT . '/model/facade/CustomersFacade.php');
include_once(PHPREPORT_ROOT . '/model/vo/UserVO.php');

$userLogin = $_GET['uid'];
$userLogin = $_GET['uid'] ?? "";

$active = $_GET['active'];

if (strtolower($active) == "true")
$active = True;
else
$active = False;
if (isset($_GET['active']) && strtolower($_GET['active']) == "true")
$active = True;

$login = $_GET['login'];

$sid = $_GET['sid'];

$order = $_GET['order'];
$sid = $_GET['sid'] ?? NULL;

if ($order == '')
$order = 'id';
$order = $_GET['order'] ?? "id";

do {
/* We check authentication and authorization */
Expand Down
7 changes: 1 addition & 6 deletions web/services/updateCustomersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@

} while ($parser->read());

//var_dump($updateCustomers);


if (count($updateCustomers) >= 1)
foreach((array)$updateCustomers as $updateCustomer)
{
Expand All @@ -158,9 +155,7 @@

}



if (!$string)
if (!isset($string))
{

$string = "<return service='updateCustomers'><ok>Operation Success!</ok><customers>";
Expand Down

0 comments on commit 06a1e57

Please sign in to comment.