File: C:/laragon/www/beplocal/TableUtentiAuthData.php
<?php
include_once 'DBClassOkta.php';
include_once 'Utilities.php';
$DatabaseService = new DatabaseService();
$conn = $DatabaseService->getConnection();// get data and store in a json array
$filterSql = $_POST['filter'];
$jwt = $_POST['jwt'];
$authLevel = $_POST['AUTH_LEVEL'];
if(verificaToken($jwt, $authLevel)) {
$queryPerAuth = "Select ".
"us.idUsers, ".
"us.login, ".
"us.nome, ".
"us.cognome, ".
"al.CodificaLivello , ".
"al.DescrizioneLivello ".
"From Users as us ".
"left join UserAuth as ua on us.idUsers = ua.idUser ".
"left join AuthLevel as al on al.idAuthLevel = ua.IdAuth ".
"where true ".$filterSql." ";
$stmt = $conn->prepare($queryPerAuth);
$stmt->execute();
$num = $stmt->rowCount();
$items = array();
while ($row = $stmt->fetch()){
$items[] = array(
'idUsers' => $row['idUsers'],
'login' => $row['login'],
'nome' => $row['nome'],
'cognome' => $row['cognome'],
'CodificaLivello' => $row['CodificaLivello'],
'DescrizioneLivello' => $row['DescrizioneLivello']);
}
echo json_encode($items);
} else {
echo json_encode(array('message' => "Errore nella procedura della tabela prodotti. Contattare il supporto tecnico"));
}
?>