require __DIR__ . '/../inc/init.php'; require __DIR__ . '/../func/privilege.php'; require __DIR__ . '/../conf/database.php'; header('Content-Type: application/json'); $arr = array('success' => false, 'title' => '', 'content' => '', 'time' => '', 'priv' => ''); if (!isset($_POST['newsid'])) { $arr['content'] = _('Invalid Argument...'); die(json_encode($arr)); } $newsid = intval($_POST['newsid']); $res = mysqli_query($con, "select title,content,time,privilege from news where news_id={$newsid}"); $row = mysqli_fetch_row($res); if (($require_auth == 1 || $row[3] != 0) && !isset($_SESSION['user'])) { $arr['content'] = _('Permission Denied...'); die(json_encode($arr)); } if ($row[3] != 0) { if (!($_SESSION['priv'] & $row[3])) { $arr['content'] = _('Permission Denied...'); die(json_encode($arr)); } } if (empty($row[1])) { $row[1] = _('This piece of news is empty...'); } $arr['success'] = true; $arr['title'] = $row[0]; $arr['content'] = $row[1]; $arr['time'] = $row[2]; $arr['priv'] = list_priv($row[3]); echo json_encode($arr);
</td><td><?php echo $row[12], ' (', $row[11], ')'; ?> </td></tr> <tr><td colspan="2"><?php echo _('Last Seen'); ?> </td><td><?php echo $row[3]; ?> </td></tr> <tr><td colspan="2"><?php echo _('Privilege'); ?> </td><td><?php echo list_priv($row[10]); ?> </td></tr> <?php if (check_priv(PRIV_SYSTEM)) { ?> <tr><td colspan="2"><?php echo _('IP Address'); ?> </td><td><?php echo $row[2] . ' ' . get_ipgeo($row[2]); ?> </td></tr> <?php } ?>
</thead> <tbody> <?php require __DIR__ . '/../func/userinfo.php'; while ($row = mysqli_fetch_row($res)) { echo '<tr><td><img class="img-circle" src="' . get_gravatar($row[6], 30) . '" width="30" height="30"></td>'; echo '<td style="text-align:left"><strong><a href="#linkU">' . $row[0] . '</a></strong>'; if ($row[5] == 'Y') { if (is_null($row[1])) { echo '<span style="color:red"> ', _('To Be Reviewed'), '</span>'; } else { echo '<span style="color:red"> ', _('Disabled'), '</span>'; } } echo '</td>'; echo '<td>' . list_priv($row[7]) . '(<span>' . $row[7] . '</span>)</td>'; echo '<td>', $row[1], '</td>'; echo '<td>', $row[2], '/', $row[3], '</td>'; echo '<td><div class="btn-group"><a href="#email" class="btn btn-default">', _('Email'), '</a><a href="#priv" class="btn btn-default">', _('Privilege'), '</a><a href="#del" class="btn btn-default'; if ($row[7] & PRIV_SYSTEM) { echo ' disabled'; } if ($row[5] == 'Y') { echo '">', _('Enable'); } else { echo '">', _('Disable'); } echo '</a></div></td></tr>'; } ?> </tbody>