-
-
Notifications
You must be signed in to change notification settings - Fork 531
/
search.php
executable file
·122 lines (111 loc) · 3.95 KB
/
search.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
<?php
declare(strict_types=1);
/**
* Teampass - a collaborative passwords manager.
* ---
* 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.
* ---
*
* @project Teampass
* @version 3.0.6
* @file search.php
* ---
*
* @author Nils Laumaillé (nils@teampass.net)
*
* @copyright 2009-2023 Teampass.net
*
* @license https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0
* ---
*
* @see https://www.teampass.net
*/
if (
isset($_SESSION['CPM']) === false || $_SESSION['CPM'] !== 1
|| isset($_SESSION['user_id']) === false || empty($_SESSION['user_id']) === true
|| isset($_SESSION['key']) === false || empty($_SESSION['key']) === true
) {
die('Hacking attempt...');
}
// Load config
if (file_exists('../includes/config/tp.config.php') === true) {
include_once '../includes/config/tp.config.php';
} elseif (file_exists('./includes/config/tp.config.php') === true) {
include_once './includes/config/tp.config.php';
} else {
throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
}
/* do checks */
require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) {
$_SESSION['error']['code'] = ERR_NOT_ALLOWED;
//not allowed page
include $SETTINGS['cpassman_dir'] . '/error.php';
exit;
}
// Load
require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
?>
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0 text-dark"><i class="fas fa-search mr-2"></i><?php echo langHdl('find'); ?></h1>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- MASS OPERATION -->
<div class="card card-warning m-2 hidden" id="dialog-mass-operation">
<div class="card-header">
<h3 class="card-title">
<i class="fa fa-bug mr-2"></i>
<?php echo langHdl('mass_operation'); ?>
</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-sm-12 col-md-12" id="dialog-mass-operation-html">
</div>
</div>
</div>
<div class="card-footer">
<button class="btn btn-primary mr-2" id="dialog-mass-operation-button"><?php echo langHdl('perform'); ?></button>
<button class="btn btn-default float-right close-element"><?php echo langHdl('cancel'); ?></button>
</div>
</div>
<!-- /.MASS OPERATION -->
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title mr-2" id="search-select"></h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="search-results-items" class="table table-bordered table-striped" style="width:100%">
<thead>
<tr>
<th></th>
<th><?php echo langHdl('label'); ?></th>
<th><?php echo langHdl('login'); ?></th>
<th><?php echo langHdl('description'); ?></th>
<th><?php echo langHdl('tags'); ?></th>
<th><?php echo langHdl('url'); ?></th>
<th><?php echo langHdl('group'); ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>