refactor global array

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 20:31:17 +01:00
parent 5fa0f4b87e
commit c5a58e3f36
68 changed files with 646 additions and 613 deletions

View File

@@ -43,7 +43,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
'ip' => $lng['admin']['ipsandports']['ip'],
'port' => $lng['admin']['ipsandports']['port']
);
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields);
$paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_IPSANDPORTS, $fields);
$ipsandports = '';
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
Database::pexecute($result_stmt);
@@ -70,7 +70,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports") . "\";");
} elseif ($action == 'delete' && $id != 0) {
try {
$json_result = IpsAndPorts::getLocal($userinfo, array(
$json_result = IpsAndPorts::getLocal(\Froxlor\User::getAll(), array(
'id' => $id
))->get();
} catch (Exception $e) {
@@ -82,7 +82,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
try {
IpsAndPorts::getLocal($userinfo, array(
IpsAndPorts::getLocal(\Froxlor\User::getAll(), array(
'id' => $id
))->delete();
} catch (Exception $e) {
@@ -104,7 +104,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
} elseif ($action == 'add') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
try {
IpsAndPorts::getLocal($userinfo, $_POST)->add();
IpsAndPorts::getLocal(\Froxlor\User::getAll(), $_POST)->add();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -124,7 +124,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
}
} elseif ($action == 'edit' && $id != 0) {
try {
$json_result = IpsAndPorts::getLocal($userinfo, array(
$json_result = IpsAndPorts::getLocal(\Froxlor\User::getAll(), array(
'id' => $id
))->get();
} catch (Exception $e) {
@@ -136,7 +136,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
try {
IpsAndPorts::getLocal($userinfo, $_POST)->update();
IpsAndPorts::getLocal(\Froxlor\User::getAll(), $_POST)->update();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}