This repository has been archived by the owner on Aug 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
eventlog.php
80 lines (73 loc) · 2.94 KB
/
eventlog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/*
* @author: Scottish Borders Design
* @script: SBD SHOUTcast Manager
* @function: Event Log Page
* @website: http://scottishbordersdesign.co.uk/
*/
header('Access-Control-Allow-Origin: *');
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
include('header.php');
$db = dbConnect();
$config = settings();
if (isset($_GET['clear'])) {
switch ($_GET['clear']) {
case 'admin':
$clear = $db->rawQuery("TRUNCATE TABLE events");
break;
case 'api':
$clear = $db->rawQuery("TRUNCATE TABLE api_events");
break;
default:
# code...
break;
}
}
?>
<h1>
Event Log
<small>View users tracks</small>
</h1>
<ol class="breadcrumb">
<li><a href="home.php"><i class="fa fa-dashboard"></i> SHOUTcast Panel</a></li>
<li class="active"><i class="glyphicon glyphicon-book"></i> Event Log</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-lg-12 col-xs-12">
<div class="box box-solid">
<div class="box-header" style=" ">
<h3 class="box-title">Clear Logs</h3>
</div>
<div class="box-body">
<p>Click the buttons to clear the logs</p>
<p><a class="btn btn-success btn-s" href="<?php echo $config['web_addr'] ?>/events/admin/1/?clear=admin">Clear Admin Log</a> <a class="btn btn-success btn-s" href="<?php echo $config['web_addr'] ?>/events/api/1/?clear=api">Clear API Log</a></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<?php
if(useraccess($_SESSION['username']) < "4"){
echo "<div class=\"alert alert-danger alert-dismissable\"><i class=\"fa fa-check\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button><b>Error!</b> ACCESS DENIED</div>";
}else{
if ($_GET['log'] == "admin") {
include('eventviewer.php');
} elseif($_GET['log'] == "api"){
include('apieventviewer.php');
} else {
echo "Error Fetching Event Logs.";
}
?>
</div><!-- /.row -->
</div>
<!-- place holder -->
<?php
}
require('footer.php');
?>