use correct method to get CurrentUser data-field

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-03 20:04:55 +02:00
parent 64994e6444
commit 2bb5c31a0f

View File

@@ -216,7 +216,7 @@ class Listing
$del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_USERCOLUMNS . "` WHERE `" . $userid . "` = :uid AND `section` = :section
");
Database::pexecute($del_stmt, ['uid' => CurrentUser::getData($userid), 'section' => $section]);
Database::pexecute($del_stmt, ['uid' => CurrentUser::getField($userid), 'section' => $section]);
// add new entry
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_USERCOLUMNS . "` SET
@@ -225,7 +225,7 @@ class Listing
`columns` = :cols
");
Database::pexecute($ins_stmt, [
'uid' => CurrentUser::getData($userid),
'uid' => CurrentUser::getField($userid),
'section' => $section,
'cols' => json_encode($tabellisting[$section])
]);
@@ -241,7 +241,7 @@ class Listing
$sel_stmt = Database::prepare("
SELECT `columns` FROM `" . TABLE_PANEL_USERCOLUMNS . "` WHERE `" . $userid . "` = :uid AND `section` = :section
");
$columns_json = Database::pexecute_first($sel_stmt, ['uid' => CurrentUser::getData($userid), 'section' => $listing]);
$columns_json = Database::pexecute_first($sel_stmt, ['uid' => CurrentUser::getField($userid), 'section' => $listing]);
if ($columns_json && isset($columns_json['columns'])) {
return json_decode($columns_json['columns'], true);
}