Files
XC_VM/src/admin/restream_logs.php
T

71 lines
5.8 KiB
PHP

<?php include 'session.php'; ?>
<?php include 'functions.php'; ?>
<?php if (!checkPermissions()) {
goHome();
} ?>
<?php $_TITLE = 'Restream Detection Logs'; ?>
<?php include 'header.php'; ?>
<div class="wrapper boxed-layout-ext"
<?php if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
echo ' style="display: none;"';
} ?>>
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="page-title-box">
<h4 class="page-title">Restream Detection Logs</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="alert alert-info" role="alert">
<?php
if (CoreUtilities::$rSettings['detect_restream_block_user'] && CoreUtilities::$rSettings['detect_restream_block_ip']) {
echo 'Your service is set up to automatically block the lines and IP addresses of those detected restreaming without permission.';
} elseif (!CoreUtilities::$rSettings['detect_restream_block_user'] && CoreUtilities::$rSettings['detect_restream_block_ip']) {
echo 'Your service is set up to automatically block the IP addresses of those detected restreaming without permission. Lines will remain active.';
} elseif (CoreUtilities::$rSettings['detect_restream_block_user'] && !CoreUtilities::$rSettings['detect_restream_block_ip']) {
echo "Your service is set up to automatically block the lines of those detected restreaming without permission. IP's will not be automatically blocked.";
} else {
echo "Your service is set up to detect restreaming without permission, however it won't automatically block IP addresses or lines.";
}
?>
</div>
<div class="card">
<div class="card-body" style="overflow-x:auto;">
<table id="datatable" class="table table-striped table-borderless dt-responsive nowrap">
<thead>
<tr>
<th class="text-center"><?php echo $_['id']; ?></th>
<th><?php echo $_['username']; ?></th>
<th><?php echo $_['stream']; ?></th>
<th class="text-center"><?php echo $_['ip']; ?></th>
<th class="text-center"><?php echo $_['date']; ?></th>
<th class="text-center"><?php echo $_['actions']; ?></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'footer.php'; ?>
<script id="scripts">
<?php
echo ' ' . "\r\n" . ' function api(rID, rType, rConfirm=false) {' . "\r\n" . ' if ((rType == "block") && (!rConfirm)) {' . "\r\n" . ' new jBox("Confirm", {' . "\r\n" . ' confirmButton: "Block",' . "\r\n" . ' cancelButton: "Cancel",' . "\r\n" . ' content: "Are you sure you want to block this IP address?",' . "\r\n" . ' confirm: function () {' . "\r\n" . ' api(rID, rType, true);' . "\r\n" . ' }' . "\r\n" . ' }).open();' . "\r\n\t\t\t" . '} else {' . "\r\n" . ' rConfirm = true;' . "\r\n" . ' }' . "\r\n" . ' if (rConfirm) {' . "\r\n" . ' $.getJSON("./api?action=mysql_syslog&sub=" + rType + "&ip=" + rID, function(data) {' . "\r\n" . ' if (data.result === true) {' . "\r\n" . ' if (rType == "block") {' . "\r\n" . ' $.toast("IP has been blocked.");' . "\r\n" . ' }' . "\r\n" . ' $("#datatable").DataTable().ajax.reload(null, false);' . "\r\n" . ' } else {' . "\r\n" . ' $.toast("';
echo $_['error_occured'];
echo '");' . "\r\n" . ' }' . "\r\n" . ' });' . "\r\n" . ' }' . "\r\n\t\t" . '}' . "\r\n\r\n\t\t" . '$(document).ready(function() {' . "\r\n\t\t\t" . '$("#datatable").DataTable({' . "\r\n\t\t\t\t" . 'language: {' . "\r\n\t\t\t\t\t" . 'paginate: {' . "\r\n\t\t\t\t\t\t" . "previous: \"<i class='mdi mdi-chevron-left'>\"," . "\r\n\t\t\t\t\t\t" . "next: \"<i class='mdi mdi-chevron-right'>\"" . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'drawCallback: function() {' . "\r\n\t\t\t\t\t" . 'bindHref(); refreshTooltips();' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'responsive: false,' . "\r\n\t\t\t\t" . 'processing: true,' . "\r\n\t\t\t\t" . 'serverSide: true,' . "\r\n\t\t\t\t" . 'ajax: {' . "\r\n\t\t\t\t\t" . 'url: "./table",' . "\r\n\t\t\t\t\t" . '"data": function(d) {' . "\r\n\t\t\t\t\t\t" . 'd.id = "restream_logs";' . "\r\n\t\t\t\t\t" . '}' . "\r\n\t\t\t\t" . '},' . "\r\n\t\t\t\t" . 'columnDefs: [' . "\r\n\t\t\t\t\t" . '{"className": "dt-center", "targets": [3,4,5]},' . "\r\n" . ' {"visible": false, "targets": [0]}' . "\r\n\t\t\t\t" . '],' . "\r\n" . ' order: [[ 4, "desc" ]]' . "\r\n\t\t\t" . '});' . "\r\n\t\t\t" . '$("#datatable").css("width", "100%");' . "\r\n\t\t" . '});' . "\r\n" . ' ' . "\r\n" . ' ';
?>
</script>
<script src="assets/js/listings.js"></script>
</body>
</html>