forked from nilsteampassnet/TeamPass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
views_logs.php
151 lines (144 loc) · 7.26 KB
/
views_logs.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
/**
* @file views_logs.php
* @author Nils Laumaillé
* @version 2.1.20
* @copyright (c) 2009-2014 Nils Laumaillé
* @licensing GNU AFFERO GPL 3.0
* @link http://www.teampass.net
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
require_once('sources/sessions.php');
session_start();
if (
!isset($_SESSION['CPM']) || $_SESSION['CPM'] != 1 ||
!isset($_SESSION['user_id']) || empty($_SESSION['user_id']) ||
!isset($_SESSION['key']) || empty($_SESSION['key']))
{
die('Hacking attempt...');
}
/* do checks */
require_once $_SESSION['settings']['cpassman_dir'].'/sources/checks.php';
if (!checkUser($_SESSION['user_id'], $_SESSION['key'], "manage_views")) {
$_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page
include 'error.php';
exit();
}
include $_SESSION['settings']['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
include $_SESSION['settings']['cpassman_dir'].'/includes/settings.php';
include $_SESSION['settings']['cpassman_dir'].'/includes/include.php';
header("Content-type: text/html; charset=utf-8");
include $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php';
require_once $_SESSION['settings']['cpassman_dir'].'/sources/SplClassLoader.php';
//Load file
require_once 'views_logs.load.php';
//TAB 6 - LOGS
echo '
<input type="hidden" id="type_log_displayed" />
<div id="tabs-6">
<div id="radio_log">
<input type="radio" id="radio60" name="radio" onclick="manage_div_display(\'tab6_0\'); loadTable(\'t_connections\');" /><label for="radio60">'.$LANG['connections'].'</label>
<input type="radio" id="radio61" name="radio" onclick="manage_div_display(\'tab6_1\'); loadTable(\'t_errors\');" /><label for="radio61">'.$LANG['errors'].'</label>
<input type="radio" id="radio62" name="radio" onclick="manage_div_display(\'tab6_2\'); loadTable(\'t_access\');" /><label for="radio62">'.$LANG['at_shown'].'</label>
<input type="radio" id="radio63" name="radio" onclick="manage_div_display(\'tab6_3\'); loadTable(\'t_copy\');" /><label for="radio63">'.$LANG['at_copy'].'</label>
<input type="radio" id="radio64" name="radio" onclick="manage_div_display(\'tab6_4\'); loadTable(\'t_admin\');" /><label for="radio64">'.$LANG['admin'].'</label>
<input type="radio" id="radio65" name="radio" onclick="manage_div_display(\'tab6_5\'); loadTable(\'t_items\');" /><label for="radio65">'.$LANG['items'].'</label>
</div>
<div id="tab6_0" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_connections_page">
<table id="t_connections" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;">'.$LANG['date'].'</th>
<th style="width:25%;">'.$LANG['action'].'</th>
<th style="width:30%;">'.$LANG['user'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
<div id="tab6_1" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_errors_page">
<table id="t_errors" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;">'.$LANG['date'].'</th>
<th style="width:60%;">'.$LANG['label'].'</th>
<th style="width:20%;">'.$LANG['user'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
<div id="tab6_2" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_access_page">
<table id="t_access" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;">'.$LANG['date'].'</th>
<th style="width:40%;">'.$LANG['label'].'</th>
<th style="width:20%;">'.$LANG['user'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
<div id="tab6_3" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_copy_page">
<table id="t_copy" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;">'.$LANG['date'].'</th>
<th style="width:40%;">'.$LANG['label'].'</th>
<th style="width:20%;">'.$LANG['user'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
<div id="tab6_4" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_admin_page">
<table id="t_admin" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width:30%;">'.$LANG['date'].'</th>
<th style="width:30%;">'.$LANG['user'].'</th>
<th style="width:40%;">'.$LANG['action'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
<div id="tab6_5" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_items_page">
<table id="t_items" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;">'.$LANG['date'].'</th>
<th style="width:40%;">'.$LANG['user'].'</th>
<th style="width:20%;">'.$LANG['label'].'</th>
<th style="width:20%;">'.$LANG['at_personnel'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>' ,
isset($_SESSION['user_admin']) && $_SESSION['user_admin'] == 1 ? '
<div id="div_log_purge" style="margin-top:30px;padding:10px;display:none;" class="ui-state-highlight ">
<label for="purgeFrom">'.$LANG['purge_log'].'</label>
<input type="text" id="purgeFrom" name="purgeFrom" />
<label for="purgeTo">'.$LANG['to'].'</label>
<input type="text" id="purgeTo" name="purgeTo" />
<input type="button" id="butPurge" value="'.$LANG['purge_now'].'" />
<span id="purge_result"></span>
</div>' : '', '
</div>';