1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /** |
||
6 | * Teampass - a collaborative passwords manager. |
||
7 | * --- |
||
8 | * This file is part of the TeamPass project. |
||
9 | * |
||
10 | * TeamPass is free software: you can redistribute it and/or modify it |
||
11 | * under the terms of the GNU General Public License as published by |
||
12 | * the Free Software Foundation, version 3 of the License. |
||
13 | * |
||
14 | * TeamPass is distributed in the hope that it will be useful, |
||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
17 | * GNU General Public License for more details. |
||
18 | * |
||
19 | * You should have received a copy of the GNU General Public License |
||
20 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
||
21 | * |
||
22 | * Certain components of this file may be under different licenses. For |
||
23 | * details, see the `licenses` directory or individual file headers. |
||
24 | * --- |
||
25 | * @file index.php |
||
26 | * @author Nils Laumaillé ([email protected]) |
||
27 | * @copyright 2009-2024 Teampass.net |
||
28 | * @license GPL-3.0 |
||
29 | * @see https://www.teampass.net |
||
30 | */ |
||
31 | |||
32 | use voku\helper\AntiXSS; |
||
33 | use TeampassClasses\SessionManager\SessionManager; |
||
34 | use Symfony\Component\HttpFoundation\Request as SymfonyRequest; |
||
35 | use TeampassClasses\Language\Language; |
||
36 | use TeampassClasses\ConfigManager\ConfigManager; |
||
37 | |||
38 | // Security Headers |
||
39 | header('X-XSS-Protection: 1; mode=block'); |
||
40 | // deepcode ignore TooPermissiveXFrameOptions: Not the case as sameorigin is used |
||
41 | header('X-Frame-Options: SameOrigin'); |
||
42 | |||
43 | // Cache Headers |
||
44 | header("Cache-Control: no-cache, no-store, must-revalidate"); |
||
45 | header("Pragma: no-cache"); |
||
46 | header("Expires: 0"); |
||
47 | |||
48 | // **PREVENTING SESSION HIJACKING** |
||
49 | // Prevents javascript XSS attacks aimed to steal the session ID |
||
50 | //ini_set('session.cookie_httponly', 1); |
||
51 | // **PREVENTING SESSION FIXATION** |
||
52 | // Session ID cannot be passed through URLs |
||
53 | //ini_set('session.use_only_cookies', 1); |
||
54 | // Uses a secure connection (HTTPS) if possible |
||
55 | //ini_set('session.cookie_secure', 0); |
||
56 | //ini_set('session.cookie_samesite', 'Lax'); |
||
57 | // Before we start processing, we should abort no install is present |
||
58 | if (file_exists(__DIR__.'/includes/config/settings.php') === false) { |
||
59 | // This should never happen, but in case it does |
||
60 | // this means if headers are sent, redirect will fallback to JS |
||
61 | if (headers_sent()) { |
||
62 | echo '<script language="javascript" type="text/javascript">document.location.replace("install/install.php");</script>'; |
||
63 | } else { |
||
64 | header('Location: install/install.php'); |
||
65 | } |
||
66 | // Now either way, we should stop processing further |
||
67 | exit; |
||
68 | } |
||
69 | |||
70 | |||
71 | // initialise CSRFGuard library |
||
72 | require_once __DIR__.'/includes/libraries/csrfp/libs/csrf/csrfprotector.php'; |
||
73 | csrfProtector::init(); |
||
74 | |||
75 | // Load functions |
||
76 | require_once __DIR__. '/includes/config/include.php'; |
||
77 | require_once __DIR__.'/sources/main.functions.php'; |
||
78 | |||
79 | // init |
||
80 | loadClasses(); |
||
81 | $session = SessionManager::getSession(); |
||
82 | $session->set('key', SessionManager::getCookieValue('PHPSESSID')); |
||
83 | // PHPSESSID isn't sent on first query. |
||
84 | if ($session->get('key') == null) { |
||
85 | header('Refresh: 0'); |
||
86 | exit; |
||
87 | } |
||
88 | $request = SymfonyRequest::createFromGlobals(); |
||
89 | $configManager = new ConfigManager(__DIR__, $request->getRequestUri()); |
||
90 | $SETTINGS = $configManager->getAllSettings(); |
||
91 | $antiXss = new AntiXSS(); |
||
92 | $session->set('encryptClientServer', (int) $SETTINGS['encryptClientServer'] ?? 1); |
||
93 | |||
94 | // Quick major version check -> upgrade needed? |
||
95 | if (isset($SETTINGS['teampass_version']) === true && version_compare(TP_VERSION, $SETTINGS['teampass_version']) > 0) { |
||
96 | // Perform redirection |
||
97 | if (headers_sent()) { |
||
98 | echo '<script language="javascript" type="text/javascript">document.location.replace("install/install.php");</script>'; |
||
99 | } else { |
||
100 | header('Location: install/upgrade.php'); |
||
101 | } |
||
102 | // No other way, we should stop processing further |
||
103 | exit; |
||
104 | } |
||
105 | |||
106 | |||
107 | $SETTINGS = $antiXss->xss_clean($SETTINGS); |
||
108 | |||
109 | // Load Core library |
||
110 | require_once $SETTINGS['cpassman_dir'] . '/sources/core.php'; |
||
111 | // Prepare POST variables |
||
112 | $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
||
113 | $session_user_language = $session->get('user-language'); |
||
114 | $session_user_admin = $session->get('user-admin'); |
||
115 | $session_user_human_resources = (int) $session->get('user-can_manage_all_users'); |
||
116 | $session_name = $session->get('user-name'); |
||
117 | $session_lastname = $session->get('user-lastname'); |
||
118 | $session_user_manager = $session->get('user-manager'); |
||
119 | $session_initial_url = $session->get('user-initial_url'); |
||
120 | $session_nb_users_online = $session->get('system-nb_users_online'); |
||
121 | $session_auth_type = $session->get('user-auth_type'); |
||
122 | |||
123 | $server = []; |
||
124 | $server['request_uri'] = (string) $request->getRequestUri(); |
||
125 | $server['request_time'] = (int) $request->server->get('REQUEST_TIME'); |
||
126 | |||
127 | $get = []; |
||
128 | $get['page'] = $request->query->get('page') === null ? '' : $antiXss->xss_clean($request->query->get('page')); |
||
129 | $get['otv'] = $request->query->get('otv') === null ? '' : $antiXss->xss_clean($request->query->get('otv')); |
||
130 | |||
131 | // Avoid blank page and session destroy if user go to index.php without ?page= |
||
132 | if (empty($get['page']) && !empty($session_name)) { |
||
133 | if ($session_user_admin === 1) { |
||
134 | $redirect_page = 'admin'; |
||
135 | } else { |
||
136 | $redirect_page = 'items'; |
||
137 | } |
||
138 | |||
139 | // Redirect user on default page. |
||
140 | header('Location: index.php?page='.$redirect_page); |
||
141 | exit(); |
||
142 | } |
||
143 | |||
144 | /* DEFINE WHAT LANGUAGE TO USE */ |
||
145 | if (null === $session->get('user-validite_pw') && $post_language === null && $session_user_language === null) { |
||
146 | //get default language |
||
147 | $dataLanguage = DB::queryFirstRow( |
||
148 | 'SELECT m.valeur AS valeur, l.flag AS flag |
||
149 | FROM ' . prefixTable('misc') . ' AS m |
||
150 | INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name) |
||
151 | WHERE m.type=%s_type AND m.intitule=%s_intitule', |
||
152 | [ |
||
153 | 'type' => 'admin', |
||
154 | 'intitule' => 'default_language', |
||
155 | ] |
||
156 | ); |
||
157 | if (empty($dataLanguage['valeur'])) { |
||
158 | $session->set('user-language', 'english'); |
||
159 | $session->set('user-language_flag', 'us.png'); |
||
160 | $session_user_language = 'english'; |
||
161 | } else { |
||
162 | $session->set('user-language', $dataLanguage['valeur']); |
||
163 | $session->set('user-language_flag', $dataLanguage['flag']); |
||
164 | $session_user_language = $dataLanguage['valeur']; |
||
165 | } |
||
166 | } elseif (isset($SETTINGS['default_language']) === true && $session_user_language === null) { |
||
167 | $session->set('user-language', $SETTINGS['default_language']); |
||
168 | $session_user_language = $SETTINGS['default_language']; |
||
169 | } elseif ($post_language !== null) { |
||
170 | $session->set('user-language', $post_language); |
||
171 | $session_user_language = $post_language; |
||
172 | } elseif ($session_user_language === null || empty($session_user_language) === true) { |
||
173 | if ($post_language !== null) { |
||
174 | $session->set('user-language', $post_language); |
||
175 | $session_user_language = $post_language; |
||
176 | } elseif ($session_user_language !== null) { |
||
177 | $session->set('user-language', $SETTINGS['default_language']); |
||
178 | $session_user_language = $SETTINGS['default_language']; |
||
179 | } |
||
180 | } |
||
181 | $lang = new Language($session_user_language, __DIR__. '/includes/language/'); |
||
182 | |||
183 | if (isset($SETTINGS['cpassman_dir']) === false || $SETTINGS['cpassman_dir'] === '') { |
||
184 | $SETTINGS['cpassman_dir'] = __DIR__; |
||
185 | $SETTINGS['cpassman_url'] = (string) $server['request_uri']; |
||
186 | } |
||
187 | |||
188 | // Get the URL |
||
189 | $cpassman_url = isset($SETTINGS['cpassman_url']) ? $SETTINGS['cpassman_url'] : ''; |
||
190 | // URL validation |
||
191 | if (!filter_var($cpassman_url, FILTER_VALIDATE_URL)) { |
||
192 | $cpassman_url = ''; |
||
193 | } |
||
194 | // Sanitize the URL to prevent XSS |
||
195 | $cpassman_url = htmlspecialchars($cpassman_url, ENT_QUOTES, 'UTF-8'); |
||
196 | |||
197 | // Some template adjust |
||
198 | if (array_key_exists($get['page'], $mngPages) === true) { |
||
199 | $menuAdmin = true; |
||
200 | } else { |
||
201 | $menuAdmin = false; |
||
202 | } |
||
203 | |||
204 | // Some template adjust |
||
205 | if (array_key_exists($get['page'], $utilitiesPages) === true) { |
||
206 | $menuUtilities = true; |
||
207 | } else { |
||
208 | $menuUtilities = false; |
||
209 | } |
||
210 | |||
211 | // Get the favicon |
||
212 | $favicon = isset($SETTINGS['favicon']) ? $SETTINGS['favicon'] : ''; |
||
213 | // URL Validation |
||
214 | if (!filter_var($favicon, FILTER_VALIDATE_URL)) { |
||
215 | $favicon = ''; |
||
216 | } |
||
217 | // Sanitize the URL to prevent XSS |
||
218 | $favicon = htmlspecialchars($favicon, ENT_QUOTES, 'UTF-8'); |
||
219 | |||
220 | // Define the date and time format |
||
221 | $date_format = isset($SETTINGS['date_format']) ? $SETTINGS['date_format'] : 'Y-m-d'; |
||
222 | $time_format = isset($SETTINGS['time_format']) ? $SETTINGS['time_format'] : 'H:i:s'; |
||
223 | |||
224 | // Force dark theme on page generation |
||
225 | $theme = $_COOKIE['teampass_theme'] ?? 'light'; |
||
226 | $theme_body = $theme === 'dark' ? 'dark-mode' : ''; |
||
227 | $theme_meta = $theme === 'dark' ? '#343a40' : '#fff'; |
||
228 | $theme_navbar = $theme === 'dark' ? 'navbar-dark' : 'navbar-white navbar-light'; |
||
229 | |||
230 | ?> |
||
231 | <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> |
||
232 | |||
233 | <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> |
||
234 | |||
235 | <head> |
||
236 | <meta http-equiv='Content-Type' content='text/html;charset=utf-8' /> |
||
237 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
||
238 | <meta http-equiv="x-ua-compatible" content="ie=edge" /> |
||
239 | <meta name="theme-color" content="<?php echo $theme_meta; ?>" /> |
||
240 | <title><?php echo $configManager->getSetting('teampass_title') ?? 'Teampass'; ?></title> |
||
241 | <script type='text/javascript'> |
||
242 | //<![CDATA[ |
||
243 | if (window.location.href.indexOf('page=') === -1 && |
||
244 | (window.location.href.indexOf('otv=') === -1 && |
||
245 | window.location.href.indexOf('action=') === -1) |
||
246 | ) { |
||
247 | if (window.location.href.indexOf('session_over=true') !== -1) { |
||
248 | location.replace('./includes/core/logout.php'); |
||
249 | } |
||
250 | } |
||
251 | //]]> |
||
252 | </script> |
||
253 | |||
254 | <!-- IonIcons --> |
||
255 | <link rel="stylesheet" href="includes/css/ionicons.min.css?v=<?php echo TP_VERSION; ?>"> |
||
256 | <!-- Theme style --> |
||
257 | <link rel="stylesheet" href="plugins/adminlte/css/adminlte.min.css?v=<?php echo TP_VERSION; ?>"> |
||
258 | <link rel="stylesheet" href="plugins/pace-progress/themes/corner-indicator.css?v=<?php echo TP_VERSION; ?>" type="text/css" /> |
||
259 | <link rel="stylesheet" href="plugins/select2/css/select2.min.css?v=<?php echo TP_VERSION; ?>" type="text/css" /> |
||
260 | <link rel="stylesheet" href="plugins/select2/theme/select2-bootstrap4.min.css?v=<?php echo TP_VERSION; ?>" type="text/css" /> |
||
261 | <!-- Theme style --> |
||
262 | <link rel="stylesheet" href="includes/css/teampass.css?v=<?php echo TP_VERSION; ?>"> |
||
263 | <!-- Google Font: Source Sans Pro --> |
||
264 | <link rel="stylesheet" type="text/css" href="includes/fonts/fonts.css?v=<?php echo TP_VERSION; ?>"> |
||
265 | <!-- Altertify --> |
||
266 | <link rel="stylesheet" href="plugins/alertifyjs/css/alertify.min.css?v=<?php echo TP_VERSION; ?>" /> |
||
267 | <link rel="stylesheet" href="plugins/alertifyjs/css/themes/bootstrap.min.css?v=<?php echo TP_VERSION; ?>" /> |
||
268 | <!-- Toastr --> |
||
269 | <link rel="stylesheet" href="plugins/toastr/toastr.min.css?v=<?php echo TP_VERSION; ?>" /> |
||
270 | <!-- favicon --> |
||
271 | <link rel="shortcut icon" type="image/png" href="<?php echo $favicon;?>"/> |
||
272 | <!-- manifest (PWA) --> |
||
273 | <link rel="manifest" href="includes/manifest.json?v=<?php echo TP_VERSION; ?>"> |
||
274 | <!-- Custom style --> |
||
275 | <?php |
||
276 | if (file_exists(__DIR__ . '/includes/css/custom.css') === true) {?> |
||
277 | <link rel="stylesheet" href="includes/css/custom.css?v=<?php echo TP_VERSION; ?>"> |
||
278 | <?php |
||
279 | } ?> |
||
280 | </head> |
||
281 | |||
282 | |||
283 | |||
284 | |||
285 | <?php |
||
286 | //error_log(print_r($session->all(), true)); |
||
287 | // display an item in the context of OTV link |
||
288 | if ((null === $session->get('user-validite_pw') || empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true) |
||
289 | && empty($get['otv']) === false) |
||
290 | { |
||
291 | include './includes/core/otv.php'; |
||
292 | exit; |
||
293 | } elseif ($session->has('user-validite_pw') && $session->get('user-validite_pw') && null !== $session->get('user-validite_pw') && $session->get('user-validite_pw') === 1 && |
||
294 | empty($get['page']) === false && empty($session->get('user-id')) === false |
||
295 | ) { |
||
296 | ?> |
||
297 | <body class="hold-transition sidebar-mini layout-navbar-fixed layout-fixed <?php echo $theme_body; ?>"> |
||
298 | <div class="wrapper"> |
||
299 | |||
300 | <!-- Navbar --> |
||
301 | <nav class="main-header navbar navbar-expand <?php echo $theme_navbar ?>"> |
||
302 | <!-- User encryption still ongoing --> |
||
303 | <div id="user_not_ready" class="alert alert-warning hidden pointer p-2 mt-2" style="position:absolute; left:200px;"> |
||
304 | <span class="align-middle infotip ml-2" title="<?php echo $lang->get('keys_encryption_not_ready'); ?>"><?php echo $lang->get('account_not_ready'); ?><span id="user_not_ready_progress"></span><i class="fa-solid fa-hourglass-half fa-beat-fade mr-2 ml-2"></i></span> |
||
305 | </div> |
||
306 | |||
307 | <!-- Left navbar links --> |
||
308 | <ul class="navbar-nav"> |
||
309 | <li class="nav-item"> |
||
310 | <a class="nav-link" data-widget="pushmenu" href="#"><i class="fa-solid fa-bars"></i></a> |
||
311 | </li> |
||
312 | </ul> |
||
313 | |||
314 | <!-- Right navbar links --> |
||
315 | <ul class="navbar-nav ml-auto"> |
||
316 | <span class="fa-stack infotip pointer hidden mr-2" title="<?php echo $lang->get('get_your_recovery_keys'); ?>" id="open_user_keys_management" style="vertical-align: top;"> |
||
317 | <i class="fa-solid fa-circle text-danger fa-stack-2x"></i> |
||
318 | <i class="fa-solid fa-bell fa-shake fa-stack-1x fa-inverse"></i> |
||
319 | </span> |
||
320 | <!-- Messages Dropdown Menu --> |
||
321 | <li class="nav-item dropdown"> |
||
322 | <div class="dropdown show"> |
||
323 | <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown"> |
||
324 | <?php |
||
325 | echo $session_name . ' ' . $session_lastname; ?> |
||
326 | </a> |
||
327 | |||
328 | <div class="dropdown-menu dropdown-menu-right"> |
||
329 | <a class="dropdown-item user-menu" href="#" data-name="increase_session"> |
||
330 | <i class="far fa-clock fa-fw mr-2"></i><?php echo $lang->get('index_add_one_hour'); ?></a> |
||
331 | <div class="dropdown-divider"></div> |
||
332 | <a class="dropdown-item user-menu" href="#" data-name="profile"> |
||
333 | <i class="fa-solid fa-user-circle fa-fw mr-2"></i><?php echo $lang->get('my_profile'); ?> |
||
334 | </a> |
||
335 | <?php |
||
336 | if (empty($session_auth_type) === false && $session_auth_type !== 'ldap' && $session_auth_type !== 'oauth2') { |
||
337 | ?> |
||
338 | <a class="dropdown-item user-menu" href="#" data-name="password-change"> |
||
339 | <i class="fa-solid fa-lock fa-fw mr-2"></i><?php echo $lang->get('index_change_pw'); ?> |
||
340 | </a> |
||
341 | <?php |
||
342 | } elseif ($session_auth_type === 'ldap') { |
||
343 | ?> |
||
344 | <a class="dropdown-item user-menu" href="#" data-name="sync-new-ldap-password"> |
||
345 | <i class="fa-solid fa-key fa-fw mr-2"></i><?php echo $lang->get('sync_new_ldap_password'); ?> |
||
346 | </a> |
||
347 | <?php |
||
348 | } ?> |
||
349 | <a class="dropdown-item user-menu<?php echo (int) $session_user_admin === 1 ? ' hidden' : '';?>" href="#" data-name="generate-new_keys"> |
||
350 | <i class="fa-solid fa-spray-can-sparkles fa-fw mr-2"></i><?php echo $lang->get('generate_new_keys'); ?> |
||
351 | </a> |
||
352 | |||
353 | <!-- |
||
354 | <div class="dropdown-divider"></div> |
||
355 | <a class="dropdown-item user-menu" href="#" data-name="generate-an-otp"> |
||
356 | <i class="fa-solid fa-qrcode fa-fw mr-2"></i><?php echo $lang->get('generate_an_otp'); ?> |
||
357 | </a> |
||
358 | --> |
||
359 | |||
360 | <div class="dropdown-divider"></div> |
||
361 | <a class="dropdown-item user-menu" href="#" data-name="logout"> |
||
362 | <i class="fa-solid fa-sign-out-alt fa-fw mr-2"></i><?php echo $lang->get('disconnect'); ?> |
||
363 | </a> |
||
364 | </div> |
||
365 | </div> |
||
366 | </li> |
||
367 | <li> |
||
368 | <span class="align-middle infotip ml-2 text-info" title="<?php echo $lang->get('index_expiration_in'); ?>" id="countdown"></span> |
||
369 | </li> |
||
370 | <li class="nav-item"> |
||
371 | <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" id="controlsidebar"><i class="fa-solid fa-th-large"></i></a> |
||
372 | </li> |
||
373 | <li id="switch-theme" class="nav-item pointer"> |
||
374 | <i class="fa-solid fa-circle-half-stroke m-2 m-2"></i> |
||
375 | </li> |
||
376 | </ul> |
||
377 | </nav> |
||
378 | <!-- /.navbar --> |
||
379 | |||
380 | <!-- Main Sidebar Container --> |
||
381 | <aside class="main-sidebar sidebar-dark-primary elevation-4"> |
||
382 | <!-- Brand Logo --> |
||
383 | <a href="<?php echo $cpassman_url . '/index.php?page=' . ((int) $session_user_admin === 1 ? 'admin' : 'items'); ?>" class="brand-link"> |
||
384 | <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image"> |
||
385 | <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span> |
||
386 | </a> |
||
387 | |||
388 | <!-- Sidebar --> |
||
389 | <div class="sidebar"> |
||
390 | <!-- Sidebar Menu --> |
||
391 | <nav class="mt-2" style="margin-bottom:40px;"> |
||
392 | <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> |
||
393 | <?php |
||
394 | if ($session_user_admin === 0) { |
||
395 | // ITEMS & SEARCH |
||
396 | echo ' |
||
397 | <li class="nav-item"> |
||
398 | <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '"> |
||
399 | <i class="nav-icon fa-solid fa-key"></i> |
||
400 | <p> |
||
401 | ' . $lang->get('pw') . ' |
||
402 | </p> |
||
403 | </a> |
||
404 | </li>'; |
||
405 | } |
||
406 | |||
407 | // IMPORT menu |
||
408 | if (isset($SETTINGS['allow_import']) === true && (int) $SETTINGS['allow_import'] === 1&& $session_user_admin === 0) { |
||
409 | echo ' |
||
410 | <li class="nav-item"> |
||
411 | <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '"> |
||
412 | <i class="nav-icon fa-solid fa-file-import"></i> |
||
413 | <p> |
||
414 | ' . $lang->get('import') . ' |
||
415 | </p> |
||
416 | </a> |
||
417 | </li>'; |
||
418 | } |
||
419 | // EXPORT menu |
||
420 | if ( |
||
421 | isset($SETTINGS['allow_print']) === true && (int) $SETTINGS['allow_print'] === 1 |
||
422 | && isset($SETTINGS['roles_allowed_to_print_select']) === true |
||
423 | && empty($SETTINGS['roles_allowed_to_print_select']) === false |
||
424 | && count(array_intersect( |
||
425 | explode(';', $session->get('user-roles')), |
||
426 | explode(',', str_replace(['"', '[', ']'], '', $SETTINGS['roles_allowed_to_print_select'])) |
||
427 | )) > 0 |
||
428 | && (int) $session_user_admin === 0 |
||
429 | ) { |
||
430 | echo ' |
||
431 | <li class="nav-item"> |
||
432 | <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '"> |
||
433 | <i class="nav-icon fa-solid fa-file-export"></i> |
||
434 | <p> |
||
435 | ' . $lang->get('export') . ' |
||
436 | </p> |
||
437 | </a> |
||
438 | </li>'; |
||
439 | } |
||
440 | |||
441 | /* |
||
442 | // OFFLINE MODE menu |
||
443 | if (isset($SETTINGS['settings_offline_mode']) === true && (int) $SETTINGS['settings_offline_mode'] === 1) { |
||
444 | echo ' |
||
445 | <li class="nav-item"> |
||
446 | <a href="#" data-name="offline" class="nav-link', $get['page'] === 'offline' ? ' active' : '' ,'"> |
||
447 | <i class="nav-icon fa-solid fa-plug"></i> |
||
448 | <p> |
||
449 | '.$lang->get('offline').' |
||
450 | </p> |
||
451 | </a> |
||
452 | </li>'; |
||
453 | } |
||
454 | */ |
||
455 | |||
456 | if ($session_user_admin === 0) { |
||
457 | echo ' |
||
458 | <li class="nav-item"> |
||
459 | <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '"> |
||
460 | <i class="nav-icon fa-solid fa-search"></i> |
||
461 | <p> |
||
462 | ' . $lang->get('find') . ' |
||
463 | </p> |
||
464 | </a> |
||
465 | </li>'; |
||
466 | } |
||
467 | |||
468 | // Favourites menu |
||
469 | if ( |
||
470 | isset($SETTINGS['enable_favourites']) === true && (int) $SETTINGS['enable_favourites'] === 1 |
||
471 | && (int) $session_user_admin === 0 |
||
472 | ) { |
||
473 | echo ' |
||
474 | <li class="nav-item"> |
||
475 | <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'favourites' ? ' active' : '', '"> |
||
476 | <i class="nav-icon fa-solid fa-star"></i> |
||
477 | <p> |
||
478 | ' . $lang->get('favorites') . ' |
||
479 | </p> |
||
480 | </a> |
||
481 | </li>'; |
||
482 | } |
||
483 | /* |
||
484 | // KB menu |
||
485 | if (isset($SETTINGS['enable_kb']) === true && $SETTINGS['enable_kb'] === '1' |
||
486 | ) { |
||
487 | echo ' |
||
488 | <li class="nav-item"> |
||
489 | <a href="#" data-name="kb" class="nav-link', $get['page'] === 'kb' ? ' active' : '' ,'"> |
||
490 | <i class="nav-icon fa-solid fa-map-signs"></i> |
||
491 | <p> |
||
492 | '.$lang->get('kb_menu').' |
||
493 | </p> |
||
494 | </a> |
||
495 | </li>'; |
||
496 | } |
||
497 | */ |
||
498 | // SUGGESTION menu |
||
499 | if ( |
||
500 | isset($SETTINGS['enable_suggestion']) && (int) $SETTINGS['enable_suggestion'] === 1 |
||
501 | && $session_user_manager === 1 |
||
502 | ) { |
||
503 | echo ' |
||
504 | <li class="nav-item"> |
||
505 | <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '"> |
||
506 | <i class="nav-icon fa-solid fa-lightbulb"></i> |
||
507 | <p> |
||
508 | ' . $lang->get('suggestion_menu') . ' |
||
509 | </p> |
||
510 | </a> |
||
511 | </li>'; |
||
512 | } |
||
513 | |||
514 | // Admin menu |
||
515 | if ($session_user_admin === 1) { |
||
516 | echo ' |
||
517 | <li class="nav-item"> |
||
518 | <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '"> |
||
519 | <i class="nav-icon fa-solid fa-info"></i> |
||
520 | <p> |
||
521 | ' . $lang->get('admin_main') . ' |
||
522 | </p> |
||
523 | </a> |
||
524 | </li> |
||
525 | <li class="nav-item has-treeview', $menuAdmin === true ? ' menu-open' : '', '"> |
||
526 | <a href="#" class="nav-link"> |
||
527 | <i class="nav-icon fa-solid fa-wrench"></i> |
||
528 | <p> |
||
529 | ' . $lang->get('admin_settings') . ' |
||
530 | <i class="fa-solid fa-angle-left right"></i> |
||
531 | </p> |
||
532 | </a> |
||
533 | <ul class="nav-item nav-treeview"> |
||
534 | <li class="nav-item"> |
||
535 | <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '"> |
||
536 | <i class="fa-solid fa-check-double nav-icon"></i> |
||
537 | <p>' . $lang->get('options') . '</p> |
||
538 | </a> |
||
539 | </li> |
||
540 | <li class="nav-item"> |
||
541 | <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '"> |
||
542 | <i class="fa-solid fa-qrcode nav-icon"></i> |
||
543 | <p>' . $lang->get('mfa_short') . '</p> |
||
544 | </a> |
||
545 | </li> |
||
546 | <li class="nav-item"> |
||
547 | <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '"> |
||
548 | <i class="fa-solid fa-cubes nav-icon"></i> |
||
549 | <p>' . $lang->get('api') . '</p> |
||
550 | </a> |
||
551 | </li> |
||
552 | <li class="nav-item"> |
||
553 | <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '"> |
||
554 | <i class="fa-solid fa-database nav-icon"></i> |
||
555 | <p>' . $lang->get('backups') . '</p> |
||
556 | </a> |
||
557 | </li> |
||
558 | <li class="nav-item"> |
||
559 | <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '"> |
||
560 | <i class="fa-solid fa-envelope nav-icon"></i> |
||
561 | <p>' . $lang->get('emails') . '</p> |
||
562 | </a> |
||
563 | </li> |
||
564 | <li class="nav-item"> |
||
565 | <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '"> |
||
566 | <i class="fa-solid fa-keyboard nav-icon"></i> |
||
567 | <p>' . $lang->get('fields') . '</p> |
||
568 | </a> |
||
569 | </li> |
||
570 | <li class="nav-item"> |
||
571 | <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '"> |
||
572 | <i class="fa-solid fa-id-card nav-icon"></i> |
||
573 | <p>' . $lang->get('ldap') . '</p> |
||
574 | </a> |
||
575 | </li> |
||
576 | |||
577 | <li class="nav-item"> |
||
578 | <a href="#" data-name="oauth" class="nav-link', $get['page'] === 'oauth' ? ' active' : '', '"> |
||
579 | <i class="fa-solid fa-plug nav-icon"></i> |
||
580 | <p>' . $lang->get('oauth') . '</p> |
||
581 | </a> |
||
582 | </li> |
||
583 | |||
584 | <li class="nav-item"> |
||
585 | <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '"> |
||
586 | <i class="fa-solid fa-file-upload nav-icon"></i> |
||
587 | <p>' . $lang->get('uploads') . '</p> |
||
588 | </a> |
||
589 | </li> |
||
590 | <li class="nav-item"> |
||
591 | <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '"> |
||
592 | <i class="fa-solid fa-chart-bar nav-icon"></i> |
||
593 | <p>' . $lang->get('statistics') . '</p> |
||
594 | </a> |
||
595 | </li> |
||
596 | </ul> |
||
597 | </li>'; |
||
598 | |||
599 | if (isset($SETTINGS['enable_tasks_manager']) && (int) $SETTINGS['enable_tasks_manager'] === 1) { |
||
600 | echo ' |
||
601 | <li class="nav-item"> |
||
602 | <a href="#" data-name="tasks" class="nav-link', $get['page'] === 'tasks' ? ' active' : '', '"> |
||
603 | <i class="fa-solid fa-tasks nav-icon"></i> |
||
604 | <p>' . $lang->get('tasks') . '</p> |
||
605 | </a> |
||
606 | </li>'; |
||
607 | } |
||
608 | |||
609 | if (WIP === true) { |
||
610 | echo ' |
||
611 | <li class="nav-item"> |
||
612 | <a href="#" data-name="tools" class="nav-link', $get['page'] === 'tools' ? ' active' : '', '"> |
||
613 | <i class="nav-icon fa-solid fa-screwdriver-wrench"></i> |
||
614 | <p> |
||
615 | ' . $lang->get('tools') . ' |
||
616 | </p> |
||
617 | </a> |
||
618 | </li>'; |
||
619 | } |
||
620 | } |
||
621 | |||
622 | if ( |
||
623 | $session_user_admin === 1 |
||
624 | || $session_user_manager === 1 |
||
625 | || $session_user_human_resources === 1 |
||
626 | ) { |
||
627 | echo ' |
||
628 | <li class="nav-item"> |
||
629 | <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '"> |
||
630 | <i class="nav-icon fa-solid fa-folder-open"></i> |
||
631 | <p> |
||
632 | ' . $lang->get('folders') . ' |
||
633 | </p> |
||
634 | </a> |
||
635 | </li> |
||
636 | <li class="nav-item"> |
||
637 | <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '"> |
||
638 | <i class="nav-icon fa-solid fa-graduation-cap"></i> |
||
639 | <p> |
||
640 | ' . $lang->get('roles') . ' |
||
641 | </p> |
||
642 | </a> |
||
643 | </li> |
||
644 | <li class="nav-item"> |
||
645 | <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '"> |
||
646 | <i class="nav-icon fa-solid fa-users"></i> |
||
647 | <p> |
||
648 | ' . $lang->get('users') . ' |
||
649 | </p> |
||
650 | </a> |
||
651 | </li> |
||
652 | <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '"> |
||
653 | <a href="#" class="nav-link"> |
||
654 | <i class="nav-icon fa-solid fa-cubes"></i> |
||
655 | <p>' . $lang->get('admin_views') . '<i class="fa-solid fa-angle-left right"></i></p> |
||
656 | </a> |
||
657 | <ul class="nav nav-treeview"> |
||
658 | <li class="nav-item"> |
||
659 | <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '"> |
||
660 | <i class="far fa-calendar-alt nav-icon"></i> |
||
661 | <p>' . $lang->get('renewal') . '</p> |
||
662 | </a> |
||
663 | </li> |
||
664 | <li class="nav-item"> |
||
665 | <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '"> |
||
666 | <i class="fa-solid fa-trash-alt nav-icon"></i> |
||
667 | <p>' . $lang->get('deletion') . '</p> |
||
668 | </a> |
||
669 | </li> |
||
670 | <li class="nav-item"> |
||
671 | <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '"> |
||
672 | <i class="fa-solid fa-history nav-icon"></i> |
||
673 | <p>' . $lang->get('logs') . '</p> |
||
674 | </a> |
||
675 | </li> |
||
676 | <li class="nav-item"> |
||
677 | <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '"> |
||
678 | <i class="fa-solid fa-database nav-icon"></i> |
||
679 | <p>' . $lang->get('database') . '</p> |
||
680 | </a> |
||
681 | </li> |
||
682 | </ul> |
||
683 | </li>'; |
||
684 | } ?> |
||
685 | </ul> |
||
686 | </nav> |
||
687 | <!-- /.sidebar-menu --> |
||
688 | <div class="menu-footer"> |
||
689 | <div class="" id="sidebar-footer"> |
||
690 | <i class="fa-solid fa-clock-o mr-2 infotip text-info pointer" title="<?php echo $lang->get('server_time') . ' ' . |
||
0 ignored issues
–
show
|
|||
691 | date($date_format, (int) $server['request_time']) . ' - ' . |
||
692 | date($time_format, (int) $server['request_time']); ?>"></i> |
||
693 | <i class="fa-solid fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . $lang->get('users_online'); ?>"></i> |
||
694 | <a href="<?php echo DOCUMENTATION_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-book mr-2 infotip" title="<?php echo $lang->get('documentation_canal'); ?>"></i></a> |
||
695 | <a href="<?php echo HELP_URL; ?>" target="_blank" class="text-info"><i class="fa-solid fa-life-ring mr-2 infotip" title="<?php echo $lang->get('admin_help'); ?>"></i></a> |
||
696 | <?php if ($session_user_admin === 1) : ?><i class="fa-solid fa-bug infotip pointer text-info" title="<?php echo $lang->get('bugs_page'); ?>" onclick="generateBugReport()"></i><?php endif; ?> |
||
697 | </div> |
||
698 | <?php |
||
699 | ?> |
||
700 | </div> |
||
701 | </div> |
||
702 | <!-- /.sidebar --> |
||
703 | </aside> |
||
704 | |||
705 | <!-- Content Wrapper. Contains page content --> |
||
706 | <div class="content-wrapper"> |
||
707 | |||
708 | <!-- DEFECT REPORT --> |
||
709 | <div class="card card-danger m-2 hidden" id="dialog-bug-report"> |
||
710 | <div class="card-header"> |
||
711 | <h3 class="card-title"> |
||
712 | <i class="fa-solid fa-bug mr-2"></i> |
||
713 | <?php echo $lang->get('defect_report'); ?> |
||
714 | </h3> |
||
715 | </div> |
||
716 | <div class="card-body"> |
||
717 | <div class="row"> |
||
718 | <div class="col-sm-12 col-md-12"> |
||
719 | <div class="mb-2 alert alert-info"> |
||
720 | <i class="icon fa-solid fa-info mr-2"></i> |
||
721 | <?php echo $lang->get('bug_report_to_github'); ?> |
||
722 | </div> |
||
723 | <textarea class="form-control" style="min-height:300px;" id="dialog-bug-report-text" placeholder="<?php echo $lang->get('please_wait_while_loading'); ?>"></textarea> |
||
724 | </div> |
||
725 | </div> |
||
726 | </div> |
||
727 | <div class="card-footer"> |
||
728 | <button class="btn btn-primary mr-2 clipboard-copy" data-clipboard-text="dialog-bug-report-text" id="dialog-bug-report-select-button"><?php echo $lang->get('copy_to_clipboard'); ?></button> |
||
729 | <button class="btn btn-primary" id="dialog-bug-report-github-button"><?php echo $lang->get('open_bug_report_in_github'); ?></button> |
||
730 | <button class="btn btn-default float-right close-element"><?php echo $lang->get('close'); ?></button> |
||
731 | </div> |
||
732 | </div> |
||
733 | <!-- /.DEFECT REPORT --> |
||
734 | |||
735 | |||
736 | <!-- USER CHANGE AUTH PASSWORD --> |
||
737 | <div class="card card-warning m-3 hidden" id="dialog-user-change-password"> |
||
738 | <div class="card-header"> |
||
739 | <h3 class="card-title"> |
||
740 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
741 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
742 | </h3> |
||
743 | </div> |
||
744 | <div class="card-body"> |
||
745 | <div class="row"> |
||
746 | <div class="col-sm-12 col-md-12"> |
||
747 | <div class="mb-5 alert alert-info hidden" id="dialog-user-change-password-info"> |
||
748 | </div> |
||
749 | <div class="input-group mb-3"> |
||
750 | <div class="input-group-prepend"> |
||
751 | <span class="input-group-text"><?php echo $lang->get('provide_your_current_password'); ?></span> |
||
752 | </div> |
||
753 | <input type="password" class="form-control" id="profile-current-password"> |
||
754 | </div> |
||
755 | <div class="input-group mb-3"> |
||
756 | <div class="input-group-prepend"> |
||
757 | <span class="input-group-text"><?php echo $lang->get('index_new_pw'); ?></span> |
||
758 | </div> |
||
759 | <input type="password" class="form-control" id="profile-password"> |
||
760 | <div class="input-group-append" style="margin: 0px;"> |
||
761 | <span class="input-group-text" id="profile-password-strength"></span> |
||
762 | <input type="hidden" id="profile-password-complex" /> |
||
763 | </div> |
||
764 | </div> |
||
765 | <div class="input-group mb-3"> |
||
766 | <div class="input-group-prepend"> |
||
767 | <span class="input-group-text"><?php echo $lang->get('index_change_pw_confirmation'); ?></span> |
||
768 | </div> |
||
769 | <input type="password" class="form-control" id="profile-password-confirm"> |
||
770 | </div> |
||
771 | <div class="form-control mt-3 font-weight-light grey" id="dialog-user-change-password-progress"> |
||
772 | <?php echo $lang->get('provide_current_psk_and_click_launch'); ?> |
||
773 | </div> |
||
774 | </div> |
||
775 | </div> |
||
776 | </div> |
||
777 | <div class="card-footer"> |
||
778 | <button class="btn btn-primary" id="dialog-user-change-password-do"><?php echo $lang->get('launch'); ?></button> |
||
779 | <button class="btn btn-default float-right" id="dialog-user-change-password-close"><?php echo $lang->get('close'); ?></button> |
||
780 | </div> |
||
781 | </div> |
||
782 | <!-- /.USER CHANGE AUTH PASSWORD --> |
||
783 | |||
784 | |||
785 | <!-- LDAP USER HAS CHANGED AUTH PASSWORD --> |
||
786 | <div class="card card-warning m-3 hidden" id="dialog-ldap-user-change-password"> |
||
787 | <div class="card-header"> |
||
788 | <h3 class="card-title"> |
||
789 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
790 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
791 | </h3> |
||
792 | </div> |
||
793 | <div class="card-body"> |
||
794 | <div class="row"> |
||
795 | <div class="col-sm-12 col-md-12"> |
||
796 | <div class="mb-5 alert alert-info hidden" id="dialog-ldap-user-change-password-info"> |
||
797 | </div> |
||
798 | <div class="input-group mb-3"> |
||
799 | <div class="input-group-prepend"> |
||
800 | <span class="input-group-text"><?php echo $lang->get('provide_your_previous_password'); ?></span> |
||
801 | </div> |
||
802 | <input type="password" class="form-control" id="dialog-ldap-user-change-password-old"> |
||
803 | </div> |
||
804 | <div class="input-group mb-3" id="new-password-field"> |
||
805 | <div class="input-group-prepend"> |
||
806 | <span class="input-group-text"><?php echo $lang->get('provide_your_current_password'); ?></span> |
||
807 | </div> |
||
808 | <input type="password" class="form-control" id="dialog-ldap-user-change-password-current"> |
||
809 | </div> |
||
810 | <div class="form-control mt-3 font-weight-light grey" id="dialog-ldap-user-change-password-progress"> |
||
811 | <?php echo $lang->get('provide_current_psk_and_click_launch'); ?> |
||
812 | </div> |
||
813 | </div> |
||
814 | </div> |
||
815 | </div> |
||
816 | <div class="card-footer"> |
||
817 | <button class="btn btn-primary" id="dialog-ldap-user-change-password-do"><?php echo $lang->get('launch'); ?></button> |
||
818 | <button class="btn btn-default float-right" id="dialog-ldap-user-change-password-close"><?php echo $lang->get('close'); ?></button> |
||
819 | </div> |
||
820 | </div> |
||
821 | <!-- /.LDAP USER HAS CHANGED AUTH PASSWORD --> |
||
822 | |||
823 | |||
824 | <!-- ADMIN ASKS FOR USER PASSWORD CHANGE --> |
||
825 | <div class="card card-warning m-3 hidden" id="dialog-admin-change-user-password"> |
||
826 | <div class="card-header"> |
||
827 | <h3 class="card-title"> |
||
828 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
829 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
830 | </h3> |
||
831 | </div> |
||
832 | <div class="card-body"> |
||
833 | <div class="row"> |
||
834 | <div class="col-sm-12 col-md-12"> |
||
835 | <div class="mb-2 alert alert-info" id="dialog-admin-change-user-password-info"> |
||
836 | </div> |
||
837 | <div class="form-control mt-3 font-weight-light grey" id="dialog-admin-change-user-password-progress"> |
||
838 | <?php echo $lang->get('provide_current_psk_and_click_launch'); ?> |
||
839 | </div> |
||
840 | <div class="mt-3"> |
||
841 | <label> |
||
842 | <span class="mr-2 pointer fw-normal"><i class="fa-solid fa-eye mr-2 text-orange"></i><?php echo $lang->get('show_user_password');?></span> |
||
843 | <input type="checkbox" id="dialog-admin-change-user-password-do-show-password" class="pointer"> |
||
844 | </label> |
||
845 | </div> |
||
846 | </div> |
||
847 | </div> |
||
848 | <input type="hidden" id="admin_change_user_password_target_user" value=""> |
||
849 | <input type="hidden" id="admin_change_user_encryption_code_target_user" value=""> |
||
850 | </div> |
||
851 | <div class="card-footer"> |
||
852 | <button class="btn btn-primary mr-3" id="dialog-admin-change-user-password-do"><?php echo $lang->get('launch'); ?></button> |
||
853 | <button class="btn btn-default float-right" id="dialog-admin-change-user-password-close"><?php echo $lang->get('close'); ?></button> |
||
854 | </div> |
||
855 | </div> |
||
856 | <!-- /.ADMIN ASKS FOR USER PASSWORD CHANGE --> |
||
857 | |||
858 | |||
859 | <!-- USER PROVIDES TEMPORARY CODE --> |
||
860 | <div class="card card-warning m-3 hidden" id="dialog-user-temporary-code"> |
||
861 | <div class="card-header"> |
||
862 | <h3 class="card-title"> |
||
863 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
864 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
865 | </h3> |
||
866 | </div> |
||
867 | <div class="card-body"> |
||
868 | <div class="row"> |
||
869 | <div class="col-sm-12 col-md-12"> |
||
870 | <div class="mb-5 alert alert-info" id="dialog-user-temporary-code-info"> |
||
871 | </div> |
||
872 | <div class="input-group mb-3"> |
||
873 | <div class="input-group-prepend"> |
||
874 | <span class="input-group-text"><?php echo $lang->get('provide_your_current_password'); ?></span> |
||
875 | </div> |
||
876 | <input type="password" class="form-control" id="dialog-user-temporary-code-current-password"> |
||
877 | </div> |
||
878 | <div class="input-group mb-3"> |
||
879 | <div class="input-group-prepend"> |
||
880 | <span class="input-group-text"><?php echo $lang->get('temporary_encryption_code'); ?></span> |
||
881 | </div> |
||
882 | <input type="password" class="form-control" id="dialog-user-temporary-code-value"> |
||
883 | </div> |
||
884 | <div class="form-control mt-3 font-weight-light grey" id="dialog-user-temporary-code-progress"> |
||
885 | <?php echo $lang->get('provide_current_psk_and_click_launch'); ?> |
||
886 | </div> |
||
887 | </div> |
||
888 | </div> |
||
889 | </div> |
||
890 | <div class="card-footer"> |
||
891 | <button class="btn btn-primary" id="dialog-user-temporary-code-do"><?php echo $lang->get('launch'); ?></button> |
||
892 | <button class="btn btn-default float-right" id="dialog-user-temporary-code-close"><?php echo $lang->get('close'); ?></button> |
||
893 | </div> |
||
894 | </div> |
||
895 | <!-- /.USER PROVIDES TEMPORARY CODE --> |
||
896 | |||
897 | |||
898 | <!-- ENCRYPTION KEYS GENERATION --> |
||
899 | <div class="card card-warning m-3 mt-3 hidden" id="dialog-encryption-keys"> |
||
900 | <div class="card-header"> |
||
901 | <h3 class="card-title"> |
||
902 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
903 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
904 | </h3> |
||
905 | </div> |
||
906 | <div class="card-body"> |
||
907 | <div class="row"> |
||
908 | <div class="col-sm-12 col-md-12"> |
||
909 | <div class="mb-2 alert alert-info" id="warning-text-reencryption"> |
||
910 | <i class="icon fa-solid fa-info mr-2"></i> |
||
911 | <?php echo $lang->get('objects_encryption_explanation'); ?> |
||
912 | </div> |
||
913 | </div> |
||
914 | </div> |
||
915 | <input type="hidden" id="sharekeys_reencryption_target_user" value=""> |
||
916 | </div> |
||
917 | <div class="card-footer"> |
||
918 | <button class="btn btn-primary" id="button_do_sharekeys_reencryption"><?php echo $lang->get('launch'); ?></button> |
||
919 | <button class="btn btn-default float-right" id="button_close_sharekeys_reencryption"><?php echo $lang->get('close'); ?></button> |
||
920 | </div> |
||
921 | </div> |
||
922 | <!-- /.ENCRYPTION KEYS GENERATION --> |
||
923 | |||
924 | |||
925 | <!-- ENCRYPTION KEYS GENERATION FOR LDAP NEW USER --> |
||
926 | <div class="card card-warning m-3 mt-3 hidden" id="dialog-ldap-user-build-keys-database"> |
||
927 | <div class="card-header"> |
||
928 | <h3 class="card-title"> |
||
929 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
930 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
931 | </h3> |
||
932 | </div> |
||
933 | <div class="card-body"> |
||
934 | <div class="row"> |
||
935 | <div class="col-sm-12 col-md-12"> |
||
936 | <div class="mb-2 alert alert-info" id="warning-text-reencryption"> |
||
937 | <i class="icon fa-solid fa-info mr-2"></i> |
||
938 | <?php echo $lang->get('help_for_launching_items_encryption'); ?> |
||
939 | </div> |
||
940 | |||
941 | <div class="input-group mb-3"> |
||
942 | <div class="input-group-prepend"> |
||
943 | <span class="input-group-text"><?php echo $lang->get('temporary_encryption_code'); ?></span> |
||
944 | </div> |
||
945 | <input type="password" class="form-control" id="dialog-ldap-user-build-keys-database-code"> |
||
946 | </div> |
||
947 | |||
948 | <div class="form-control mt-3 font-weight-light grey" id="dialog-ldap-user-build-keys-database-progress"> |
||
949 | <?php echo $lang->get('provide_current_psk_and_click_launch'); ?> |
||
950 | </div> |
||
951 | </div> |
||
952 | </div> |
||
953 | <input type="hidden" id="sharekeys_reencryption_target_user" value=""> |
||
954 | </div> |
||
955 | <div class="card-footer"> |
||
956 | <button class="btn btn-primary" id="dialog-ldap-user-build-keys-database-do"><?php echo $lang->get('launch'); ?></button> |
||
957 | <button class="btn btn-default float-right" id="dialog-ldap-user-build-keys-database-close"><?php echo $lang->get('close'); ?></button> |
||
958 | </div> |
||
959 | </div> |
||
960 | <!-- /.ENCRYPTION KEYS GENERATION --> |
||
961 | |||
962 | <!-- ENCRYPTION PERSONAL ITEMS GENERATION --> |
||
963 | <div class="card card-warning m-3 hidden" id="dialog-encryption-personal-items-after-upgrade"> |
||
964 | <div class="card-header"> |
||
965 | <h3 class="card-title"> |
||
966 | <i class="fa-solid fa-bullhorn mr-2"></i> |
||
967 | <?php echo $lang->get('your_attention_is_required'); ?> |
||
968 | </h3> |
||
969 | </div> |
||
970 | <div class="card-body"> |
||
971 | <div class="row"> |
||
972 | <div class="col-sm-12 col-md-12"> |
||
973 | <div class="mb-2 alert alert-info" id="warning-text-changing-password"> |
||
974 | <i class="icon fa-solid fa-info mr-2"></i> |
||
975 | <?php echo $lang->get('objects_encryption_explanation'); ?> |
||
976 | </div> |
||
977 | <div class="input-group mb-3"> |
||
978 | <div class="input-group-prepend"> |
||
979 | <span class="input-group-text"><?php echo $lang->get('personal_salt_key'); ?></span> |
||
980 | </div> |
||
981 | <input type="password" class="form-control" id="user-current-defuse-psk"> |
||
982 | </div> |
||
983 | <div class="form-control mt-3 font-weight-light grey" id="user-current-defuse-psk-progress"> |
||
984 | <?php echo $lang->get('provide_current_psk_and_click_launch'); ?> |
||
985 | </div> |
||
986 | </div> |
||
987 | </div> |
||
988 | </div> |
||
989 | <div class="card-footer"> |
||
990 | <button class="btn btn-primary" id="button_do_personal_items_reencryption"><?php echo $lang->get('launch'); ?></button> |
||
991 | <button class="btn btn-default float-right" id="button_close_personal_items_reencryption"><?php echo $lang->get('close'); ?></button> |
||
992 | </div> |
||
993 | </div> |
||
994 | <!-- /.ENCRYPTION PERSONAL ITEMS GENERATION --> |
||
995 | |||
996 | |||
997 | <?php |
||
998 | if ($get['page'] === 'items') { |
||
999 | // SHow page with Items |
||
1000 | if ((int) $session_user_admin !== 1) { |
||
1001 | include $SETTINGS['cpassman_dir'] . '/pages/items.php'; |
||
1002 | } elseif ((int) $session_user_admin === 1) { |
||
1003 | include $SETTINGS['cpassman_dir'] . '/pages/admin.php'; |
||
1004 | } else { |
||
1005 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
||
1006 | //not allowed page |
||
1007 | include $SETTINGS['cpassman_dir'] . '/error.php'; |
||
1008 | } |
||
1009 | } elseif (in_array($get['page'], array_keys($mngPages)) === true) { |
||
1010 | // Define if user is allowed to see management pages |
||
1011 | if ($session_user_admin === 1) { |
||
1012 | // deepcode ignore FileInclusion: $get['page'] is secured through usage of array_keys test bellow |
||
1013 | include $SETTINGS['cpassman_dir'] . '/pages/' . basename($mngPages[$get['page']]); |
||
1014 | } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) { |
||
1015 | if ($get['page'] === 'manage_main' || $get['page'] === 'manage_settings' |
||
1016 | ) { |
||
1017 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
||
1018 | //not allowed page |
||
1019 | include $SETTINGS['cpassman_dir'] . '/error.php'; |
||
1020 | } |
||
1021 | } else { |
||
1022 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
||
1023 | //not allowed page |
||
1024 | include $SETTINGS['cpassman_dir'] . '/error.php'; |
||
1025 | } |
||
1026 | } elseif (empty($get['page']) === false && file_exists($SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php') === true) { |
||
1027 | // deepcode ignore FileInclusion: $get['page'] is tested against file_exists just below |
||
1028 | include $SETTINGS['cpassman_dir'] . '/pages/' . basename($get['page'] . '.php'); |
||
1029 | } else { |
||
1030 | $session->set('system-array_roles', ERR_NOT_EXIST); |
||
1031 | //page doesn't exist |
||
1032 | include $SETTINGS['cpassman_dir'].'/error.php'; |
||
1033 | } |
||
1034 | |||
1035 | // Case where login attempts have been identified |
||
1036 | if ((int) $session->get('user-unsuccessfull_login_attempts_nb') !== 0 |
||
1037 | && (bool) $session->get('user-unsuccessfull_login_attempts_shown') === false |
||
1038 | ) { |
||
1039 | ?> |
||
1040 | <input type="hidden" id="user-login-attempts" value="1"> |
||
1041 | <?php |
||
1042 | } ?> |
||
1043 | |||
1044 | </div> |
||
1045 | <!-- /.content-wrapper --> |
||
1046 | |||
1047 | <!-- Control Sidebar --> |
||
1048 | <aside class="control-sidebar control-sidebar-dark"> |
||
1049 | <!-- Control sidebar content goes here --> |
||
1050 | <div class="p-3"> |
||
1051 | <h5><?php echo $lang->get('last_items_title'); ?></h5> |
||
1052 | <div> |
||
1053 | <ul class="list-unstyled" id="index-last-pwds"> |
||
1054 | </ul> |
||
1055 | </div> |
||
1056 | </div> |
||
1057 | </aside> |
||
1058 | <!-- /.control-sidebar --> |
||
1059 | |||
1060 | <!-- Main Footer --> |
||
1061 | <footer class="main-footer"> |
||
1062 | <!-- To the right --> |
||
1063 | <div class="float-right d-none d-sm-inline"> |
||
1064 | <?php echo $lang->get('version_alone'); ?> <?php echo TP_VERSION; ?> |
||
1065 | </div> |
||
1066 | <!-- Default to the left --> |
||
1067 | <strong>Copyright © <?php echo TP_COPYRIGHT; ?> <a href="<?php echo TEAMPASS_URL; ?>"><?php echo TP_TOOL_NAME; ?></a>.</strong> All rights reserved. |
||
1068 | </footer> |
||
1069 | </div> |
||
1070 | <!-- ./wrapper --> |
||
1071 | |||
1072 | <?php |
||
1073 | /* MAIN PAGE */ |
||
1074 | |||
1075 | echo ' |
||
1076 | <input type="hidden" id="temps_restant" value="', $session->get('user-session_duration') ?? '', '" />'; |
||
1077 | // display an item in the context of OTV link |
||
1078 | } elseif ((null === $session->get('user-validite_pw')|| empty($session->get('user-validite_pw')) === true || empty($session->get('user-id')) === true) |
||
1079 | && empty($get['otv']) === false |
||
1080 | ) { |
||
1081 | // case where one-shot viewer |
||
1082 | if (empty($request->query->get('code')) === false && empty($request->query->get('stamp')) === false |
||
1083 | ) { |
||
1084 | include './includes/core/otv.php'; |
||
1085 | } else { |
||
1086 | $session->set('system-error_code', ERR_VALID_SESSION); |
||
1087 | $session->set( |
||
1088 | 'user-initial_url', |
||
1089 | filter_var( |
||
1090 | substr( |
||
1091 | $server['request_uri'], |
||
1092 | strpos($server['request_uri'], 'index.php?') |
||
1093 | ), |
||
1094 | FILTER_SANITIZE_URL |
||
1095 | ) |
||
1096 | ); |
||
1097 | include $SETTINGS['cpassman_dir'] . '/error.php'; |
||
1098 | } |
||
1099 | } elseif (//(empty($session->get('user-id')) === false && $session->get('user-id') !== null) || |
||
1100 | empty($session->get('user-id')) === true |
||
1101 | || null === $session->get('user-validite_pw') |
||
1102 | || $session->get('user-validite_pw') === 0 |
||
1103 | ) { |
||
1104 | // case where user not logged and can't access a direct link |
||
1105 | if (empty($get['page']) === false) { |
||
1106 | $session->set( |
||
1107 | 'user-initial_url', |
||
1108 | filter_var( |
||
1109 | substr($server['request_uri'], strpos($server['request_uri'], 'index.php?')), |
||
1110 | FILTER_SANITIZE_URL |
||
1111 | ) |
||
1112 | ); |
||
1113 | // REDIRECTION PAGE ERREUR |
||
1114 | echo ' |
||
1115 | <script language="javascript" type="text/javascript"> |
||
1116 | /* |
||
1117 | sessionStorage.clear(); |
||
1118 | store.set( |
||
1119 | "teampassSettings", {}, |
||
1120 | function(teampassSettings) {} |
||
1121 | ); |
||
1122 | */ |
||
1123 | window.location.href = "./index.php"; |
||
1124 | </script>'; |
||
1125 | exit; |
||
1126 | } |
||
1127 | |||
1128 | // LOGIN form |
||
1129 | include $SETTINGS['cpassman_dir'] . '/includes/core/login.php'; |
||
1130 | |||
1131 | } else { |
||
1132 | // Clear session |
||
1133 | $session->invalidate(); |
||
1134 | } |
||
1135 | ?> |
||
1136 | |||
1137 | <!-- Modal --> |
||
1138 | <div class="modal fade" id="warningModal" tabindex="-1" role="dialog" aria-labelledby="Caution" aria-hidden="true"> |
||
1139 | <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> |
||
1140 | <div class="modal-content"> |
||
1141 | <div class="modal-header"> |
||
1142 | <h5 class="modal-title" id="warningModalTitle"></h5> |
||
1143 | <button type="button" class="close" data-dismiss="modal" aria-label="Close" id="warningModalCrossClose"> |
||
1144 | <span aria-hidden="true">×</span> |
||
1145 | </button> |
||
1146 | </div> |
||
1147 | <div class="modal-body" id="warningModalBody"> |
||
1148 | </div> |
||
1149 | <div class="modal-footer"> |
||
1150 | <button type="button" class="btn btn-secondary" data-dismiss="modal" id="warningModalButtonClose"></button> |
||
1151 | <button type="button" class="btn btn-primary" id="warningModalButtonAction"></button> |
||
1152 | </div> |
||
1153 | </div> |
||
1154 | </div> |
||
1155 | </div> |
||
1156 | |||
1157 | |||
1158 | |||
1159 | <!-- REQUIRED SCRIPTS --> |
||
1160 | |||
1161 | <!-- Font Awesome Icons --> |
||
1162 | <link href="plugins/fontawesome-free-6/css/fontawesome.min.css?v=<?php echo TP_VERSION; ?>" rel="stylesheet"> |
||
1163 | <link href="plugins/fontawesome-free-6/css/solid.min.css?v=<?php echo TP_VERSION; ?>" rel="stylesheet"> |
||
1164 | <link href="plugins/fontawesome-free-6/css/regular.min.css?v=<?php echo TP_VERSION; ?>" rel="stylesheet"> |
||
1165 | <link href="plugins/fontawesome-free-6/css/brands.min.css?v=<?php echo TP_VERSION; ?>" rel="stylesheet"> |
||
1166 | <link href="plugins/fontawesome-free-6/css/v5-font-face.min.css?v=<?php echo TP_VERSION; ?>" rel="stylesheet" /> |
||
1167 | <!-- jQuery --> |
||
1168 | <script src="plugins/jquery/jquery.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1169 | <script src="plugins/jquery/jquery.cookie.js?v=<?php echo TP_VERSION; ?>" type="text/javascript"></script> |
||
1170 | <!-- jQuery UI --> |
||
1171 | <script src="plugins/jqueryUI/jquery-ui.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1172 | <link rel="stylesheet" href="plugins/jqueryUI/jquery-ui.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1173 | <!-- Popper --> |
||
1174 | <script src="plugins/popper/umd/popper.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1175 | <!-- Bootstrap --> |
||
1176 | <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1177 | <!-- AdminLTE --> |
||
1178 | <script src="plugins/adminlte/js/adminlte.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1179 | <!-- Altertify --> |
||
1180 | <!--<script type="text/javascript" src="plugins/alertifyjs/alertify.min.js"></script>--> |
||
1181 | <!-- Toastr --> |
||
1182 | <script type="text/javascript" src="plugins/toastr/toastr.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1183 | <!-- STORE.JS --> |
||
1184 | <script type="text/javascript" src="plugins/store.js/dist/store.everything.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1185 | <!-- cryptojs-aesphp --> |
||
1186 | <script type="text/javascript" src="includes/libraries/cryptojs/crypto-js.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1187 | <script type="text/javascript" src="includes/libraries/cryptojs/encryption.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1188 | <!-- pace --> |
||
1189 | <script type="text/javascript" data-pace-options='{ "ajax": true, "eventLag": false }' src="plugins/pace-progress/pace.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1190 | <!-- clipboardjs --> |
||
1191 | <script type="text/javascript" src="plugins/clipboard/clipboard.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1192 | <!-- select2 --> |
||
1193 | <script type="text/javascript" src="plugins/select2/js/select2.full.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1194 | <!-- simplePassMeter --> |
||
1195 | <link rel="stylesheet" href="plugins/simplePassMeter/simplePassMeter.css?v=<?php echo TP_VERSION; ?>" type="text/css" /> |
||
1196 | <script type="text/javascript" src="plugins/simplePassMeter/simplePassMeter.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1197 | <!-- platform --> |
||
1198 | <script type="text/javascript" src="plugins/platform/platform.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1199 | <!-- radiobuttons --> |
||
1200 | <link rel="stylesheet" href="plugins/radioforbuttons/bootstrap-buttons.min.css?v=<?php echo TP_VERSION; ?>" type="text/css" /> |
||
1201 | <script type="text/javascript" src="plugins/radioforbuttons/jquery.radiosforbuttons.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1202 | <!-- ICHECK --> |
||
1203 | <!--<link rel="stylesheet" href="./plugins/icheck-material/icheck-material.min.css">--> |
||
1204 | <link rel="stylesheet" href="./plugins/icheck/skins/all.css?v=<?php echo TP_VERSION; ?>"> |
||
1205 | <script type="text/javascript" src="./plugins/icheck/icheck.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1206 | <!-- bootstrap-add-clear --> |
||
1207 | <script type="text/javascript" src="plugins/bootstrap-add-clear/bootstrap-add-clear.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1208 | <!-- DOMPurify --> |
||
1209 | <script type="text/javascript" src="plugins/DOMPurify/purify.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1210 | |||
1211 | <?php |
||
1212 | $get['page'] = $request->query->filter('page', null, FILTER_SANITIZE_SPECIAL_CHARS); |
||
1213 | if ($menuAdmin === true) { |
||
1214 | ?> |
||
1215 | <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION; ?>" /> |
||
1216 | <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION; ?>" /> |
||
1217 | <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION; ?>" type="text/javascript"></script> |
||
1218 | <!-- InputMask --> |
||
1219 | <script src="./plugins/inputmask/jquery.inputmask.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1220 | <!-- Sortable --> |
||
1221 | <!--<script src="./plugins/sortable/jquery.sortable.js"></script>--> |
||
1222 | <!-- PLUPLOAD --> |
||
1223 | <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1224 | <!-- DataTables --> |
||
1225 | <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1226 | <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1227 | <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1228 | <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1229 | <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1230 | <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1231 | <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1232 | <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1233 | <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1234 | <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1235 | <?php |
||
1236 | } elseif (isset($get['page']) === true) { |
||
1237 | if (in_array($get['page'], ['items', 'import']) === true) { |
||
1238 | ?> |
||
1239 | <link rel="stylesheet" href="./plugins/jstree/themes/default/style.min.css?v=<?php echo TP_VERSION; ?>" /> |
||
1240 | <link rel="stylesheet" href="./plugins/jstree/themes/default-dark/style.min.css?v=<?php echo TP_VERSION; ?>" /> |
||
1241 | <script src="./plugins/jstree/jstree.min.js?v=<?php echo TP_VERSION; ?>" type="text/javascript"></script> |
||
1242 | <!-- countdownTimer --> |
||
1243 | <script src="./plugins/jquery.countdown360/jquery.countdown360.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1244 | <!-- SUMMERNOTE --> |
||
1245 | <link rel="stylesheet" href="./plugins/summernote/summernote-bs4.css?v=<?php echo TP_VERSION; ?>"> |
||
1246 | <script src="./plugins/summernote/summernote-bs4.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1247 | <!-- date-picker --> |
||
1248 | <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1249 | <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1250 | <!-- time-picker --> |
||
1251 | <link rel="stylesheet" href="./plugins/timepicker/bootstrap-timepicker.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1252 | <script src="./plugins/timepicker/bootstrap-timepicker.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1253 | <!-- PLUPLOAD --> |
||
1254 | <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1255 | <!-- VALIDATE --> |
||
1256 | <script type="text/javascript" src="plugins/jquery-validation/jquery.validate.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1257 | <!-- PWSTRENGHT --> |
||
1258 | <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1259 | <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1260 | <!-- TOGGLE --> |
||
1261 | <link rel="stylesheet" href="./plugins/toggles/css/toggles.css?v=<?php echo TP_VERSION; ?>" /> |
||
1262 | <link rel="stylesheet" href="./plugins/toggles/css/toggles-modern.css?v=<?php echo TP_VERSION; ?>" /> |
||
1263 | <script src="./plugins/toggles/toggles.min.js?v=<?php echo TP_VERSION; ?>" type="text/javascript"></script> |
||
1264 | <?php |
||
1265 | } elseif (in_array($get['page'], ['search', 'folders', 'users', 'roles', 'utilities.deletion', 'utilities.logs', 'utilities.database', 'utilities.renewal', 'tasks']) === true) { |
||
1266 | ?> |
||
1267 | <!-- DataTables --> |
||
1268 | <link rel="stylesheet" src="./plugins/datatables/css/jquery.dataTables.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1269 | <link rel="stylesheet" src="./plugins/datatables/css/dataTables.bootstrap4.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1270 | <script type="text/javascript" src="./plugins/datatables/js/jquery.dataTables.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1271 | <script type="text/javascript" src="./plugins/datatables/js/dataTables.bootstrap4.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1272 | <link rel="stylesheet" src="./plugins/datatables/extensions/Responsive-2.2.2/css/responsive.bootstrap4.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1273 | <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/dataTables.responsive.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1274 | <script type="text/javascript" src="./plugins/datatables/extensions/Responsive-2.2.2/js/responsive.bootstrap4.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1275 | <script type="text/javascript" src="./plugins/datatables/plugins/select.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1276 | <link rel="stylesheet" src="./plugins/datatables/extensions/Scroller-1.5.0/css/scroller.bootstrap4.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1277 | <script type="text/javascript" src="./plugins/datatables/extensions/Scroller-1.5.0/js/dataTables.scroller.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1278 | <!-- dater picker --> |
||
1279 | <link rel="stylesheet" href="./plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css?v=<?php echo TP_VERSION; ?>"> |
||
1280 | <script src="./plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1281 | <!-- daterange picker --> |
||
1282 | <link rel="stylesheet" href="./plugins/daterangepicker/daterangepicker.css?v=<?php echo TP_VERSION; ?>"> |
||
1283 | <script src="./plugins/moment/moment.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1284 | <script src="./plugins/daterangepicker/daterangepicker.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1285 | <!-- SlimScroll --> |
||
1286 | <script src="./plugins/slimScroll/jquery.slimscroll.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1287 | <!-- FastClick --> |
||
1288 | <script src="./plugins/fastclick/fastclick.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1289 | <?php |
||
1290 | } elseif ($get['page'] === 'profile') { |
||
1291 | ?> |
||
1292 | <!-- FILESAVER --> |
||
1293 | <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1294 | <!-- PLUPLOAD --> |
||
1295 | <script type="text/javascript" src="plugins/plupload/js/plupload.full.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1296 | <?php |
||
1297 | } elseif ($get['page'] === 'export') { |
||
1298 | ?> |
||
1299 | <!-- FILESAVER --> |
||
1300 | <script type="text/javascript" src="plugins/downloadjs/download.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1301 | <!-- PWSTRENGHT --> |
||
1302 | <script type="text/javascript" src="plugins/zxcvbn/zxcvbn.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1303 | <script type="text/javascript" src="plugins/jquery.pwstrength/pwstrength-bootstrap.min.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1304 | <?php |
||
1305 | } |
||
1306 | } |
||
1307 | ?> |
||
1308 | <!-- functions --> |
||
1309 | <script type="text/javascript" src="includes/js/functions.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1310 | <script type="text/javascript" src="includes/js/CreateRandomString.js?v=<?php echo TP_VERSION; ?>"></script> |
||
1311 | <input type="hidden" id="encryptClientServerStatus" value="<?php echo $SETTINGS['encryptClientServer'] ?? 1; ?>" /> |
||
1312 | |||
1313 | </body> |
||
1314 | |||
1315 | </html> |
||
1316 | |||
1317 | <script type="text/javascript"> |
||
1318 | //override defaults |
||
1319 | /*alertify.defaults.transition = "slide"; |
||
1320 | alertify.defaults.theme.ok = "btn btn-primary"; |
||
1321 | alertify.defaults.theme.cancel = "btn btn-danger"; |
||
1322 | alertify.defaults.theme.input = "form-control";*/ |
||
1323 | |||
1324 | toastr.options = { |
||
1325 | "closeButton": false, |
||
1326 | "debug": false, |
||
1327 | "newestOnTop": false, |
||
1328 | "progressBar": false, |
||
1329 | "positionClass": "toast-bottom-right", |
||
1330 | "preventDuplicates": true, |
||
1331 | "onClick": "close", |
||
1332 | "showDuration": "300", |
||
1333 | "hideDuration": "1000", |
||
1334 | "timeOut": "0", |
||
1335 | "extendedTimeOut": "0", |
||
1336 | "showEasing": "swing", |
||
1337 | "hideEasing": "linear", |
||
1338 | "showMethod": "fadeIn", |
||
1339 | "hideMethod": "fadeOut" |
||
1340 | } |
||
1341 | </script> |
||
1342 | |||
1343 | <script> |
||
1344 | $(document).ready(function() { |
||
1345 | // PWA with windowControlsOverlay |
||
1346 | if ('windowControlsOverlay' in navigator) { |
||
1347 | // Event listener for window-controls-overlay changes |
||
1348 | navigator.windowControlsOverlay.addEventListener('geometrychange', function(event) { |
||
1349 | // Wait few time for resize animations |
||
1350 | $(this).delay(250).queue(function() { |
||
1351 | // Move header content |
||
1352 | adjustForWindowControlsOverlay(event.titlebarAreaRect); |
||
1353 | $(this).dequeue(); |
||
1354 | }); |
||
1355 | }); |
||
1356 | |||
1357 | // Move header content |
||
1358 | adjustForWindowControlsOverlay(navigator.windowControlsOverlay.getTitlebarAreaRect()); |
||
1359 | } |
||
1360 | |||
1361 | function adjustForWindowControlsOverlay(rect) { |
||
1362 | // Display width - available space + 5px margin |
||
1363 | let margin = 5; |
||
1364 | let width = document.documentElement.clientWidth - rect.width + margin; |
||
1365 | |||
1366 | if (width - margin !== document.documentElement.clientWidth) { |
||
1367 | // Add right padding to main-header |
||
1368 | $('.main-header').css('padding-right', width + 'px'); |
||
1369 | |||
1370 | // Window drag area |
||
1371 | $('.main-header').css('-webkit-app-region', 'drag'); |
||
1372 | $('.main-header *').css('-webkit-app-region', 'no-drag'); |
||
1373 | } else { |
||
1374 | // Remove right padding to main-header |
||
1375 | $('.main-header').css('padding-right', '0px'); |
||
1376 | |||
1377 | // No window drag area when titlebar is present |
||
1378 | $('.main-header').css('-webkit-app-region', 'no-drag'); |
||
1379 | } |
||
1380 | } |
||
1381 | }); |
||
1382 | |||
1383 | // Handle external link open in current PWA |
||
1384 | if ("launchQueue" in window) { |
||
1385 | window.launchQueue.setConsumer((launchParams) => { |
||
1386 | if (launchParams.targetURL) { |
||
1387 | // Redirect on new URL in focus-existing client mode |
||
1388 | window.location.href = launchParams.targetURL; |
||
1389 | } |
||
1390 | }); |
||
1391 | } |
||
1392 | </script> |
||
1393 | |||
1394 | <?php |
||
1395 | //$get = []; |
||
1396 | //$get['page'] = $request->query->get('page') === null ? '' : $request->query->get('page'); |
||
1397 | |||
1398 | // Load links, css and javascripts |
||
1399 | if (isset($SETTINGS['cpassman_dir']) === true) { |
||
1400 | include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php'; |
||
1401 | if ($menuAdmin === true) { |
||
1402 | include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php'; |
||
1403 | if ($get['page'] === '2fa') { |
||
1404 | include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php'; |
||
1405 | } elseif ($get['page'] === 'api') { |
||
1406 | include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php'; |
||
1407 | } elseif ($get['page'] === 'backups') { |
||
1408 | include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php'; |
||
1409 | } elseif ($get['page'] === 'emails') { |
||
1410 | include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php'; |
||
1411 | } elseif ($get['page'] === 'ldap') { |
||
1412 | include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php'; |
||
1413 | } elseif ($get['page'] === 'uploads') { |
||
1414 | include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php'; |
||
1415 | } elseif ($get['page'] === 'fields') { |
||
1416 | include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php'; |
||
1417 | } elseif ($get['page'] === 'options') { |
||
1418 | include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php'; |
||
1419 | } elseif ($get['page'] === 'statistics') { |
||
1420 | include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php'; |
||
1421 | } elseif ($get['page'] === 'tasks') { |
||
1422 | include_once $SETTINGS['cpassman_dir'] . '/pages/tasks.js.php'; |
||
1423 | } elseif ($get['page'] === 'oauth' && WIP === true) { |
||
1424 | include_once $SETTINGS['cpassman_dir'] . '/pages/oauth.js.php'; |
||
1425 | } elseif ($get['page'] === 'tools') { |
||
1426 | include_once $SETTINGS['cpassman_dir'] . '/pages/tools.js.php'; |
||
1427 | } |
||
1428 | } elseif (isset($get['page']) === true && $get['page'] !== '') { |
||
1429 | if ($get['page'] === 'items') { |
||
1430 | include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php'; |
||
1431 | } elseif ($get['page'] === 'import') { |
||
1432 | include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php'; |
||
1433 | } elseif ($get['page'] === 'export') { |
||
1434 | include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php'; |
||
1435 | } elseif ($get['page'] === 'offline') { |
||
1436 | include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php'; |
||
1437 | } elseif ($get['page'] === 'search') { |
||
1438 | include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php'; |
||
1439 | } elseif ($get['page'] === 'profile') { |
||
1440 | include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php'; |
||
1441 | } elseif ($get['page'] === 'favourites') { |
||
1442 | include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php'; |
||
1443 | } elseif ($get['page'] === 'folders') { |
||
1444 | include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php'; |
||
1445 | } elseif ($get['page'] === 'users') { |
||
1446 | include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php'; |
||
1447 | } elseif ($get['page'] === 'roles') { |
||
1448 | include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php'; |
||
1449 | } elseif ($get['page'] === 'utilities.deletion') { |
||
1450 | include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php'; |
||
1451 | } elseif ($get['page'] === 'utilities.logs') { |
||
1452 | include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php'; |
||
1453 | } elseif ($get['page'] === 'utilities.database') { |
||
1454 | include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php'; |
||
1455 | } elseif ($get['page'] === 'utilities.renewal') { |
||
1456 | include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php'; |
||
1457 | } |
||
1458 | } else { |
||
1459 | include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php'; |
||
1460 | } |
||
1461 | } |
||
1462 |
$lang->get('server_time'...server['request_time'])
can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.1 path for user data to reach this point
in vendor/symfony/http-foundation/ParameterBag.php on line 82
$this->server->get('UNENCODED_URL')
is assigned to$requestUri
in vendor/symfony/http-foundation/Request.php on line 1758
$requestUri
is returnedin vendor/symfony/http-foundation/Request.php on line 1793
AssignCoalesceNode
is returnedin vendor/symfony/http-foundation/Request.php on line 998
(string)$server['request_uri']
is assigned to$SETTINGS
in index.php on line 185
IssetNode ? $SETTINGS['date_format'] : 'Y-m-d'
is assigned to$date_format
in index.php on line 221
date()
in index.php on line 691
Preventing Cross-Site-Scripting Attacks
Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.
In order to prevent this, make sure to escape all user-provided data:
General Strategies to prevent injection
In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:
For numeric data, we recommend to explicitly cast the data: