This repository has been archived by the owner on Oct 12, 2021. It is now read-only.
forked from nilsteampassnet/TeamPass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
views_database.php
93 lines (86 loc) · 4.02 KB
/
views_database.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
<?php
/**
* @package views_database.php
* @author Nils Laumaillé <nils@teampass.net>
* @version 2.1.27
* @copyright 2009-2019 Nils Laumaillé
* @license GNU GPL-3.0
* @link https://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/SecureHandler.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...');
}
// Load config
if (file_exists('../includes/config/tp.config.php')) {
include_once '../includes/config/tp.config.php';
} elseif (file_exists('./includes/config/tp.config.php')) {
include_once './includes/config/tp.config.php';
} else {
throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
}
/* do checks */
include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
require_once $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 $SETTINGS['cpassman_dir'].'/error.php';
exit();
}
include $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
include $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
header("Content-type: text/html; charset=utf-8");
require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
//Load file
require_once 'views_database.load.php';
//TAB 5 - DATABASE
echo '
<div id="tabs-5">
<div id="radio_database">
<input type="radio" id="radio10" name="radio_db" onclick="manage_div_display(\'tab5_1\'); loadTable(\'t_items_edited\');" /><label for="radio10">'.$LANG['db_items_edited'].'</label>
<input type="radio" id="radio11" name="radio_db" onclick="manage_div_display(\'tab5_2\'); loadTable(\'t_users_logged\');" /><label for="radio11">'.$LANG['db_users_logged'].'</label>
</div>
<div id="tab5_1" style="display:none;margin-top:30px;">
<div style="margin:10px auto 25px auto;min-height:250px;" id="items_edited_page">
<table id="t_items_edited" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;"></th>
<th style="width:25%;">'.$LANG['item_edition_start_hour'].'</th>
<th style="width:30%;">'.$LANG['user'].'</th>
<th style="width:35%;">'.$LANG['label'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
<div id="tab5_2" style="display:none;margin-top:30px;">
<div style="font-style:italic;">
<input type="button" class="button" id="but_disconnect_all_users" value="'.htmlentities(strip_tags($LANG['disconnect_all_users']), ENT_QUOTES).'"><br />
'.$LANG['info_list_of_connected_users_approximation'].'
</div>
<div style="margin:10px auto 25px auto;min-height:250px;" id="t_users_logged_page">
<table id="t_users_logged" cellspacing="0" cellpadding="5" width="100%">
<thead><tr>
<th style="width-max:38px;"></th>
<th style="width:40%;">'.$LANG['user'].'</th>
<th style="width:20%;">'.$LANG['role'].'</th>
<th style="width:20%;">'.$LANG['login_time'].'</th>
</tr></thead>
<tbody>
<tr><td></td></tr>
</tbody>
</table>
</div>
</div>
</div>';